By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,680 Members | 1,486 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,680 IT Pros & Developers. It's quick & easy.

Making a glowing effect in javascript

P: 6
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
May 4 '08 #1
Share this Question
Share on Google+
3 Replies


hsriat
Expert 100+
P: 1,654
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.
May 4 '08 #2

P: 6
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.
May 4 '08 #3

hsriat
Expert 100+
P: 1,654
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 :)
May 5 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.