PDA

View Full Version : Featured Content Slider - Suggested Improvement



billyblue
04-23-2008, 08:29 PM
Featured Content Slider (http://www.dynamicdrive.com/dynamicindex17/featuredcontentslider.htm)
http://www.dynamicdrive.com/dynamicindex17/featuredcontentslider.htm

When set to automated, the slider automatically rotates the contents until the user explicitly clicks on one of the pagination links. With a simple modification of the contentslider.js (http://www.dynamicdrive.com/dynamicindex17/contentslider.js) file, the script will also stop whenever the user clicks inside the content itself.

Find

paginatediv.onclick=function(){ //cancel auto run sequence (if defined) when user clicks on pagination DIV
if (typeof window[sliderid+"timer"]!="undefined")
clearTimeout(window[sliderid+"timer"])
}
Add after

slider.onclick=function(){ //cancel auto run sequence (if defined) when user clicks on slider DIV
if (typeof window[sliderid+"timer"]!="undefined")
clearTimeout(window[sliderid+"timer"])
}

Or feel free to take it a step further and place the whole thing in it's own function and then just call it under both circumstances...