Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mouse Slider Effect

Status
Not open for further replies.

mike10101

Vendor
May 6, 2005
13
GB
Hi,

I written the following script:

function changeWidth(elm,toWidth){

var width = parseInt(elm.style.width);
var change = toWidth-width;
var total=width+Math.round((change/2));
var timer;

elm.style.width=total+'px';

function c() {
changeWidth(elm,toWidth);
}

if(change==-1 ) {
change=0; }

if(change==0 ) {
clearTimeout(timer);
return;
}
timer=setTimeout(c,1);
}

Demo:
Question: Is it possible to stop this script being executed until it has arrived at the destination. I almost need to be able to lock out MouseEvents until the function returns. Currently it breaks if you roll over the links too quickly. Any help would be very appreciated. Really dont want to do this in Flash.

Cheers,

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top