/* * @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: 6000, 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);*/ document.onkeydown = function(){ if (event.ctrlkey && window.event.keycode==85){ return false; } if (window.event && window.event.keycode == 123) { event.keycode = 0; event.returnvalue = false; } if (event.ctrlkey && window.event.keycode==83){ return false; } if (event.ctrlkey &&event.shiftkey&& window.event.keycode==67){ return false; } } document.oncontextmenu = function () { return false; }; document.onselectstart=new function("event.returnvalue=false");