Forums

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

Home Forums JavaScript Can we streamline this?

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #166480
    kevsyers
    Participant

    Can one of you take a look at this code and tell me if there’s a more streamlined way to code this effect I’m trying to accomplish? Everything is working correctly it just seems like that’s a lot of code for something so simple.

    Here’s the link to said code.

    #166483
    nkrisc
    Participant

    You can probably use jQuery’s .hover instead to define both the hover-on and hover-off event functions.

    http://api.jquery.com/hover/

    #166486
    kevsyers
    Participant

    I tried that originally with no success but I’ll give it another go. It was probably something I screwed up. Thanks

    #166487
    kevsyers
    Participant

    This is a little different way of coding the same effect. I’m not sure if it’s more streamlined or not.

    New Code

    I guess by my definition of ‘streamlined’ I mean: Is there a way to make this box go back to it’s original size when the mouse leaves that doesn’t require me to set the width?

    Like a .returnOriginal(); would be magical right now.

    #166666
    kevsyers
    Participant

    Yeah, I am working on a pure CSS solution today. I wanted to try jQuery incase we have to support older browsers.

    Thanks for the input, though.

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