/    Sign up×
Community /Pin to ProfileBookmark

Scroll Through Months

I want to create a menu type bar that has the name of the previous 4 months at the top. I want to have a previous and next button as well that scroll up or down through the months, just showing the month names. When clicked on the month name the date is sent to another page.

Hope this makes sense. If anyone could point in me the right direction I would appreciate it.

Thanks
Dave

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@JonaApr 20.2003 — I am probably misunderstanding you completely, but can't you just use simple HTML to do that?
Copy linkTweet thisAlerts:
@dkilbyauthorApr 20.2003 — I want to create a menu bar, that when someone clicks on the Month ie April 2003 it will show all the info relvant to that month. I only want to show 3 or 4 months at a time:

<< Dec 2002 Jan 2003 Feb 2003 >>

When someone clicks on the arrows it move up or down by one month

IE if they clicked on the right arrows

<< Jan 2003 Feb 2003 Mar 2003 >>

and so on. And as I said I would like the months to be used as links, with a value of something like

http://default.asp?searchDate=Jan 2003

or something like that.

Hopefully my explaination is a little better this time

Thank you
Copy linkTweet thisAlerts:
@JonaApr 20.2003 — Okay. Which language are you going to use? It looks like you want to use ASP. Or do you want to use JavaScript? Also, do you want the page to reload each time they click? Or do you want it to just change the value of the 3 dates on the inside?
Copy linkTweet thisAlerts:
@dkilbyauthorApr 20.2003 — I will be using ASP in the page and was thinking it might be easier to also use javascript to scroll through the dates. I would prefer the page not to reload when they scroll through but it will reload when they click on the one of the months

Thanks for you help
Copy linkTweet thisAlerts:
@JonaApr 20.2003 — An all-browser compatible script? Just so I know what to make (this might take a few hours of work) does it need to be Netscape 4.x compatible, too?
Copy linkTweet thisAlerts:
@dkilbyauthorApr 20.2003 — no not all-browser compatible, I only need it for IE
Copy linkTweet thisAlerts:
@JonaApr 20.2003 — For IE this works:

<html><head>

<script>

function scrollD(dir){

var effy = dateDiv.innerHTML.substring(3,0)

if(dir=="right"){

if(effy == "Jan"){dateDiv.innerHTML=" February; March; April; ";}

if(effy == "Feb"){dateDiv.innerHTML=" March; April; May; ";}

if(effy == "Mar"){dateDiv.innerHTML=" April; May; June; ";}

if(effy == "Apr"){dateDiv.innerHTML=" May; June; July; ";}

if(effy == "May"){dateDiv.innerHTML=" June; July; August; ";}

if(effy == "Jun"){dateDiv.innerHTML=" July; August; September; ";}

if(effy == "Jul"){dateDiv.innerHTML=" August; September; October; ";}

if(effy == "Aug"){dateDiv.innerHTML=" September; October; November; ";}

if(effy == "Sep"){dateDiv.innerHTML=" October; November; December; ";}

if(effy == "Oct"){dateDiv.innerHTML=" November; December; January; ";}

if(effy == "Nov"){dateDiv.innerHTML=" December; January; February; ";}

if(effy == "Dec"){dateDiv.innerHTML=" January; February; March; ";}

}

if(dir=="left"){

if(effy == "Jan"){dateDiv.innerHTML=" December; January; February; ";}

if(effy == "Feb"){dateDiv.innerHTML=" January; February; March; ";}

if(effy == "Mar"){dateDiv.innerHTML=" February; March; April; ";}

if(effy == "Apr"){dateDiv.innerHTML=" March; April; May; ";}

if(effy == "May"){dateDiv.innerHTML=" April; May; June; ";}

if(effy == "Jun"){dateDiv.innerHTML=" May; June; July; ";}

if(effy == "Jul"){dateDiv.innerHTML=" June; July; August; ";}

if(effy == "Aug"){dateDiv.innerHTML=" July; August; September; ";}

if(effy == "Sep"){dateDiv.innerHTML=" August; September; October; ";}

if(effy == "Oct"){dateDiv.innerHTML=" September; October; November; ";}

if(effy == "Nov"){dateDiv.innerHTML=" October; November; December; ";}

if(effy == "Dec"){dateDiv.innerHTML=" November; December; January; ";}

}

}

</script></head>

<body>

<a href="javascript:scrollD('left');"><<<</a>

<div id="dateDiv"> January; February; March; </div><a href="javascript:scrollD('right');">>>></a>

</body></html>
Copy linkTweet thisAlerts:
@dkilbyauthorApr 21.2003 — Thanks for all your help I made some minor additions to use in the application I need. It work great.

Thanks
×

Success!

Help @dkilby 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...