Scroll To Top

Enter a query to search our site. Note that you can use "*" and "?" as wildcards. Enclosing more than one word in double quotes ("CSS Layout") will search for the exact phrase.

PVII Knowledge Base

1. Select a product ...
2. Select category ...
3. Search the Knowledge Base...

Question #107

I have a looping GeeWizz scroller, is it possible to limit the number of times it loops? I only want it to loop 2 times and then stop.

The Answer

Prepared Jul. 2003 by Gerry Jacobsen, PVII

Yes, it's possible to control the number of loops in GeeWizz, with a couple of code tweaks.

We'll need to add a counter to the looping code. Open your page in code view and follow these simple editing steps:

1. Add this line directly above the P7_moveScroll function:

var theCount=0;

so it looks like this:

var theCount=0;
function P7_moveScroll(co,md,op,dy,cy) { //v2.9 by PVII

2. Locate the last lines of the P7_moveScroll fucntion:

}else{if(op>0 && g.toMove){
g.p7sCycle=0;dd.top=g.p7sStartTop+pa;dd.left=g.p7sStartLeft+pa;eval(ti);}}}
}

-change it to read like this:

}else{if(op>0 && g.toMove){>
//add loop counter
theCount++;
g.p7sCycle=0;dd.top=g.p7sStartTop+pa;dd.left=g.p7sStartLeft+pa;
if(theCount<2){eval(ti);}else{theCount=0;
dd.top=0+pa;dd.left=0+pa;}}}}
}

3. That's it! The number of loops is controlled by this line:

if(theCount<2){

the 2 will stop the loop after two loops, change it to three if you want three loops before it stops.

Back to the questions list