Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 557
steo Avatar asked Sep 07 '25 12:09

steo


1 Answers

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.

like image 185
Travesty3 Avatar answered Sep 10 '25 13:09

Travesty3