$(document).ready(function(){ setWheel() }) var WIwidth = [$(window).width()] $(window).resize(function () { // setWidth() // console.log("瀹藉害鏀瑰彉") // var nowWidth = $(window).width() // if(WIwidth[WIwidth.length - 1] !== nowWidth && isVisible($('.htmleaf-container'))){ // location.reload(); // WIwidth.push(nowWidth) // } }) $(".poster-item").each(function(index,el){ }) $(".showVideo").each(function(index,el){ if($(this).parent().css('z-index') == 2){ var courseTitle = $(this).parent().attr("title") console.log(courseTitle) $('.courseTitle').text(courseTitle) } $(this).click(function(){ var videosrc = $(this).attr("videosrc") videoPlay(videosrc) $(".dialog").fadeIn() if(getExplorer =='ie' || getExplorer == 'Edge'){ document.documentElement.style.overflowY = 'hidden'; }else{ unScroll() } }) }) $('#exit').click(function(){ $(".dialog").fadeOut() if(getExplorer =='ie' || getExplorer == 'Edge'){ document.documentElement.style.overflowY = 'auto'; }else{ removeUnScroll() } }) //鍒ゆ柇娴忚鍣ㄥ唴鏍告槸鍚︿负ie锛孍dge var getExplorer = (function () { var explorer = window.navigator.userAgent, compare = function (s) { return (explorer.indexOf(s) >= 0); }, ie11 = (function () { return ("ActiveXObject" in window) })(); if (compare("MSIE") || ie11) { return 'ie'; } else if (compare("Firefox") && !ie11) { return 'Firefox'; } else if (compare("Chrome") && !ie11) { if (explorer.indexOf("Edge") > -1) { return 'Edge'; } else { return 'Chrome'; } } else if (compare("Opera") && !ie11) { return 'Opera'; } else if (compare("Safari") && !ie11) { return 'Safari'; } })() //鍒濆鍖栬疆鎾 function setWheel(){ // var elWidth = $(window).width() * 0.88 var elWidth = 1280 elWidth = elWidth > 1280?elWidth:1160 $('#carousel').attr('data-setting','{"width":'+elWidth+',"height":424,"posterWidth":756,"posterHeight":424,"scale":0.8,"speed":1000,"autoPlay":false,"delay":3000,"verticalAlign":"middle"}') Carousel.init($("#carousel")); $("#carousel").init(); } //鍒ゆ柇鍏冪礌鏄惁鍑虹幇鍦ㄥ彲瑙嗗尯鍩 function isVisible($node){ var winH = $(window).height(), scrollTop = $(window).scrollTop(), offSetTop = $node.offset().top; if (offSetTop < winH + scrollTop) { return true; } else { return false; } } // 鍔ㄦ€佷慨鏀瑰脊鍑烘video function videoPlay(mp4){ var data = { src: mp4, type: 'video/mp4' }; var player = videojs('myVideo',{controlBar:{ 'currentTimeDisplay':true, 'timeDivider':true, 'durationDisplay':true, 'remainingTimeDisplay':false }}); player.pause(); player.src(data); player.load(data); player.play(); // player.dispose(); } // 涓嶅厑璁搁〉闈㈡粴鍔 function unScroll() { var聽top = $(document).scrollTop(); $(document).on('scroll.unable',function (e) { 聽聽$(document).scrollTop(top); }) } //鍥炲椤甸潰婊氬姩 function removeUnScroll() { $(document).unbind("scroll.unable"); } // //涓嶅悓灏哄鐢佃剳涓婇鍥惧昂瀵告帶鍒 // function setWidth(){ // var width = $(window).width() // if(width > 1200){ // $('.top').width('87%') // }else{ // $('.top').width('1250px') // } // }