views:

95

answers:

1

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  A: 

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');});
})
Jeff Beck
Thanks for the reply, jeff but it does not seem to work either.. $('#tabMain > ul').tabs({ fx: {height: 'toggle'},show: function() {alert('onShow');} });Would my other "click" code be where it needs to be?$("#tab1").click(function(){});?David
StealthRT
Try taking out your other click code just in case.
Jeff Beck
Nope, jeff, still doesn't display the alert. :o(
StealthRT
Can you send me a link to check out?
Jeff Beck
My next thought it to try without the fx... I'm making a simple page just as a sanity check
Jeff Beck
I've tried it without the FX and still no alert box :o/ crazy.. $('#tabMain > ul').tabs({ show: function() {alert('onShow');} });David
StealthRT
There seems to be something on the page interacting with the tabs... I'm not seeing anything jumping out at me sorry.
Jeff Beck
Thanks for trying, Jeff :o) I got it working using the Bind function.
StealthRT
I pulled down the latest UI and jquery and by itself it seemed to work but not with everything else on the page.<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"></script>
Jeff Beck