var $win = $(window).width(); var $height = $(window).height(); var jfzlUrl = location.href $(function(){ if($height<680){ $(".jq_body .jqMenu .logo").hide(); $(".layout .fjContainer").addClass("miniHeight") } $(".dt2txtBox .tab1").click(function(){ $(".dt2txtBox .tab1,.dt2txtBox .tab2").removeClass("active") $(this).addClass("active") $(".listBox .list").removeClass("active").eq(0).addClass("active") }) $(".dt2txtBox .tab2").click(function(){ $(".dt2txtBox .tab1,.dt2txtBox .tab2").removeClass("active") $(this).addClass("active") $(".listBox .list").eq(1).addClass("active") }) var tween1 = gsap.timeline(), tween2 = gsap.timeline(); $('.slider').each(function () { var $this = $(this), $wrap = $this.find('.slider-wrap'), $ctrl = $this.find('.slider-ctrl'), $bar = $this.find('.slider-bar'); Draggable.create($bar, { type: 'x', bounds: $ctrl, allowContextMenu: true, zIndexBoost: false, onDrag: function onDrag() { var rate = this.x / ($ctrl.width() - $bar.width()), ww = $wrap.width(), sw = gsap.getProperty($wrap[0], 'scrollWidth'); tween1.pause(); tween2.pause(); if (sw > ww) { gsap.set($wrap, { scrollTo: { x: rate * (sw - ww) } }); } } }); }); if($win>=1180){ $('.layout').on('mousewheel', $.throttle(200, wheel)); $(".fj_unbind").hover(function(){ $('.layout').unbind(); },function(){ $('.layout').on('mousewheel', $.throttle(200, wheel)); }) } $('.jqNav li').on('click', function () { $(this).siblings().removeClass("active") $(this).addClass("active") var anchor = ".jqList".concat($(this).index()+1); goPage(anchor) }); $('.jqList4 .jqall i').on('click', function () { var anchor = ".jqList4Dt"; goPage(anchor) }); $('.jqList1 .jqall i').on('click', function () { var anchor = ".jqList2"; goPage(anchor) }); $('.jqList2 .jqall i').on('click', function () { var anchor = ".jqList3"; goPage(anchor) }); $('.jqList3 .jqall i').on('click', function () { var anchor = ".jqList4"; goPage(anchor) }); $('.jqList4Dt .jqall i').on('click', function () { var anchor = ".jqList5"; goPage(anchor) }); $(".jqList").on('touchstart', debounce(function(e){ if (e.cancelable) { // 鍒ゆ柇榛樿琛屼负鏄惁宸茬粡琚鐢 if (!e.defaultPrevented) { // e.preventDefault(); } } startX = e.originalEvent.changedTouches[0].pageX, startY = e.originalEvent.changedTouches[0].pageY; })) $(".jqList").on("touchend", debounce(function (e) { $(".slider-bar").on("touchend", function(e){ return false; }) if (e.cancelable) { // 鍒ゆ柇榛樿琛屼负鏄惁宸茬粡琚鐢 if (!e.defaultPrevented) { // e.preventDefault(); } } moveEndX = e.originalEvent.changedTouches[0].pageX, moveEndY = e.originalEvent.changedTouches[0].pageY, X = moveEndX - startX, Y = moveEndY - startY; if($(this).hasClass("jqList1")){ funjiuzhilvMove(X, ".jqListDt_fjzl",".jqList2") }else if($(this).hasClass("jqList2")){ funjiuzhilvMove(X, ".jqList1",".jqList3") }else if($(this).hasClass("jqList3")){ funjiuzhilvMove(X, ".jqList2",".jqList4") }else if($(this).hasClass("jqList4")){ funjiuzhilvMove(X, ".jqList3",".jqList4Dt") }else if($(this).hasClass("jqList4Dt")){ funjiuzhilvMove(X, ".jqList4",".jqList5") }else if($(this).hasClass("jqList5")){ funjiuzhilvMove(X, ".jqList4Dt","") }else if($(this).hasClass("jqListDt_fjzl")){ funjiuzhilvMove(X, ".jqList1",".jqList3") }else{} })) function funjiuzhilvMove(X,Cl,Cr){ if (X > 100) { // alert('宸︽粦'); if(Cl){ goPage(Cl) } } //鍙虫粦 else if (X < -100) { if(Cr){ goPage(Cr) } }else{ } } $('.cloud').each(function () { var $this = $(this); ScrollTrigger.create({ trigger: this, horizontal: true, scroller: '.layout', start: 'center right', onEnter: function onEnter() { $this.addClass('show'); }, onLeaveBack: function onLeaveBack() { $this.removeClass('show'); } }); }); if(jfzlUrl.indexOf("?") > 0){ var jump var fjUrlData = getUrlParams(jfzlUrl) if(fjUrlData && fjUrlData.channelID){ if(fjUrlData.channelID==135){ jump = ".jqNav ul li.OnlineTour" $(jump).click() return }else if(fjUrlData.channelID==136){ jump = ".jqNav ul li.repast" $(jump).click() return }else{} } if(fjUrlData && fjUrlData.className){ if($win>=1180){ jump = ".jqNav ul li."+fjUrlData.className $(jump).click() }else{ $(".layout .fjContainer .section").hide(); if(fjUrlData.className=="scenicArea"){ $(".layout .fjContainer .section.jqList1").show(); }else if(fjUrlData.className=="OnlineTour"){ $(".layout .fjContainer .section.jqList2").show(); }else if(fjUrlData.className=="repast"){ $(".layout .fjContainer .section.jqList3").show(); }else if(fjUrlData.className=="tourInformation"){ $(".layout .fjContainer .section.jqList4").show(); }else if(fjUrlData.className=="lvzx"){ $(".layout .fjContainer .section.jqList5").show(); }else{} var strClass = ".mjqMenuBox_in ."+fjUrlData.className $(strClass).addClass("active") } } } function debounce (fn, delay = 200) { let timer = null return function (...args) { if (timer) { clearTimeout(timer) timer = null } timer = setTimeout(() => { fn.apply(this, args) clearTimeout(timer) timer = null }, delay) } } function wheel(e) { if($win<1180){ return } var w = window.innerWidth var s = $(".layout").scrollLeft() if(sw*0.8 && sw*1.6 && sw*2.4 && s 0 ? '-' : '+'; if (window.matchMedia('(min-width: 1024px)').matches) { gsap.to('.layout', { scrollTo: { x: "".concat(step, "=").concat($(window).width() / 5) } }); } } function goPage(place){ var anchor = place?place:"jqList1" if (window.matchMedia('(min-width: 1024px)').matches) { gsap.to('.layout', { scrollTo: anchor }); } else { gsap.to(window, { scrollTo: { y: anchor, offsetY: 60 } }); } } // 鑾峰彇url鍙傛暟 function getUrlParams(url) { var urlStr = url.split('?')[1] var obj = {} var paramsArr = urlStr.split('&') for(var i=0, len = paramsArr.length; i=1180){ var custom1 = new scrollbot(".jqList .jqjs_info .txt"); var custom2 = new scrollbot(".jqList3 .cyzsRight .cyzsTxt"); var custom5 = new scrollbot(".dt2txtBox .listBox .list2"); try{ var custom4 = new scrollbot(".fj_jqDtBox .fj_jqTop .txt"); }catch(e){ console.log("e",e) } document.onreadystatechange = function(){ custom1.refresh(); custom2.refresh(); custom5.refresh(); try{ custom4.refresh(); }catch(e){ console.log("e1",e) } } }