SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: jquery question

  1. #1
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question jquery question

    Hi all,

    I suspect this is a fairly simple request but am struggling to know how to do it as my jquery knowledge is pretty damn basic.

    This is the page I need the jquery functionality in:
    http://deadcertdesign.com/dev/hold/lounge_productions/

    each div toggles open another div once clicked, it then opens to reveal a profile.What I need to do is have all open divs close once the next one opens.
    at the moment you have to manually click a close button in each profile.

    Any help v much appreciated - and laymans terms are good!

    Thanks in advance

  2. #2
    SitePoint Wizard
    Join Date
    Dec 2003
    Location
    USA
    Posts
    2,582
    Mentioned
    29 Post(s)
    Tagged
    0 Thread(s)
    All you have to do is take whatever a common trait between all of them are (it looks like .slider), and hide that, like so:
    Code:
    $('.slider').hide();
    Or, if you want to slide it close, use slideUp() or something (same function you use on the close button).

    Do this before you show and you can close them all first. If the one you want to open is acting function, you might want to add something like:
    Code:
    $('.slider').not(this).hide()
    To take "this" (the one you clicked) from the list. (If 'this' isn't the slider, you may have to do something like ".not($(this).children('.slider')" or whatever is appropriate to target it).

  3. #3
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi samanime,

    thanks for your response, very clearly explained and worked a treat - much appreciated



Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •