function ajaxlist(urls, data, fun) { $.ajax({ url: urls, type: 'post', data: data, datatype: 'html', beforesend: function (data) {}, success: fun, complete: function (data) {} }) } function videoclick(el) { var vidcontainer = $(".vidcontainer"), video = $(".vidcontainer video"), videowrap = $('.vidcontainer iframe'); el.delegate(".li", "click", function (ev) { ev.stoppropagation ev.preventdefault var _this = $(this); var vid = _this.data("src"); var link = _this.data('link'); // ev.preventdefault(); if (link) { videowrap.attr('src', link); vidcontainer.fadein(); videowrap.stop().show(); video.stop().hide(); return; } else if (vid) { video.attr("src", vid); vidcontainer.fadein(); video.get(0).play(); videowrap.stop().hide(); video.stop().show(); } }) $(".vidcontainer .closevid,.vidcontainer .mask").on("click", function (ev) { ev.stoppropagation(); if (!$(ev.target).hasclass("video")) { video.get(0).pause(); vidcontainer.fadeout(function () { video.attr("src", ""); videowrap.attr('src', ''); videowrap.stop().show(); video.stop().show(); }) } }) } function scrollanimation(ele) { $(ele).each(function () { var _this = $(this); if (_this.offset().top + 500 > $(window).scrolltop() + $(window).height() || _this.offset().top < $(window).scrolltop() - _this.outerheight()) {} else if ($(window).scrolltop() >= _this.offset().top - $(window).height() * 0.92) { _this.addclass('animate'); } }); $(window).scroll(function () { $(ele).each(function () { var _this = $(this); if (_this.offset().top > $(window).scrolltop() + $(window).height() || _this.offset().top < $(window).scrolltop() - _this.outerheight()) {} else if ($(window).scrolltop() >= _this.offset().top - $(window).height() * 0.92) { _this.addclass('animate'); } }); }); } function videoclick(el) { var vidcontainer = $(".vidcontainer"), video = $(".vidcontainer video"), videowrap = $('.vidcontainer iframe'); el.delegate(".play-btn", "click", function (ev) { var _this = $(this); var vid = _this.data("src"); var link = _this.data('link'); ev.preventdefault(); if (link) { videowrap.attr('src', link); vidcontainer.fadein(); videowrap.stop().show(); video.stop().hide(); return; } else if (vid) { video.attr("src", vid); vidcontainer.fadein(); video.get(0).play(); videowrap.stop().hide(); video.stop().show(); } }) $(".vidcontainer .closevid,.vidcontainer .mask").on("click", function (ev) { ev.stoppropagation(); if (!$(ev.target).hasclass("video")) { video.get(0).pause(); vidcontainer.fadeout(function () { video.attr("src", ""); videowrap.attr('src', ''); videowrap.stop().show(); video.stop().show(); }) } }) } function scrollno() { $(window).scroll(function () { var before = $(window).scrolltop(); $(window).scroll(function () { var after = $(window).scrolltop(); if (before < after && window.innerwidth > 1024 && before > 0) { $('header').addclass('headroom-unpinned'); before = after; if (after > 20) { $('.pc-header').addclass('down'); } else { $('.pc-header').removeclass('down'); } }; if (before > after && window.innerwidth > 1024) { if (after > 20) { $('.pc-header').addclass('down'); } else { $('.pc-header').removeclass('down'); } $('.pc-header').removeclass('headroom-unpinned'); before = after; }; }) }) } function changeheader() { $(window).scroll(function () { var top = $(window).scrolltop(); if (top > 0) { $('.pc-header').addclass('white'); } else { $('.pc-header').removeclass('white'); } }) } function backtop() { var $backtop = $('.totop'); var timer = null; $backtop.hover(function() { $(this).addclass('on') }, function() { $(this).removeclass('on') }); var scrolltop = $(this).scrolltop(); $(window).scroll(function() { scrolltop = $(this).scrolltop(); if ($(window).scrolltop() > 900) { $(".xf ").addclass("on") } else { $(".xf ").removeclass('on') } }) $backtop.click(function() { timer = setinterval(function() { var movetop = math.floor(scrolltop / 10); $(window).scrolltop(scrolltop - movetop); if (movetop <= 0) { clearinterval(timer); } }, 10); }) $(document).on('mousewheel', function() { clearinterval(timer); }); } if ($(window).width() < 996) { $(" footer .nav .li ").click(function() { $(this).find(".sub").slidedown() $(this).siblings().find(".sub").slideup() }) } backtop(); // $("body").on("click",".pdf",function () { // console.log(1) // var file = "?file=" + $(this).attr("data-file") // var url = "../../bocweb/pdf/web/viewer.html"; // url = url + file // console.log(url) // openpdf(url) // }) // function openpdf(url) { // window.open(url) // } function getnav(item) { var onav = $('.aboutadd'); //瀵艰埅澹� var anav = onav.find('.list a'); //瀵艰埅 var adiv = item; //妤煎眰 anav.eq(0).addclass('on').siblings().removeclass("on"); $(window).scroll(function () { //鍙绐楀彛楂樺害 var winh = $(window).height(); //榧犳爣婊氬姩鐨勮窛绂� var itop = $(window).scrolltop(); // //榧犳爣婊戝姩鏍峰紡鏀瑰彉 adiv.each(function () { if (winh + itop - $(this).offset().top > winh / 5) { var _this = $(this).index(); // console.log(_this) anav.removeclass('on'); anav.eq(_this).addclass('on'); } }) if (itop < 5) { anav.eq(0).addclass('on').siblings().removeclass("on"); } }) anav.on("click", function () { var index = $(this).index(); var top = adiv.eq(index).offset().top - 70; $(this).addclass("on").siblings().removeclass("on"); $("body,html").animate({ scrolltop: top }, 1000); }) }