/*animate*/ function AddAnimate(obj,className,b){ if (window.applicationCache) { obj.addClass(className); if (b) { obj.show(); setTimeout(function(){ obj.removeClass(className); },500) }else{ setTimeout(function(){ obj.removeClass(className).hide(); },30) } } else { if (b) { obj.show(); }else{ obj.hide(); } } } /*tab fn*/ function tab(tabs,cont,i){ tabs.removeClass("active") cont.removeClass("show") tabs.eq(i).addClass("active") cont.eq(i).addClass("show") } function noticeFn(){ var notestimer = null; var news_li=0; notestimer = setInterval(function(){ $('.news_li').animate({"top":-(news_li*19)+"px"}) news_li++; if (news_li == $('.news_li li').length-1) { news_li =0; } },3000); $('.news_li').hover(function(){ clearInterval(notestimer); },function(){ notestimer = setInterval(function(){ $('.news_li').animate({"top":-(news_li*19)+"px"}) news_li++; if (news_li==$('.news_li li').length) { news_li =0; } },2000); }) } $(function(){ noticeFn();//通知; /*top_code*/ $(".phone_er").hover(function(){ $(this).addClass("hover") },function(){ $(this).removeClass("hover") }) /*login_code*/ var codeTimer = null; $(".code_btn").click(function(){ if ($(this).hasClass("hover")) { $(".code_btn").removeClass("hover") $(".code_btn img").animate({"top":"0","left":"0"},200) $(".code_box").removeClass("hover") }else{ $(this).addClass("hover") $(".code_btn img").animate({"top":"-42px","left":"-46px"},200) $(".code_box").addClass("hover") } }) /*index_selling*/ $(".selling .tab li").click(function(){ var _index = $(this).index(); tab($(".selling .tab li"),$(".selling .cont_box .cont"),_index) }) /*index_tool*/ $(".tool li,.mall_nav li").hover(function(){ $(this).addClass("hover") },function(){ $(this).removeClass("hover") }) /*index_news_box*/ $(".huodong h3 span").click(function(){ var _index = $(this).index(); tab($(".huodong h3 span"),$(".huodong .cont ul"),_index) }) /*mall_nav top*/ for (var i=0;i<$(".mall_nav li").length;i++ ) { var liB = $(".mall_nav li").eq(i).find(".mall_links") var nLi_top = $(".mall_nav li").eq(i).offset().top-$(".mall_banner").offset().top; var nLi_hb = $(".mall_banner").innerHeight()-($(".mall_nav li").eq(i).offset().top-$(".mall_banner").offset().top) var ml_H = liB.innerHeight(); if (ml_H>nLi_hb) { liB.css("top",nLi_hb - ml_H -2 + "px") } } /*mall_recommend*/ $(".mall_rec_tab li").hover(function(){ var _index = $(this).index(); tab($(".mall_rec_tab li"),$(".mall_rec_cont .recommend"),_index) }) /*detial_side nav*/ $(".details_nav li b").click(function(){ $(this).next().slideToggle().parent().toggleClass("active") }) $(".invest_group table tr:even").addClass("cf") $(".invest_group table tbody tr:even").addClass("cg") $(".invest_group .right tr:even").addClass("cf") $(".invest_group .right tr:odd").addClass("cg") /*services nav*/ $(".services li ").hover(function(){ var _index = $(this).index(); tab($(".services ul li"),$(".services .coments .cont"),_index) }) /**/ $(".details_zoushi_tab li ").click(function(){ var _index = $(this).index(); tab($(".details_zoushi_tab li"),$(".details_zoushi_map .cont"),_index) }) $(".details_tab ul li ").click(function(){ var _index = $(this).index(); tab($(".details_tab ul li"),$(".details .details_cont"),_index) }) }) //banner $(function() { var sWidth = $("#focus").width(); //获取焦点图的宽度(显示面积) var len = $("#focus ul li").length; //获取焦点图个数 var index = 0; var picTimer; $("#focus ul li").css({"width":sWidth}) var btn = "