$(document).ready(function () { $(".drop-down-menu ul li").mouseover(function() { $(this).children("ul").show(); $(this).addClass("hover"); $(this).children(".icon01").hide(); $(this).children(".icon02").show(); }); $(".drop-down-menu ul li").mouseout(function() { $(this).children("ul").hide(); $(this).removeClass("hover"); $(this).children(".icon01").show(); $(this).children(".icon02").hide(); }); $(".drop-menu-click ul li").click(function() { $(this).children("ul").show(); $(this).addClass("hover"); $(this).children(".icon01").hide(); $(this).children(".icon02").show(); }); var noclassimg = { 'margin-right':'0px', 'float':'right' }; $("[name=liall2]").each(function(){ $(this).children().each(function(index,element){ if((index+1)%2 ==0){ $(this).css(noclassimg); } }); }); $("[name=liall4list]").each(function(){ $(this).children().each(function(index,element){ if((index%4) ==0){ $(this).addClass('a1'); }else if((index%4)==1){ $(this).addClass('a1'); }else if((index%4)==2){ $(this).addClass('a3'); }else if((index%4)==3){ $(this).addClass('a3'); } }); }); $("[name=liall6list]").each(function () { $(this).children().each(function (index, element) { if ((index % 6) == 0) { $(this).addClass('a1'); } else if ((index % 6) == 1) { $(this).addClass('a1'); } else if ((index % 6) == 2) { $(this).addClass('a1'); } else if ((index % 6) == 3) { $(this).addClass('a3'); } else if ((index % 6) == 4) { $(this).addClass('a3'); } else if ((index % 6) == 5) { $(this).addClass('a3'); } }); }); $("[name=liall3]").each(function(){ $(this).children().each(function(index,element){ if((index+1)%3 ==0){ $(this).css(noclassimg); } }); }); $("[name=liall3a]").each(function(){ $(this).children().each(function(index,element){ if((index+1)%3 ==0){ $(this).css(noclassimg); } }); }); $("[name=liall4]").each(function(){ $(this).children().each(function(index,element){ if((index+1)%4 ==0){ $(this).css(noclassimg); } }); }); $("[name=liall5]").each(function(){ $(this).children().each(function(index,element){ if((index+1)%5 ==0){ $(this).css(noclassimg); } }); }); //图片切换 $(".imgmore").each(function(i,v){ JDT("#fl_focus_"+(i+1)); }); $(".imgmore1").each(function(i,v){ JDT("#f2_focus_"+(i+1)); }); //下面的分享 var content_h = $(".con-tent").height(); if (content_h > 300) { $(".down-share").css('display','block'); } else { $(".down-share").css('display','none'); }; $('#close-btn').click(function(){ $('.browser-warning').hide(); }); $(".add-type a").addClass('type-show'); $(".add-type a:last-child").show(); //菜单悬浮 try{ var a = document.getElementById("top-menu").offsetTop; $(window).scroll(function() { var h_num = $(window).scrollTop(); if (h_num > a) { $('#top-menu').addClass('fixer'); $('.yb_top').css('display','block'); $('.pub-menu-new>.drop-down-menu>ul>li>ul').removeClass('left-m'); } else { $('#top-menu').removeClass('fixer'); $('.yb_top').css('display','none'); $('.pub-menu-new>.drop-down-menu>ul>li>ul').addClass('left-m'); } }); }catch (e) { } //导航菜单悬浮 try{ var c = document.getElementById("load-buy").offsetTop; $(window).scroll(function() { var h_num = $(window).scrollTop(); if (h_num > c) { $('#load-buy').addClass('fixer-sub'); $('#load-buy').css('width','1000px'); $('.r-btn-white').show(); } else { $('#load-buy').removeClass('fixer-sub'); $('#load-buy').css('width','100%'); $('.r-btn-white').hide(); } }); }catch (e){ } //右边菜单悬浮 try{ var f = document.getElementById("r-alert").offsetTop; $(window).scroll(function() { var h_num = $(window).scrollTop(); if (h_num > f) { $('#r-alert').addClass('fixer-right'); $(".show-hide").fadeIn(); } else { $('#r-alert').removeClass('fixer-right'); $(".show-hide").fadeOut(); } }); }catch (e){ } // 返回顶部 $(".yb_top").click(function() { $("html,body").animate({ 'scrollTop': '0px' }, 300) }); $(window).scroll(function() { if ($(window).scrollTop() >= 100) {//向下滚动像素大于这个值时,即出现~ $('.actGotop').fadeIn(300); //淡入的时间,越小出现的越快~ } else { $('.actGotop').fadeOut(300); //淡出的时间,越小消失的越快~ } }); $('.actGotop').click(function() { $('html,body').animate({ scrollTop : '0px' }, 800); }); $('.r-floor>ul>li>a').each(function(k,v){ //k - 选择器的 index 位置 , v - 当前的元素(也可使用 "this" 选择器) $(v).mouseenter(function(){ $(v).children('.top1').show() $(v).children('.top2').show().animate({right:'0px'}); $(v).children('.top1').css('background','#F39800'); }); $(v).mouseleave(function(){ $(v).children('.top1').show().animate({right:'0px'}); $(v).children('.top2').hide().animate({right:'-100px'}); $(v).children('.top1').css('background','#8c8c8c'); }); }); try{ var x = 10; var y = 20; $(".tooltip").mouseover(function(e){ this.myTitle = this.title; this.title = ""; var tooltip = "