element.style.backgroundColor = ''; //should allow class-specific
styles to properly cascade
Put the statement in your afterFinish callback--your options hash
might include the following:
{
afterFinish: function (o) {
o.element.style.backgroundColor = '';
}
}
TAG
On Jul 5, 2007, at 3:41 PM, szimek wrote:
>
> Thanks!
>
> Yeah, I'm using tr:hover, but you're right - it doesn't work in IE6
> (without some additional effort).
> So I'll probably go with js approach, however it adds lots of code to
> generated html page.
>
> Out of curiosity - I guess I have an idea how to use afterFinish
> callback, but how to "remove style settings at the element level to
> allow the CSS class settings to properly cascade."? I mean which
> function to use (and how)? I can see functions to get/set style, but
> how to remove?
>
>
> On 5 Lip, 22:07, Tom Gregory <[EMAIL PROTECTED]> wrote:
>> You'll notice the suggestions here all focus on applying the hover
>> with js rather than CSS. From your initial post, you suggested you
>> are using tr:hover. IIRC, this won't work in IE6, which only
>> respects :hover for <a> elements.
>>
>> Part of what you're seeing is, as you seem to recognize, the
>> Highlight effect setting the bg color at the element, which would
>> override any CSS classes that might otherwise have effect. You may
>> find it helpful to use the 'afterFinish' callback to remove style
>> settings at the element level to allow the CSS class settings to
>> properly cascade.http://wiki.script.aculo.us/scriptaculous/show/
>> CoreEffects
>>
>> TAG
>>
>> On Jul 5, 2007, at 11:58 AM, szimek wrote:
>>
>>
>>
>>> Hi,
>>
>>> i've got a problem with highlighting table rows that change their
>>> color when user hovers mouse over them - when user clicks some
>>> buttons
>>> in the row, it is highlighted and then it goes back to the color
>>> specified in tr:hover, not to it's original color. The additional
>>> problem with it is that rows are colored alternatively - I've got 2
>>> separate classes for even/odd rows.
>>
>>> While I understand why it happens, is there some easy way to
>>> avoid/fix
>>> it?
>>
>>> Is there a way to get specific css property (in this case background
>>> color) from specified css class? Then I could check if the
>>> highlighted
>>> row is even or odd, get the background color value for respective
>>> css
>>> class and set it as a final color value for the highlight effect. I
>>> could hardcode color values into javascript, but if I change css
>>> style, I'd have to modify my javascript code as well.
>>
>>> Or maybe it's possible to find an element that has the same class as
>>> the highlighted element, but does not have hover effect turned on
>>> currenty? Is it possible?
>>
>>> Thank you in advance
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---