收录日期:2020/05/27 16:26:36 时间:2009-08-07 16:09:49 标签:jquery,jquery-ui

I'm using jQuery UI tabs for simple tab navigation on a page, and this works great; however, I want to call a function like

function DoStuff(){  
   $("#divID").hide();
}

from within a tab. When I click on the <a href...> which calls the DoStuff() function, I see the div being hidden, but then the current tab which I am in is closed and the first tab is opened. Why is this happening and how would I fix this? Do I need to figure out which tab I am in and then select that tab after I hide the <div>?

are you remembering to return false in your DoStuff() callback for the tag click? You might be reloading the page, or at least changing the hash in the url, which can have an effect on which tab you have open.