在我的网页中,我使用单击事件作为下拉选项卡。但代码对我不起作用。但是如果我使用悬停而不是点击事件,它会很好地工作。但我需要在我的网页代码中使用点击是:
$(document).ready(function(){
var dropDownSpeed = 200;
var dropUpSpeed = 200;
var menuHeight = '240px';
var tabs = $("#tabs");
var tabPanesContainer = $("ul#tabPanes");
var tabPanesAll = tabPanesContainer.find("li").css("position", "absolute");
$(".slide").click(function () {
var thisMenuItem = $(this);
/*get the offset of this item in respect to the page*/
var thisMargin = thisMenuItem.offset().center;
/*get the offset of the navigation bar in respect to the page*/
var tabsOffset = tabs.offset().center;
var thisIndex = thisMenuItem.index();
thisMargin = Math.floor(thisMargin - tabsOffset);
var thisOffset = thisMargin - 52;
/* handle IE margin difference*/
if($.browser.msie)
{
thisOffset = thisMargin - 15;
}
tabPanesContainer.css('margin-left', thisOffset);
tabPanesContainer.stop().animate({
height: menuHeight
}, dropDownSpeed);
tabMenuLinks.removeClass('activeTab');
thisMenuItem.addClass('activeTab');
var thisHash = thisMenuItem.find("a").attr('href');
var tabClicked = tabPanesAll.filter(thisHash);
tabClicked.appendTo(tabPanesContainer).show();
return false;
}, function() {
$(this).stop();
});
});
});
请帮我解决问题 谢谢...