/* 回到顶部 */ jQuery(document).ready(function($){ $(".qqkefu .top").click(function () { $("html,body").animate({ "scrollTop": 0 }, 300); }); $(window).scroll(function () { var scrollTop = document.body.scrollTop; var y = $('.top').offset().top; if (scrollTop > 900 || y > 900) { $(".top2").css({ "opacity": "0.9", "filter": "alpha(opacity=90)" }); } else { $(".top2").css({ "opacity": "0", "filter": "alpha(opacity=0)" }); } }); }); /* 列表栏目导航 */ // 滚动位置固定 /* $(function(){ var top2=$('.j-position').position().top; $(document).scroll(function(e){ if($(document).scrollTop()>1000){ $('.j-position').css({'position':'fixed','top':'0','z-index':'99999','background-color':'#fff','opacity':'0.95','box-shadow':'0 0px 20px rgba(0,0,0,0.2)'}) $('.j-position').addClass("j-position2"); }else{ $('.j-position').css({'position':'absolute','top':'0','color':'#666','background':'none','border-bottom':'none','box-shadow':'none'}) $('.j-position').removeClass("j-position2"); }; }); });*/ /* 案例详情页切换 */ $(function(){ $(".show_case_top li").click(function(){ $(this).addClass('on').siblings('li').removeClass('on'); if(typeof(that)!="undefined"){ $(that).removeClass("on"); } $(this).addClass('on'); that=this; var index = $(this).index(); number = index; $('.show_case_con').hide(); $('.show_case_con:eq('+index+')').show(); }); }); /* 点击滚动下滑 */ $('.downSider').click(function(){ $('html').stop().animate({ scrollTop : w_height },500,"easeInOutExpo"); }) /* 弹窗表单 */ jQuery(function () { var innerBox = $('.tc-message'); jQuery('.j_message').click(function () { $('#videobox').html(innerBox); innerBox.show(); jQuery(".vwrap").fadeIn(); }); jQuery(".vwrap .close,.vwrap .videobtg").click(function () { jQuery(".vwrap").fadeOut(); innerBox.hide(); }); }); /* 弹窗视频 */ jQuery(function () { var innerBox2 = $('.tc-message2'); jQuery('.j_message2').click(function () { $('#videobox2').html(innerBox2); innerBox2.show(); jQuery(".vwrap2").fadeIn(); }); jQuery(".vwrap2 .close2,.vwrap2 .videobtg2").click(function () { jQuery(".vwrap2").fadeOut(); innerBox2.hide(); }); }); // 飘入 js $(function(){ var elmArr = [], $win = $(window); $(".visible").each(function(i,elm){ $(elm).data("ot",$(elm).offset().top); $(elm).data("ht",$(elm).innerHeight()); elmArr.push(elm); }); dealClass(1); $win.on("scroll",dealClass); function dealClass(isRemove){ var top = $win.height() + $win.scrollTop(); if(isRemove!=1) { //滚动页面时的判断,并添加class="visible" for (var i = 0,$elem; i < elmArr.length; i++) { $elem = $(elmArr[i]); var elemH = $elem.data("ht"); var elemT = $elem.data("ot"); var showH = elemT + (elemH / 2); if (showH <= top) { $elem.addClass("visible"); elmArr.splice(i, 1); --i; } } }else{ //初始化页面时的判断,并删除class="visible" for (var i = 0,$elem; i < elmArr.length; i++) { $elem = $(elmArr[i]); if ($elem.data("ot") >= top) { $elem.removeClass("visible"); } } } } }) /* jq选项卡 */ $(function(){ $(".erji_xxk dd").hover(function(){ $(this).addClass('on').siblings('dd').removeClass('on'); if(typeof(that)!="undefined"){ $(that).removeClass("on"); } $(this).addClass('on'); that=this; var index = $(this).index(); number = index; $('.tnav .erji_con').hide(); $('.tnav .erji_con:eq('+index+')').show(); }); }); $(function(){ $(".swby_main1_xxk li").hover(function(){ $(this).addClass('on').siblings('li').removeClass('on'); if(typeof(that)!="undefined"){ $(that).removeClass("on"); } $(this).addClass('on'); that=this; var index = $(this).index(); number = index; $('.swby_main1 .swby_main1_con').hide(); $('.swby_main1 .swby_main1_con:eq('+index+')').show(); }); }); /* 友情链接 */ /* $('.link').hover(function(){ $('.link-list').slideToggle(); }); */ // FAQ 常见问题 $(".question").on('click',function(){ if ($(this).next().is(":hidden")) { $('.answer').slideUp(); $('.question').removeClass('on'); $(this).next().slideDown(); $(this).addClass('on'); } else { $(this).next().slideUp(); $(this).removeClass('on'); } return false; }); /* 侧边栏弹窗 */ /*jQuery(".picScroll-left2").slide({titCell:".hd ul",mainCell:".bd ul",autoPage:true,effect:"left",vis:4,delayTime:1000,trigger:"click"}); jQuery(".picScroll-left3").slide({titCell:".hd ul",mainCell:".bd ul",autoPage:true,effect:"left",vis:4,delayTime:1000,trigger:"click"}); jQuery(".picScroll-left").slide({titCell:".hd ul",mainCell:".bd ul",autoPage:true,effect:"left",autoPlay:false,scroll:4,vis:4,trigger:"click"}); jQuery(".picScroll-left4").slide({titCell:".hd ul",mainCell:".bd ul",autoPage:true,effect:"left",autoPlay:false,scroll:4,vis:4,trigger:"click"});*/ // 首页视频 js /*$(function() { if (!isMobile()) { $(window).scroll(function() { var winS = $(window).scrollTop(), newproS = $('.synewproli').offset().top - $(window).height() + 80, syvS = $('.syv').offset().top - $(window).height() + 80; if (winS >= newproS) { Enter($('.synewproli'), "top", 0, 1, 400, 500); } if (winS >= syvS) { Enter($('.syv'), "top", 0, 1, 400, 500); } }) } }); $('.vbd video').load(function() { var bdvideo = new FullBg($('.vbd'), $('.vbd video')); }) if (!isMobile()) { if ($('.syvideo').find('video').length > 0) { var syvMedia = document.getElementById('syvMedia'); $('.syvideo').hover(function() { $(this).find('video').stop(true, true).animate({ "opacity": 1 }, 600); syvMedia.play(); }, function() { $(this).find('video').stop(true, true).animate({ "opacity": 0 }, 600, function() { if (syvMedia.played) { syvMedia.pause(); } }) }); } }*/