dendenners
Programmer
Hi,
I'm using script.aculo.us for some effects on a site I'm building. One of the effects I'm using is Effect.highlight().
The actual code for this would be (for example)
When this div is clicked, the color of the span is temporarily changed to white (#ffffff) to indicate to the user that the button that the div represents has indeed been clicked.
Now, my problem is that the startcolor in this instance is hardcoded in each span. I'd like if possible to get this value from a stylesheet. It doesn't seem possible in css to define custom css attributes.
I tried using the javascript getStyle() function, but I can't define a 'startcolor' css attribute, as it is not valid.
Is there some elegant way to pick up css values in javascript?
Thanks
Denis
I'm using script.aculo.us for some effects on a site I'm building. One of the effects I'm using is Effect.highlight().
The actual code for this would be (for example)
Code:
<span id="back" class="wide-button" onclick="new Effect.Highlight(this, { startcolor: '#ffffff' })">
When this div is clicked, the color of the span is temporarily changed to white (#ffffff) to indicate to the user that the button that the div represents has indeed been clicked.
Now, my problem is that the startcolor in this instance is hardcoded in each span. I'd like if possible to get this value from a stylesheet. It doesn't seem possible in css to define custom css attributes.
I tried using the javascript getStyle() function, but I can't define a 'startcolor' css attribute, as it is not valid.
Is there some elegant way to pick up css values in javascript?
Thanks
Denis