jQuery - trapping tab select event

前端 未结 7 1974
予麋鹿
予麋鹿 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

    element, with a
      or possibly
        element representing the tabs, and then an element for each tab page (presumable a
        or

        , possibly a

        if we're using HTML5). Then you call $().tabs() on the main
        , not the
          element.

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

          http://jsfiddle.net/KE96S/

    提交回复
    热议问题