简体   繁体   中英

Show callback is not firing jquery ui tabs

I was following these example : http://jsfiddle.net/Shef/k6TEZ/ , in which is used the callback show() . I am executing this callback too , but it seems to not work. here it is my html and jquery

HTML

<div id="tabs">
    <ul>
        <li><a href="#tabs-1">Nunc tincidunt</a></li>
        <li><a href="#tabs-2">Proin dolor</a></li>
        <li><a href="#tabs-3">Aenean lacinia</a></li>
      </ul>
      <div id="tabs-1">
        <p>Proin elit arcu,mpus lectus.</p>
      </div>
      <div id="tabs-2">
        <p>Morbi tincidunt, d</p>
      </div>
      <div id="tabs-3">
        <p>Mauris eleife.</p>

      </div>
    </div>

jquery

 $("#tabs").tabs({
    show: function(event,ui){
        console.log("shown"+ui.index);
    }   
 });

$( "#tabs" ).find( ".ui-tabs-nav" ).sortable({
    axis: "x"
});

//tabsactivate
//tabsshow
 $('#tabs').on('tabsactivate', function(event, ui) {
    $(ui.newTab).data('index',ui.newTab.index());     
    console.log($(ui.newTab).data('index'),ui.newTab.index());
});

Can someone help me to undestand why show() is not firing?

with jquery ui 1.10 it is not working. With 1.9.2 it works.

According to the jQuery UI 1.9 changelog :

Deprecated: show event; renamed to activate.

And according to the jQuery UI 1.10 changelog :

Removed: show event.

Looks like you should use either activate or beforeActivate .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM