/* * @Author: xy-xiaofei * @Date: 2016-01-28 13:43:54 * @Last Modified by: xy-xiaofei * @Last Modified time: 2016-04-27 15:41:30 */ $(function() { /*导航下拉*/ $('.top_ul>.hide_nav').hover(function(event) { $(this).children('ul').stop().slideDown(200); $(this).children('.vv').addClass('ff'); },function(){ $(this).children('ul').stop().slideUp(200); $(this).children('.vv').removeClass('ff'); }); /*轮播图*/ $('.flexslider').flexslider({ directionNav: false, pauseOnAction: false, slideshowSpeed: 4000, controlNav: true }); /*轮播图左右箭头*/ $(".flexslider").hover(function() { $('.flex-direction-nav li a').css('display', 'block'); }, function() { $('.flex-direction-nav li a').css('display', 'none'); }); /*文字滚动信息*/ $(".txtScroll-top").slide({titCell:".hd ul",mainCell:".bd ul",autoPage:true,effect:"topLoop",autoPlay:true,delayTime:1000,trigger:"click",mouseOverStop:false}); /*视频轮播图*/ var num=$('.show_off li img').height(); var num_li = $('.show_off li').length; num_li -= 4; num+=29; /*var num1=$('.big-img li').width();*/ var speed=500; timer=null; num2=0; function autoPlay(){ num2++; if(num2>num_li){ num2=0; } $('.show_off').stop().animate({top:(-num2*num)}, speed); }; function backPlay(){ num2--; if (num2 < 0) { num2= num_li; } $('.show_off').stop().animate({top:(-num2*num)}, speed); }; //自动播放 /*timer=setInterval(autoPlay,2000);*/ // $('.show_off').hover(function() { // clearInterval(timer); // }, function() { // timer=setInterval(autoPlay,2000); // }); $('.w_r .s-next').click(function(event) { autoPlay(); }); $('.w_r .s-prev').click(function(event) { backPlay(); }); $('.w_r ul li').click(function(event) { //点击缩略图更换大图 var as ; as = $(this).find('img').attr('rel'); var mm; mm = $(this).find('img').attr('res'); $('.video-current').removeClass(); $(this).addClass('video-current'); $('#videoa').html(''); //$('#big_pic').attr('src', as); }); /*集团信息图片悬停*/ $('.gro-con li').hover(function() { var index=$(this).index(); $(this).css('box-shadow', '0px 0px 25px #999').children('.gro-text').css('opacity', '0.9'); }, function() { $(this).css('box-shadow', '0px 0px 25px #fff').children('.gro-text').css('opacity', '0.8'); }); /*更多的变化*/ $(".group").hover(function() { $(this).children('.tit-wrap').children('.more').addClass('current'); }, function() { $(this).children('.tit-wrap').children('.more').removeClass('current'); }); /*列表页*/ /*集团新闻切换*/ /*$(".tit-wrap .g-tit").hover(function() { var index1=$(this).index(); $(this).addClass('current').siblings('p').removeClass('current'); $(".group .group-con").eq(index1).addClass('show').siblings('.group-con').removeClass('show'); $(".group .con-text").eq(index1).addClass('show').siblings('.con-text').removeClass('show'); });*/ /*首页产品中心轮播图*/ $('.pro-group .pro-list li').hover(function() { $(this).css('box-shadow', '0px 0px 15px #d1d1d1'); $(this).children('.gro-text').css('color', '#1ea3dc'); }, function() { $(this).css('box-shadow', '0px 0px 15px #fff'); $(this).children('.gro-text').css('color', '#666'); }); /*列表页下拉框*/ var bb = true; $('.xiala-nav').click(function(event) { $(this).children('.xia-list').stop().slideToggle(400); if (bb == true) { $('.xia-tit .s-2 img').css('transform', 'rotate(180deg)'); bb=false; } else{ $('.xia-tit .s-2 img').css('transform', 'rotate(0deg)'); bb=true; }; }); /*产品列表页*/ /*点击左边列表右边图片变化*/ $('.product-wrap .product-nav li').click(function(event) { var proIndex=$(this).index(); $(this).addClass('border').siblings('li').removeClass('border'); $('.product-con').eq(proIndex).show().siblings('.product-con').hide(); }); /*右边图片划过字体颜色改变*/ $('.product-con a').hover(function() { $(this).children('.con-list-p').css('color', '#35a0d3'); }, function() { $(this).children('.con-list-p').css('color', '#666'); }); /*孔庙详情页面轮播图*/ var kowidth=$('.kong-group .pro-list li').width(); var konum_li = $('.kong-group .pro-list li').length; konum_li -= 3; kowidth+=18; var speed=500; timer=null; konum2=0; koindex=0; function koautoPlay(){ konum2++; koindex=konum2; koindex+=1; if(konum2>konum_li){ konum2=0; $('.kong-group .pro-list').stop().animate({left:0}, 500); }else{ $('.kong-group .pro-list').stop().animate({left:(-konum2*kowidth)}, 500); } }; function kobackPlay(){ konum2--; if (konum2 < 0) { konum2= konum_li; $('.kong-group .pro-list').stop().animate({left:(-konum2*kowidth)}, 500); }else{ $('.kong-group .pro-list').stop().animate({left:(-konum2*kowidth)}, 500); } }; $('.kong-group .pro-l').click(function(event) { kobackPlay(); }); $('.kong-group .pro-r').click(function(event) { koautoPlay(); }); /*列表页上一页下一页*/ $('.our .prev-page,.our .next-page').hover(function() { $(this).children('.prev,.next').css('background', '#1ea3dc'); $(this).children('.p-page,.n-page').css('color', '#1ea3dc'); }, function() { $(this).children('.prev,.next').css('background', '#ddd'); $(this).children('.p-page,.n-page').css('color', '#333'); }); /*视频列表页图片加阴影*/ $('.video-list li').hover(function() { $(this).children('p').css('color', '#35a0d3'); }, function() { $(this).children('p').css('color', '#666'); }); /*荣誉详情页轮播*/ var rynum=0; var ryindex=0; var rywidth=$('.strip_of_thumbnails').width(); var rylen=$('.strip_of_thumbnails').length; rylen-=1; $('.rightArrow').click(function(event) { rynum++; ryindex=rynum; if (rynum > rylen) { $('#DHTMLgoodies_thumbs_inner').css('left', 0); rynum=0; } else{ $('#DHTMLgoodies_thumbs_inner').stop().animate({left: -rynum*rywidth}, 500); }; }); $('.leftArrow').click(function(event) { rynum--; if (rynum < 0) { $('#DHTMLgoodies_thumbs_inner').css('left', -rywidth*rylen); rynum=rylen; } else{ $('#DHTMLgoodies_thumbs_inner').stop().animate({left: -rynum*rywidth}, 500); }; }); $('.strip_of_thumbnails>div a').click(function(event) { var as; $('.activeImage').removeClass(); $(this).children('img').addClass('activeImage'); as = $(this).find('img').attr('src'); $('#BIG').attr('src', as); }); /*荣誉详情页tab文章*/ $('#RYBtn .RYBtn').click(function(event) { var tabIndex=$(this).index(); $(this).addClass('RYBlue').siblings('.RYBtn').removeClass('RYBlue'); tabIndex-=1; $('.list-tab .rongyu_ul').eq(tabIndex).css('display', 'block').siblings('.rongyu_ul').css('display', 'none'); }); $('.TOP').click(function(event) { $('.list-tab .rongyu_ul').css('display', 'none'); $('.list-tab .rongyu_ul').css('display', 'block'); }); /*集团成员下拉列表*/ $('.ContactAll .ConList').click(function(event) { $('.ConTit').removeClass('clickcont'); $(this).children('.ConTit').addClass('clickcont'); $('.ConAdd').stop().slideUp(200); $(this).children('.ConAdd').stop().slideDown(200); $('.ConTit span').removeClass('s-color'); $(this).children('.ConTit').children('span').addClass('s-color'); }); /*点击左边列表右边列表替换*/ /*$('.product-wrap .product-nav li').click(function(event) { var jituindex=$(this).index(); $('.ji_right .ji-r-list #ji-list-li').eq(jituindex).stop().show().siblings('#ji-list-li').stop().hide();//右边相同的index显示其它的隐藏 $('.ji_right .ji-r-list #ji-list-li .ConList').children('.ConTit').removeClass('clickcont');//右边显示的第一条加上背景蓝色 $('.ji_right .ji-r-list #ji-list-li .ConList').children('.ConTit').children('span').removeClass('s-color');//第一个序号为白色 $('.ji_right .ji-r-list #ji-list-li .ConList').children('.ConAdd').hide();//第一个下拉显示 $('.ji_right .ji-r-list #ji-list-li #show').children('.ConTit').addClass('clickcont');//右边显示的第一条加上背景蓝色 $('.ji_right .ji-r-list #ji-list-li #show').children('.ConTit').children('span').addClass('s-color');//第一个序号为白色 $('.ji_right .ji-r-list #ji-list-li #show').children('.ConAdd').show();//第一个下拉显示 });*/ /*搜索页面*/ $('.search-wrap .search-nav li').click(function(event) { var seaIndex=$(this).index(); $(this).addClass('border').siblings('li').removeClass('border'); $('.search-con').eq(seaIndex).show().siblings('.search-con').hide(); }); var videoh=$('.p-3 a video').height(); var videoh1=$('.p-3 a img').height(); $('.p-3').css('height', videoh); $('.p-3').css('height', videoh1); }); /*弹窗*/ $('.tanwrap').click(function(event) { $(this).fadeOut('300'); $('body').css('overflow',"auto"); }); function CLOSED(){ $('.tanwrap').fadeOut('300'); $('body').css('overflow',"auto"); } var timer=null; /*timer=setTimeout(CLOSED, 7000);*/