Making a glowing effect in javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Chuckhriczko
    New Member
    • May 2008
    • 6

    Making a glowing effect in javascript

    Hey all, forgive the improper formatting as I am posting this from my blackberry at work.

    Anyway, I am developing a website for a client. He recently informed me of features he wants. These can easily be done in flash but I am a big anti flash guy for multiple reasons. Plus I don't know flash. I know I can do certain things in javascript to imitate flash but one thing puzzles me.

    How could I apply a glowing effect to an element, a div for example? Here's the situation. I need to make a button that will fade from non glow to glow onmouseover and reversed for onmouseout. I figure animated gifs can do this but I am interested to know if I can do this without images.

    I am currently using John Resig's great jQuery library so I figure maybe if I create a glow effect, place it over the div containing the link. I make the glow display: none, then I could just fade the glow in and then fade it out. If it comes down to it I might settle and just use flash but I would like to avoid that if possible. Thanks for any help with my incredibly non standard hack attempt :)

    Chuck
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    Originally posted by Chuckhriczko
    How could I apply a glowing effect to an element, a div for example? Here's the situation. I need to make a button that will fade from non glow to glow onmouseover and reversed for onmouseout. I figure animated gifs can do this but I am interested to know if I can do this without images.

    Chuck
    Use settimeout() to continually change the background color of the divs after certain time intervals, until the final color is obtained.

    But for the fading effect, either you need to get a list of intermediate colors hard coded, or make a function which can increment the HSL value of color each time you call that function.

    google for HSL colors, you may find what's it.

    Comment

    • Chuckhriczko
      New Member
      • May 2008
      • 6

      #3
      Ok. I already have jquery which I use for fading so that's no issue. And I have a color tweening library I found somewhere so that works for colors but it doesn't "glow". I think I will just give up though for now and use flash. Its only one menu that will use flash. Thanks anyway though.

      Comment

      • hsriat
        Recognized Expert Top Contributor
        • Jan 2008
        • 1653

        #4
        Originally posted by Chuckhriczko
        Ok. I already have jquery which I use for fading so that's no issue. And I have a color tweening library I found somewhere so that works for colors but it doesn't "glow". I think I will just give up though for now and use flash. Its only one menu that will use flash. Thanks anyway though.
        Glowing is obtained by changing the color slowly to brighter ones of the same tone (same hue value, but higher brightness).

        You are welcome :)

        Comment

        Working...