Go Back   PCMech Forums > Help & Discussion > Internet, Web Applications, & The Cloud

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 02-10-2003, 01:14 PM   #1
Member (10 bit)
 
Join Date: May 1999
Location: Orlando, FL
Posts: 975
Send a message via ICQ to artsapimp
Javascript - menus in motion

I am trying to create a function that sends the current div off the screen (left=700 for testing) and then move the next div onto the screen (left=200). I am very close but am falling short when trying to assign a value to a function (eval). Any help would be great appreciated.

Code:
< script language='javascript' >
var curActive = 'Sec0';
var nextActive;

function setActive(SecID){
	nextActive = SecID;
	LoopOffScreen(curActive);
}

function LoopOffScreen(SecID){
	if(parseInt(eval(SecID + '.style.left,10')) < 700){
		eval(SecID + '.style.left') = parseInt(eval(SecID + '.style.left,10')) + 1;
		setTimeout('LoopOffScreen(curActive);',1);
	} else {
		curActive = nextActive;
		LoopOnScreen(curActive);
	}
}

function LoopOnScreen(SecID){
	if(parseInt(SecID.style.left,10) < 200){
		SecID.style.left = parseInt(SecID.style.left,10) + 1;
		setTimeout('LoopOnScreen(curActive);',1);
	}
}
< /script >
artsapimp is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 04:18 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2