<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hmm, I didn''t try the limit. I think that is what I was lacking, but I
decided to make the highlight onmouseout and just set the color
onmouseover. (Basically copy past from IPE) It could use some OO love
but I just need something quick and dirty..<br>
<br>
function highlightRelOver(event){<br>
var element =
$(Event.findElement(event,''li''));<br>
var rel =
$(element.getAttribute(''rel''));<br>
if(!rel) return;<br>
if(!rel.originalBackground)<br>
rel.originalBackground
Element.getStyle(rel,''background-color'').parseColor() ||
''#FFFFFF'';<br>
if(rel.effect) rel.effect.cancel();<br>
rel.style.backgroundColor =
''#FFFF99'';<br>
}<br>
function highlightRelOut(event){<br>
var element =
$(Event.findElement(event,''li''));<br>
var rel =
$(element.getAttribute(''rel''));<br>
if(!rel) return;<br>
rel.effect = new Effect.Highlight(rel,{<br>
startcolor:
''#FFFF99'',<br>
endcolor:
rel.originalBackground,<br>
restorecolor: rel.originalBackground<br>
});<br>
}<br>
<br>
Note that getting the background color works in this case because I set
the background color on the table row, but if I use this code on a
child of the table row, the color is inherited but how can I retrieve
this inherited value in JS? Is there a way that is foolproof in any
situation to get the inherited value (i.e. with no knowledge of where
the inherited value is set?). Firebug does this quite well, I guess I
could use the .up method until the style I want is set explicitly..<br>
<br>
Thanks,<br>
Colin<br>
<br>
Tom Gregory wrote:
<blockquote
cite="mid:3D7E922D-2E0D-496E-9DA7-7DC05FE1DCC5-PGZyUNKar/Q@public.gmane.org"
type="cite">You''ll need to use effect queues, probably
with a limit.
Highlight uses the current color as a starting point, so if a highlight
fires part-way through another highlight, then it returns to the wrong
color on finish.
<div><a moz-do-not-send="true"
href="http://wiki.script.aculo.us/scriptaculous/show/EffectQueues">http://wiki.script.aculo.us/scriptaculous/show/EffectQueues</a></div>
<div><br class="khtml-block-placeholder">
</div>
<div>if(rel) new Effect.Highlight(rel,{duration: 1.0, queue: {scope:
''yourQName'', limit: 1}});
<div><br class="khtml-block-placeholder">
</div>
<div>You could also just try specifying the start/end color, but I
think the results come out looking a bit odd.</div>
<div><br class="khtml-block-placeholder">
</div>
<div><br class="khtml-block-placeholder">
</div>
<div>TAG</div>
<div><br>
<div>
<div>On Mar 2, 2007, at 4:50 AM, Colin Mollenhour wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div class="moz-text-flowed"
style="font-family: -moz-fixed; font-size: 13px;"
lang="x-western">I
have a popup with the following contents: <br>
<br>
<div class="popup"> <br>
<h3>Checklists</h3> <br>
<ul> <br>
<li class="pending"
rel="qcc-5"><a
href="qccinfo.php?qcc=5">Final Paint
Inspection</a></li>
<br>
</ul> <br>
<h3>Callback tasks</h3> <br>
<ul> <br>
<li class="unconfirmed"
rel="task-957"><a
href="taskinfo.php?jobtaskid=957">Eric Rangel - Rangel Painting
-
Fri, Mar 02, 2007</a></li> <br>
<li class="inspect"
rel="task-959"><a
href="taskinfo.php?jobtaskid=959">Eric Rangel - Rangel Painting
-
Fri, Mar 02, 2007</a></li> <br>
</ul> <br>
</div> <br>
<br>
There are other elements (table rows) on the page with ids equal to the
rel attributes of those list items. Each list item has an event
listener attached for ''mouseover'' that call this function:
<br>
<br>
function highlightRel(event){ <br>
var element = $(Event.element(event)); <br>
if(element.tagName.toUpperCase() != ''LI'')
element element.up(''li''); <br>
var rel = $(element.getAttribute(''rel''));
<br>
if(rel) new Effect.Highlight(rel,{duration: 1.0});
<br>
} <br>
<br>
<br>
The problem is, the effect is somewhat erratic. When it gets fired
multiple times quickly it sometimes gets stuck half-way out of it''s
fade and subsequent highlights then fade to that color. I don''t want to
use queue:''end'', I want new mouseovers to cancel the old ones
and start
them fresh immediately but then always fade to the original color
(which varies). <br>
<br>
Any ideas? I can post a demo if necessary but I''m sure someone will
know what''s up. <br>
<br>
TIA, <br>
Colin <br>
<br>
</div>
<br>
<br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
<br>
<br>
</blockquote>
<br>
--~--~---------~--~----~------------~-------~--~----~<br>
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group. <br> To post to this
group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <br> To
unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
<br> For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en <br>
-~----------~----~----~----~------~----~------~--~---<br>
</body>
</html>
<br>