Jquery Show/Hide Toggle -


I am trying to recreate the effect shown on the BBC homepage where links 'add more to this page' and 'Set Location' slides open their respective devices and show their relevant content. If you choose 'Add more on this page' then it opens the 'Add more' section. If you select 'Add more on this page' then the 'Add more' section closes, however, if the 'Add more' section is open, and you select 'Set Location' then this 'Set Location' Slides the 'Add more' section before sliding down.

I have managed to regenerate this effect using the following code:

HTML

   

jQuery code

  $ (function () {$ ("# siteCustomization .siteSelection") Hide (); $ ("# Demo Li One "$ {$ Id = $ (this) .attr ('href'); var $ thisDiv = $ (id); if ($ thisDiv. Siblings (': visible') length) {$ thisDiv.siblings ( ': View'.) SlideUp (700, function () {$ thisDiv.slideDown ();});}. Else {$ thisDiv.slideToggle ();} description is false;});}); });  

The problem is, if someone clicks on one, then two links are displayed twice on both Digvijes pages. Only one section should be shown all the time. Any ideas how can I solve this problem?

Thank you for your help.

After

A quick demo for you can actually test that any divs currently with animating Before moving forward the next slideDown: Animated Selector

In addition to this, use the way I use it. This is better than applying the same event handler to several elements.

Unblock the n.b text as it is due to the lack of CSS


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -