
March 16th, 2004
06:08 PM
Neverside Newbie
Status: Offline!
javascript gradients in a div
This is a question aimed at those guys who are good with the javascript.
Yeah, basically I want to use a vertical #eee to a slightly dark red fade behind a few divs on a site I'm building.
I don't want to use a tall 1 pixel repeated image, because the length of the divs may change based on how much text is in the said div. I also want to be able to use this gradient for the background. Or would it be possible to do a red at around 20% from the top, #eee in the middle, and then red again at the bottom 20%? That's really what I'm looking for.
If this is possible, which I think it is, please let me know.
This may be taking it a bit too far, but have have seen something close . Is there a script that could basically put the opposite gradient on the text in the said div? Thus making the text easier to read because of the contrast in color.
Thanks!

March 17th, 2004
04:01 AM
I need a haircut
Status: Offline!
I have a CSS solution.
check out www.alistapart.com
they have a gradient in the background (as an image) stuck to the bottom of the page, and the top color set as the background-color of the page. this way it fades in and looks ok on any resolution or size.
___________________
Jon Culver Chia Pets

March 17th, 2004
04:55 AM
www.tizag.com - does a simple horizontal repeat of a tiny gradient image.
If the color is not going to be dynamic then I suggest just making a gradient in photoshop and using CSS Backgrounds to repeat it.
___________________
"Don't live your life by other people's quotes. Figure out life for yourself." ~Sum Wize Guy
CSS Tutorials
HTML Tutorials
Web Host Guide - Stuff you should know before choosing a web host.

March 17th, 2004
06:10 AM
or use an IE opacity filter
___________________
