Forums

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

Home Forums JavaScript jQuery events with setTimeout problem

  • This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #199001
    rolandas
    Participant

    Hey,

    I’m having trouble with jQuery events. What I’m trying to do is when I hover over p element- function fireHover should run, but function fireOver should start running even if first function hasn’t finished.

    Any help is much appreciated!

    Demo: http://codepen.io/rolandas/pen/ogpPYR

    #199039
    Shikkediel
    Participant

    Doesn’t fully work yet (it’s almost the same as before just written differently) but it should be a step closer to what you’re trying to achieve. The timeout wasn’t actually being cleared :

    Link to the pen

    Still needs some work with the classes to get it firing correctly, getting a bit bedazzled (lol) with all the hidden properties myself.

    #199314
    rolandas
    Participant

    Thanks, Shikkediel :)

    I see you have it rewritten, but I still don’t know how to make this thing work..

    Do you think there may be a problem with HTML?

    Thanks :)

    #199316
    Shikkediel
    Participant

    No problem with the markup, just had to get my head around it. That said, I think this ought to work :

    Revised version

    #199344
    rolandas
    Participant

    Ya, you nailed it- thanks a lot! :)

    #199673
    rolandas
    Participant

    Thanks, #Shikkediel again for your answer.

    I got another though. How would you make jQuery work on multiple .wrap divs? Say if you had 5 or 10 orange divs.

    Thanks in advance :)

    #199690
    Shikkediel
    Participant

    Interesting puzzle (gotta be a bit geeky to have fun with this) :

    But I think the pieces fit…

    What’s next, 3D? :-D

    #199691
    rolandas
    Participant

    :D So far, so good :p That was pretty quick :)
    Do you really know how to make text in 3D? No, just kiddin’ :D
    Thanks again :)

    #199694
    Shikkediel
    Participant

    No problem. Good practice, would have probably taken me a day to figure out half a year ago. It’s not flawless though – one minor quirk I see is that it closes too fast when you hover back and forth quickly.

    #199696
    rolandas
    Participant

    I think closing speed should be fine- I’ll have to reduce it to around 500ms anyway.

    You’re a master! :)

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