问题
Hey all i am trying to figiure out why my code is not triggering the "onShow" function for the tabs. Here is my code:
$(document).ready(function() {
$('#tabMain > ul').tabs({ fx: {height: 'toggle'},onShow: function() {alert('onShow');} });
})
I never see the alert box pop up saying "onShow" so i do not know what i am doing wrong?
Any help would be awesome! :)
David
SOLVED
$(document).ready(function() {
$('#tabMain > ul').tabs({ fx: {height: 'toggle'},onShow: function() {alert('onShow');} });
$( "#tabMain > ul" ).bind( "tabsshow", function(event, ui) {alert('sdfsdf');});
})
回答1:
The newest version of the jQuery Tabs calls the event just show. so try the following:
$(document).ready(function() {
$('#tabMain > ul').tabs({ fx: {height: 'toggle'},show: function() {alert('Showed');});
})
来源:https://stackoverflow.com/questions/2577261/jquery-tabs-help-with-onshow-function