Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Dec 2004
    Location
    Central Florida
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    onclick show, hide all other divs in container + set cookie

    Wow.. google gave me the correct forum to go to ..
    Basically I'm having problems with something I don't know how to do.. I'm not a javascript guy at all, I understand PHP and can write some of it myself.. but writing complex scripts isn't really my thing. but this shouldn't be too hard..
    - I'm going to show an example of what I'm trying to do..
    I'm using divs.. basically 1 container div for 3 divs that have display: none;

    the top of the divs will be ______ and the bottom will be -------
    ______________________________
    [img link 1] [img link 2] [img link 3]
    <!-- the 3 divs start here -->
    ______________________________
    1) stuff is in here...
    -----------------------------------
    _______________________________
    2) here too
    ------------------------------------
    _______________________________
    3) hey, how about here too
    ------------------------------------
    <!-- closing container div -->
    -------------------------------------
    I've found tons of ways to 'show or hide' using javascript and display: none;
    but no way to do this..
    when [img link 1] is clicked, the rest hide but DIV 1 shows.. when [img link 2] is clicked, the rest hide but DIV 2 shows.. etc..
    that's one tricky part I'm hoping someone knows..
    the other tricky part is that everytime someone clicks the link, it needs to set a cookie so that when they go to other pages, that same div is showing.. (so it doesnt hide) .. unless that can be done without cookies.. doesn't matter to me..
    this has to be done without the page reloading (which is why I don't use PHP, the way I know how to..) but the cookie can be set with PHP if needed (that's the only way I know)... if someone can help me, that'd be awesome.
    -thanks for any help
    -- I know of 1 site that has this, except without the cookie.. if that helps.. (and yes, I've looked at the source.. still don't know how to edit their javascript)
    site is http://www.team3d.net/ and it's the pictures of faces (profiles I guess).. on the right side.
    Look directly above the faces, CS or COD click them, and also that little button to the right of COD... that's exactly what I'm trying to do (except set a cookie so when the user goes to a new page, it's displaying the same one)
    Last edited by MinDFreeZ; 12-05-2004 at 10:29 AM.


 

Posting Permissions

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