jQuery(function () { //经过填加相应的CLASS jQuery(".unit").find("li").mouseover(function () { jQuery(this).addClass("hover").siblings().removeClass("hover"); }); }); //图片+文字轮播 function Switch(switchImg, switchText) { var times = 3000; //轮播间隔时间 var size = jQuery(switchImg).children().size(); jQuery(switchImg).children().eq(0).show(); jQuery(switchText).children().eq(0).addClass('focus') jQuery(switchText).children().mouseover(function () { jQuery(this).addClass('focus').siblings().removeClass('focus'); var index = $(this).index(); i = index; jQuery(switchImg).children().eq(index).stop(true).fadeIn(300).siblings().stop(true).hide(); }); var i = 0; var time = setInterval(move, times); function move() { i++; if (i == size) { i = 0; } jQuery(switchText).children().eq(i).addClass('focus').siblings().removeClass('focus'); jQuery(switchImg).children().eq(i).fadeIn(300).siblings().hide(); } jQuery(switchImg).parent().hover(function () { clearInterval(time); }, function () { time = setInterval(move, times); }); } //模似select function toSelect(selectTop, selectBot) { jQuery(selectTop).click(function (event) { event.stopPropagation(); if (jQuery(selectBot).hide()) { jQuery(selectBot).show(); } }); jQuery(selectBot).children().click(function (event) { event.stopPropagation(); jQuery(selectTop).val($(this).html()); jQuery(selectBot).hide(); }); jQuery(document).click(function (event) { jQuery(selectBot).hide(); }); } //选项卡 function tab(topObject, botObject) { var $div_a = $(topObject).find("a"); jQuery(botObject).eq(0).show(); jQuerydiv_a.mouseover(function () { jQuery(this).addClass("focus").siblings().removeClass("focus"); var index = $div_a.index(this); jQuery(botObject).eq(index).show().siblings(botObject).hide(); }); } //行业评选轮播 function carousel(obj) { var This = $(obj); var sWidth = $(This).width(), len = $(This).find('ul li').length, index = 0, Timer; var liWidth = 100 / len; jQuery(This).find('li').width(liWidth + "%"); // btn event 数字和切换 var btn = "