Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Need help with onClick and jQuery…

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #38835
    charlie
    Participant

    I’ve set-up a Slide Down window menu (See CodePen) with jQuery and everything is working as it should. BUT, how do I create the jQuery that will close one window when you click on another one automatically?

    Right now you have to click to open then click to close, so there can be more than one window open at a time which isn’t what I was going for. I want open window to close if you click on a new one.

    Thank you,
    CM

    #105730
    Anonymous
    Inactive

    [REDACTED]

    I had written a code pen up, but yours is much neater, @ChrisxClash.

    #105732
    charlie
    Participant

    GREAT JOB! Thank you!

    Looks great at CodePen… But, when I copy/paste new css/jquery in my local doc it works the same way it did before (you have to click to close window it doesn’t close when you click another window).

    I noticed my DOC TYPE is XHTML 1.0 Strict and CodePen uses HTML.

    Also, what does

    > div

    do in

    #contact-tabs-content-wrap > div { display:none;}

    ?

    Does it select all the divs within that div?

    Just trying to figure out why it doesn’t work locally…

    Thank you for your time.
    CM

    Never mind. Figured it out. I just had the original .js link in header.

    #105735
    charlie
    Participant

    I figured out why it wasn’t working locally…

    I still had the old .js link in the head.

    Thank you for the details.

    #105739
    Anonymous
    Inactive

    @ChrisxClash — I don’t mind you perusing in the slightest. It uses the same technique as you do. Yours is cleaner though, and using the css to hide the display initially is more intelligent.

    http://codepen.io/pen/10010/4

    #110039
    charlie
    Participant

    New issue.
    I forgot about this thread and started a new one by accident (sorry).

    Change “Click” to “Hover?”

    http://codepen.io/anon/pen/azAcr

    But…
    “Once the window is open there are additional links/forms in the window for users to use… Seems like the window will need to stay open so user can interact with content of windows.

    Humm…

    Is there such a thing as open on hover and stay open until click to close?

    Thanks!”

    https://css-tricks.com/forums/discussion/19491/change-click-to-hover#Item_6

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.