PDA

View Full Version : Make script work on click



alesandia
08-15-2006, 03:47 PM
1) Script Title: ProHTML ticker

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex2/prohtmlticker.htm

3) Describe problem: Hi, I was wondering if there's a way to make the script work when you click on a link, instead of when teh window loads. Thank you

Twey
08-15-2006, 04:30 PM
Remove:
if (window.addEventListener)
window.addEventListener("load", startscroller, false)
else if (window.attachEvent)
window.attachEvent("onload", startscroller)Then use for your link:
<a href="#" onclick="startscroller(); return false;">Text</a>

alesandia
08-15-2006, 04:48 PM
Thank you!