Facing error using MochiKit.Color

0 views
Skip to first unread message

Pearl

unread,
May 12, 2008, 7:53:13 AM5/12/08
to MochiKit
Hi,

I want some text to appear onload of a page. This text should be
highlighted ("yellow fading technique"). For this, I am using
combination of Highlight and fade methods gievn in Mochikit.
The method is described as

function display_message(msg)
{
var test = Highlight(msg);
var test = fade(msg,{ duration:5.0, from:1, to:0.0 });

}

and on the kid page it is described as "
<script>
window.onload = function() {
msg = getElement('message_element');
display_message(msg);
}
</script>

<body>
<div id="result-area" class="msgparea" >
<span py:if="msg" id="message_element" class="flashmsg"><b>$
{msg}</b></span>

</body>

It is giving an error in the firefox error console which keep on
incrementing. The error message is :
this._base has no properties.
[Break on this error] m
+=MochiKit.Color.toColorPart(Math.round(this._base[i]
+this._delta[i]*_663));

I am using mochikit 1.4.

Please help

Thanks and Regards
Roopesh

Per Cederberg

unread,
May 13, 2008, 5:03:17 AM5/13/08
to MochiKit
I suspect that the error stems from the fact that you are using two
animations/effects from MochiKit.Visual in paralell. If you try using
just one of them I suspect that everything should work, right?

I don't have the time to debug or try to reproduce this right now, but
perhaps you could dig into this a bit deeper yourself? Use the
uncompressed version of MochiKit and Firebug. JavaScript breakpoints
is an extremely powerful debugging tool.

Cheers,

/Per

Reply all
Reply to author
Forward
0 new messages