jQuery - trapping tab select event

前端 未结 7 1946
予麋鹿
予麋鹿 2020-12-03 04:50

I\'m a jQuery noob and I\'m trying to figure out how to trap the tab selected event. Using jQuery 1.2.3 and corresponding jQuery UI tabs (not my choice and I have no control

相关标签:
7条回答
  • 2020-12-03 05:19

    From what I can tell, per the documentation here: http://jqueryui.com/demos/tabs/#event-select, it seems as though you're not quite initializing it right. The demos state that you need a main wrapped <div> element, with a <ul> or possibly <ol> element representing the tabs, and then an element for each tab page (presumable a <div> or <p>, possibly a <section> if we're using HTML5). Then you call $().tabs() on the main <div>, not the <ul> element.

    After that, you can bind to the tabsselect event no problem. Check out this fiddle for basic, basic example:

    http://jsfiddle.net/KE96S/

    0 讨论(0)
提交回复
热议问题