21,887
社区成员
发帖
与我相关
我的任务
分享
function $(obj){ //alert(obj);
return typeof(obj) == "string" ? document.getElementById(obj) : obj;
}
//上面的JS和下面的JS有冲突,主要是$重复使用,改下面的JS应怎样改呢,请都大家了!
var litbNavWith=952;
$('#litb-nav>li').each(function(){litbNavWith-=$(this).width();
var p=$(this),a=p.children('a'),b=a.parent().find('div'),t;
if(b){p.hover(function(){clearTimeout(t);
t=setTimeout(function(){a.addClass('current');
p.addClass('current');
b.show()},150)},function(){clearTimeout(t);
t=setTimeout(function(){a.removeClass('current');
p.removeClass('current');
b.hide()},150)})}});
$('#allCategory').width(litbNavWith);
if($.browser.msie&&$.browser.version<7){$('#allCategory dd,.sub-nav-container').bgiframe()};
$('.alignCenter').each(function(){var w=$(this).width()-$(this).parent().width();
$(this).css('left',-w/2)});
$('#viewAllCateIcon').bind('click',function(){$(this).blur();
$('#allCategory dd').toggle()});
$('#viewAllCateText').bind('mouseover',function(){$('#allCategory dd').fadeIn('fast')});$(document).bind('click', function (e) {try {var obj = e.target;
if (obj.id == 'allCategory')
return;
var closeable = true;
while (obj.tagName != 'BODY') {obj = obj.parentNode;
if (obj.id == 'allCategory') closeable = false;}if (closeable)
$('#allCategory dd').fadeOut('fast');} catch (err) {$('#allCategory dd').fadeOut('fast');}});
$('#curSelector, #langSelector, #UAP-help>dl,#UAP-orders>dl, #UAP-livechat>dl').hover(function(){$(this).addClass('over')},
function(){$(this).removeClass('over')});