$('.nav .container ul li').hover(function(){ if ($(this).find('ul').css('display')=='none') { $(this).find('ul').show(); }else{ $(this).find('ul').hide() } }) var j =0 var num =1; for (var i = $('.nav >.container > ul > li').length; i>=0; i--) { j +=num; $('.nav >.container > ul > li>a').eq(j).css('z-index',i); }; $('.nav >.container > ul > li').eq(0).on("mouseover",function(){ $(this).find("a").find('img').attr('src','/templates/cn/images/1.png'); }).on("mouseout",function(){ $(this).find("a").find('img').attr('src','/templates/cn/images/font_03.png') }); $('.nav >.container > ul > li').eq(1).on("mouseover",function(){ $(this).find("a").find('img').attr('src','/templates/cn/images/4.png'); }).on("mouseout",function(){ $(this).find("a").find('img').attr('src','/templates/cn/images/font_09.png'); }); $('.nav >.container > ul > li').eq(2).on("mouseover",function(){ $(this).find("a").find('img').attr('src','/templates/cn/images/3.png'); }).on("mouseout",function(){ $(this).find("a").find('img').attr('src','/templates/cn/images/font_07.png'); }); $('.nav >.container > ul > li').eq(3).on("mouseover",function(){ $(this).find("a").find('img').attr('src','/templates/cn/images/5.png'); }).on("mouseout",function(){ $(this).find("a").find('img').attr('src','/templates/cn/images/font_11.png'); }); $('.nav >.container > ul > li').eq(4).on("mouseover",function(){ $(this).find("a").find('img').attr('src','/templates/cn/images/6.png'); }).on("mouseout",function(){ $(this).find("a").find('img').attr('src','/templates/cn/images/font_13.png'); }); $('.nav >.container > ul > li').eq(5).on("mouseover",function(){ $(this).find("a").find('img').attr('src','/templates/cn/images/7.png'); }).on("mouseout",function(){ $(this).find("a").find('img').attr('src','/templates/cn/images/font_15.png'); }); $('.nav >.container > ul > li').eq(6).on("mouseover",function(){ $(this).find("a").find('img').attr('src','/templates/cn/images/8.png'); }).on("mouseout",function(){ $(this).find("a").find('img').attr('src','/templates/cn/images/font_16.png'); }); $('.nav >.container > ul > li').eq(7).on("mouseover",function(){ $(this).find("a").find('img').attr('src','/templates/cn/images/9.png'); }).on("mouseout",function(){ $(this).find("a").find('img').attr('src','/templates/cn/images/font_17.png'); }); $('.nav >.container > ul > li').eq(8).on("mouseover",function(){ $(this).find("a").find('img').attr('src','/templates/cn/images/2.png'); }).on("mouseout",function(){ $(this).find("a").find('img').attr('src','/templates/cn/images/font_05.png'); }); $(function(){ var aheight =document.documentelement.clientheight; var top = (aheight - $('.modal_box').height())/2; $('.modal_box').css({'top':top}); $('.box_close').hover(function(){ if ($(this).find('img').attr('src') == "/templates/cn/images/btnss_03.png") { $(this).find('img').attr('src','/templates/cn/images/mmmm.png'); }else{ $(this).find('img').attr('src','/templates/cn/images/btnss_03.png'); } }) $(function(){ $('.aside_img ul li').hover(function(){ if ($(this).find('.img1').attr('src') == '/templates/cn/images/aside_06.jpg') { $(this).find('.img1').attr('src','/templates/cn/images/aside_04.jpg'); $(this).find('.pos1').show(); }else{ $(this).find('.img1').attr('src','/templates/cn/images/aside_06.jpg'); $(this).find('.pos1').hide(); }; if ($(this).find('.img2').attr('src') == '/templates/cn/images/aside_09.jpg') { $(this).find('.img2').attr('src','/templates/cn/images/aside_08.jpg'); $(this).find('.pos2').show(); }else{ $(this).find('.img2').attr('src','/templates/cn/images/aside_09.jpg'); $(this).find('.pos2').hide(); }; if ($(this).find('.img3').attr('src') == '/templates/cn/images/aside_11.jpg') { $(this).find('.img3').attr('src','/templates/cn/images/aside_10.jpg'); }else{ $(this).find('.img3').attr('src','/templates/cn/images/aside_11.jpg') }; if ($(this).find('.img4').attr('src') == '/templates/cn/images/aside_14.jpg') { $(this).find('.img4').attr('src','/templates/cn/images/aside_13.jpg'); }else{ $(this).find('.img4').attr('src','/templates/cn/images/aside_14.jpg') } }); $('.cover').click(function(){ $('.modal_box form')[0].reset(); hidemask(); $(".modal_box").fadeout(); }) $('.img3').click(function(){ $('.modal_box form')[0].reset(); showmask(); $(".modal_box").fadein(); }); $('.box_close').click(function(){ hidemask(); $(".modal_box").fadeout(); }) $(window).scroll(function() { if ($(this).scrolltop() != 0) { $('.img4').fadein(); } else { $('.img4').fadein(); } }); $('.img4').click(function() { $('body,html').animate({ scrolltop: 0 }, 500); }) }) });