setTimeout event problem??

B

BKDotCom

Could someone point me in the right direction in this little learning
exercise?
The "animation" starts in ie, but never stops? Works fine in mozilla.
I'm baffled.

<SCRIPT type="text/javascript">
function pulse(e, go)
{
d = parseInt(e.style.paddingTop);
if ( typeof go != 'undefined' )
{
// start/stop called from onmouse
e.setAttribute('pulse',go);
if ( go == 1 )
{
d = -1;
e.style.borderTop='1px solid #000';
e.style.borderBottom='1px solid #000';
e.style.textDecoration='none';
e.style.overflow='hidden';
}
else {
e.style.border='0px solid #000';
e.style.padding='0px';
e.style.textDecoration='underline';
}
}
if ( e.getAttribute('pulse') == 1 )
{
if ( d > 4 )
d = -1;
e.style.paddingTop=[d+1]+'px';
e.style.paddingBottom=[d+1]+'px';
etemp = e;
setTimeout('pulse(etemp)',80);
}
}
</SCRIPT>

<A onMouseOver="pulse(this,1);" onMouseOut="pulse(this,0)"
HREF="#">groovy</A>
 
B

BKDotCom

well, I figured it out.
it doesn't like 'attribute' in e.getAttribute('attribute') and
e.setAttribute('attribute',value) being the same as the function name.
Why, I have no idea.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top