Define variable in variable/parameter and use in javascript?
Posted
by Ross
on Stack Overflow
See other posts from Stack Overflow
or by Ross
Published on 2010-03-22T11:34:34Z
Indexed on
2010/03/22
12:41 UTC
Read the original article
Hit count: 314
I want to defined a variable/parameter in CSS and access it by javascript. What is the best way of doing this?
One option I thought of would be to place a cutsom attribute on the body
element, then access that attribute via jQuery.
A little more info: I'm defining colour sets in CSS. I've created a function with RaphaelJS to draw a gradient background on the page. I want this function to use a highlight colour (which is not used elsewhere on the DOM) which will be defined in the CSS along with the other colour elements.
Thanks
© Stack Overflow or respective owner