...

View Full Version : onclick changing inner



Idfk
09-27-2011, 02:30 AM
I've got this script that spins an image for me but it dont stop spinning, in other words when i press startspinning with onclick it dont change it to stopspinning function it just keeps spinning, it works fine with href but not onclick.


function StartSpinning() {

int = setInterval( 'SpinChange()', 100 );
$( 'SpinButton' ).innerHTML = "Spinning (Click to Stop)";
$( 'SpinButton' ).onclick = "StopSpinning();";
Effect.Fade( 'turns', {duration: 0.3} );

}

function StopSpinning() {

clearInterval( int );
$( 'SpinButton' ).innerHTML = "Spin it";
$( 'SpinButton' ).onclick = "StartSpinning();";
UpdateFigure();
Effect.Appear( 'turns', {duration: 0.3} );

}

Can anyone help thanks.

Logic Ali
09-27-2011, 03:18 AM
$( 'SpinButton' ).onclick = StopSpinning;



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum