hi,
below is the programme which shakes the window every second when start button is clicked and stops shaking window when stop button is clicked.
how do i write the above programme in such a way that,when the page is loaded window starts shaking automatically and stops shaking after 1 minute.
thanks.
********************************
function startEQ()
{
richter=5
parent.moveBy(0,richter)
parent.moveBy(0,-richter)
parent.moveBy(richter,0)
parent.moveBy(-richter,0)
timer=setTimeout("startEQ()",1000)
}
function stopEQ()
{
clearTimeout(timer)
}
Comments
If I'm late, I'm sorry. But, a solution to your problem...
I don't know how to terminate the shaking after 1 minute,
but I can get it to stop after a while... here's some code
to play around with...
[code]
var counter=0;
var numTimes=10; // CHANGE THIS NUMBER AS REQUIRED
function startEQ(){
richter=5;
parent.moveBy(0,richter)
parent.moveBy(richter,0)
parent.moveBy(0,-richter)
parent.moveBy(-richter,0)
timer=setTimeout("startEQ()",0)
if(counter++ == numTimes)
stopEQ();
}
function stopEQ(){
clearTimeout(timer)
}
[/code]
Change the above mentioned number to
vary the length of time it executes.
: hi,
: below is the programme which shakes the window every second when start button is clicked and stops shaking window when stop button is clicked.
: how do i write the above programme in such a way that,when the page is loaded window starts shaking automatically and stops shaking after 1 minute.
: thanks.
: ********************************
:
:
:
: function startEQ()
: {
:
: richter=5
: parent.moveBy(0,richter)
: parent.moveBy(0,-richter)
: parent.moveBy(richter,0)
: parent.moveBy(-richter,0)
: timer=setTimeout("startEQ()",1000)
:
: }
: function stopEQ()
: {
: clearTimeout(timer)
: }
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
____________________________
Forever trust in who we are,
And nothing else matters.
-Metallica-
____________________________