在我的網頁我用Click事件tab.But代碼不爲我工作下拉。 但是,如果使用click事件的懸停,而不是它的工作原理well.But我需要使用點擊我的網頁代碼:Jquery的單擊事件不工作
$(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();
});
});
});
請幫我解決這個問題謝謝...
我刪除了另一個功能,但它不工作 – ajay
您可以創建一個工作小提琴示出此問題 –
我需要的是,如果用戶點擊「