/    Sign up×
Community /Pin to ProfileBookmark

Hello,

I have a number coordinate set for the top of my first menu. The script is dynamically building menu arrays on the fly. I need the top coordinate to dynically increment and change for each menu. For example, the number that is manually set right now is 20 for the first menu…I need the second menu built to be 40, and the third to be 60 and so on. How do I create a loop and have each menu be incremented by 20?

Thanks,
/bob

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@pyroJul 29.2003 — Something like this, perhaps?

<script type="text/javascript">
x = 20;
for (i=0; i<4; i++) {
x = x + 20;
alert (x);
}
</script>
Copy linkTweet thisAlerts:
@dev00authorJul 29.2003 — Yes...Thank you so much for your help!
Copy linkTweet thisAlerts:
@pyroJul 29.2003 — You bet... ?
×

Success!

Help @dev00 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...