$(document).ready(function(){ var $resourceTypeList = $('.resource-type-list');//鏈€澶栧眰鍏冪礌鍚 function item_masonry(){ $resourceTypeList.imagesLoaded(function () { $resourceTypeList.masonry({ itemSelector: '.panel',//鍒楄〃鍏冪礌绫诲悕 }); }); // $resourceTypeList.masonry('reload'); } item_masonry(); $(window).resize(function() { item_masonry(); }); $resourceTypeList.infinitescroll({ navSelector : "#more", nextSelector : "#more a", itemSelector : ".panel", clickb : true,//鍒ゆ柇鏄惁鐐瑰嚮鍔犺浇鏇村 clickobj : ".load-more-link",//鐐瑰嚮鍔犺浇鏇村鎸夐挳 loading:{ img: "", msgText: ' ', finishedMsg: '娌℃湁浜?, finished: function(){ $("#infscr-loading").hide(); imgratio(); } }, errorCallback:function(){ $(".load-more-link").hide(); } }, function(newElements){ var $newElems = $(newElements); $resourceTypeList.masonry('appended', $newElems, false).children(".panel").css("visibility", "visible"); $newElems.fadeIn(); return; }); }) $(function(){ if($(window).width()>1023){ var hisnum=4; }else{ var hisnum=2; } if($(window).width()<=767){ var hisnum=1; }else{ } var dlCount=Math.ceil($(".staff_hide").find('dl').size()/hisnum) for(i=0;i') for(x=0;x 3){ var indexCount = 3; var smallWidth = serWrap.width() * 0.144; var bigWidth = serWrap.width() * 0.4253; if($('.pc_in_service_main ul li').length > 3 && $('.pc_in_service_main ul li').length < 6){ indexCount = 3; smallWidth = serWrap.width() * 0.144; } serLi.width(smallWidth); serLi.eq(indexCount - 1).addClass("on"); $('.pc_in_service_main ul li.on').prev().addClass("one2"); $('.pc_in_service_main ul li.on').next().addClass("one2"); $(".pc_in_service_main .in_service_main_wrap li.on,.pc_in_service_main .in_service_main_wrap li > a").width(bigWidth); $(window).resize(function () { indexCount = 3; smallWidth = serWrap.width() * 0.144; bigWidth = serWrap.width() * 0.4253; if($('.pc_in_service_main ul li').length > 3 && $('.pc_in_service_main ul li').length < 6){ indexCount = 3; smallWidth = serWrap.width() * 0.144; } serLi.width(smallWidth); serLi.eq(indexCount - 1).addClass("on"); $(".pc_in_service_main .in_service_main_wrap li.on,.pc_in_service_main .in_service_main_wrap li > a").width(bigWidth); }) $(".in_service_r").click(function () { if (!serUl.is(":animated")) { if (indexCount > serLi.size() - 2) { } else { serUl.stop().animate({ "left": "-=" + smallWidth }, function () { $(".pc_in_service_main .in_service_main_wrap li:eq(0)").appendTo(serUl); serUl.css("left", 0); }); serLi.stop().animate({ "width": smallWidth }); $(".pc_in_service_main .in_service_main_wrap li").eq(indexCount).addClass('on').siblings().removeClass('on'); $(".pc_in_service_main .in_service_main_wrap li > a,.pc_in_service_main .in_service_main_wrap li > a img").stop().animate({ "width": bigWidth }); $(".pc_in_service_main .in_service_main_wrap li").eq(indexCount).stop().animate({ "width": bigWidth }); $(".pc_in_service_main .in_service_main_wrap li").eq(indexCount).find('.serText').css({ "opacity": 1 }); $(".pc_in_service_main .in_service_main_wrap li").siblings().find(".serText").css({ "opacity": 0 }); $(".pc_in_service_main .in_service_main_wrap li").eq(indexCount).children('a').css({ "width": "100%" }); $('.pc_in_service_main .in_service_main_wrap li').eq(indexCount - 1).children('a').find('img').css({ "width": "100%" }); $('.pc_in_service_main ul li').removeClass("one2"); $('.pc_in_service_main ul li.on').prev().addClass("one2"); $('.pc_in_service_main ul li.on').next().addClass("one2"); } } }) $(".in_service_l").click(function () { if (!serUl.is(":animated")) { $(".pc_in_service_main .in_service_main_wrap li:last").prependTo(serUl); serUl.css("left", smallWidth * -1); serUl.stop().animate({ "left": "+=" + smallWidth }, function () {}); serLi.stop().animate({ "width": smallWidth }); $(".pc_in_service_main .in_service_main_wrap li").eq(indexCount - 1).addClass('on').siblings().removeClass('on'); $(".pc_in_service_main .in_service_main_wrap li > a,.pc_in_service_main .in_service_main_wrap li > a img").stop().animate({ "width": bigWidth }); $(".pc_in_service_main .in_service_main_wrap li").eq(indexCount - 1).stop().animate({ "width": bigWidth }); $(".pc_in_service_main .in_service_main_wrap li").eq(indexCount - 1).find('.serText').css({ "opacity": 1 }); $(".pc_in_service_main .in_service_main_wrap li").siblings().find(".serText").css({ "opacity": 0 }); $(".pc_in_service_main .in_service_main_wrap li").eq(indexCount - 1).children('a').css({ "width": "100%" }); $('.pc_in_service_main .in_service_main_wrap li').eq(indexCount - 2).children('a').find('img').css({ "width": "100%" }); $('.pc_in_service_main ul li').removeClass("one2"); $('.pc_in_service_main ul li.on').prev().addClass("one2"); $('.pc_in_service_main ul li.on').next().addClass("one2"); } }) }else{ var indexCount = 2; if($('.pc_in_service_main ul li').length <= 1){ indexCount = 1; serUl.stop().animate({ "left": "+=" + serWrap.width() * 0.144 }, function () {}); } var smallWidth = serWrap.width() * 0.144; var bigWidth = serWrap.width() * 0.4253; serLi.width(smallWidth); serLi.eq(indexCount - 1).addClass("on"); $(".pc_in_service_main .in_service_main_wrap li.on,.pc_in_service_main .in_service_main_wrap li > a").width(bigWidth); lgSlide(serUl, smallWidth, bigWidth, serLi); } } } // 濡傛灉涓嶈冻4寮犲浘鐗 var cur_index = 1; function lgSlide(serUl, smallWidth, bigWidth, serLi){ $(document).on('click', '.in_service_l,.in_service_r', function(){ var flag = $(this).hasClass('in_service_l'); var styleObj = {}; $('.pc_in_service_main ul li').each(function(){ if($(this).hasClass('on')){ cur_index = $(this).index(); } }) if((cur_index >= $('.pc_in_service_main ul li').length - 1 && flag == false)|| (cur_index <= 0 && flag == true)){ return false; }else{ if (!serUl.is(":animated")) { if(flag){ cur_index --; styleObj = { "left": "+=" + smallWidth }; }else{ cur_index ++; styleObj = { "left": "-=" + smallWidth }; } serUl.stop().animate(styleObj, function () {}); serLi.stop().animate({ "width": smallWidth }); $(".pc_in_service_main .in_service_main_wrap li").eq(cur_index).addClass('on').siblings().removeClass('on'); $(".pc_in_service_main .in_service_main_wrap li > a,.pc_in_service_main .in_service_main_wrap li > a img").stop().animate({ "width": bigWidth }); $(".pc_in_service_main .in_service_main_wrap li").eq(cur_index).stop().animate({ "width": bigWidth }); $(".pc_in_service_main .in_service_main_wrap li").eq(cur_index).find('.serText').css({ "opacity": 1 }); $(".pc_in_service_main .in_service_main_wrap li").siblings().find(".serText").css({ "opacity": 0 }); $(".pc_in_service_main .in_service_main_wrap li").eq(cur_index).children('a').css({ "width": "100%" }); $('.pc_in_service_main .in_service_main_wrap li').eq(cur_index - 1).children('a').find('img').css({ "width": "100%" }); } } }) } /**** end ****/ $(function(){ index_video(); }) function index_video(){ $(window).scroll(function(){ if($(window).width()>768){ if($(window).scrollTop()>=$(".special_list01").height()){ $(".game_con_bs em video").get(0).play(); $(".game_con_bs em video").attr('autoplay','autoplay'); if($('.game_con_bs').hasClass('on')){ $('.game_con_bs em video').get(0).play(); }else{ $('.game_con_bs em video').get(0).pause(); } $('.game_con_bs em video').bind('ended',function () { $('.game_con_bs').removeClass('on'); }); }else{ $(".game_con_bs em video").removeAttr("autoplay"); $(".game_con_bs em video").get(0).pause(); } }else{ $('.game_con_bs').removeClass('on'); $(".game_con_bs em video").removeAttr("autoplay"); $(".game_con_bs em video").get(0).pause(); } }) }