I think the problem here is animations are asynchronous. This means that the next line of javascript will potentially execute before your animation is fully done.
So I'm guessing that there's something in the more complex animations that's mucking with the works. Have you tried to invoke the block responsible for the .show() in a function callback in the .hide() call? This will eliminate any asynchronous gotchas since the callback is guaranteed to execute when the animation is truly done. **--** Steve On Sep 11, 7:30 pm, TehNrd <[email protected]> wrote: > Go easy on me as I am brand new to jquery but I can not get what > appears to be some very simple code to work properly. I am trying to > loop through a set of div panels showing and hiding them one at a > time. If I use the standard show and hide effects this works great but > if I trying to use any of the UI effects this does not work. Any > ideas? > > <style> > .panel{ > width: 600px; > height: 400px; > } > </style> > > <script> > $(document).ready(function(){ > $(".panel:not(:first)").hide(); > $(".panel").click(function(){ > //If you comment out this line below > $(this).hide("slide", { direction: "left" }, > 500); > > //...and uncomment this line below, it works > fine. > //$(this).hide("slow"); > > if($(this).next().hasClass("panel")){ > $(this).next().show("slow"); > }else{ > $(".panel:first").show("slow"); > } > }); > }); > </script> > > <div class="panel" style="background-color: silver">1</div> > <div class="panel" style="background-color: green">2</div> > <div class="panel" style="background-color: red">3</div> > <div class="panel" style="background-color: blue">4</div> > > Probably a noob mistake but thanks for the help, > Jason --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~---
