Jquery Tabs help with onShow function

牧云@^-^@ 提交于 2019-12-11 06:14:35

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!