Click to See Complete Forum and Search --> : Scroll Through Months


dkilby
04-19-2003, 09:47 PM
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

Jona
04-19-2003, 09:58 PM
I am probably misunderstanding you completely, but can't you just use simple HTML to do that?

dkilby
04-19-2003, 10:32 PM
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

Jona
04-19-2003, 10:36 PM
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?

dkilby
04-19-2003, 10:41 PM
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

Jona
04-19-2003, 10:52 PM
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?

dkilby
04-19-2003, 10:56 PM
no not all-browser compatible, I only need it for IE

Jona
04-20-2003, 05:07 PM
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>

dkilby
04-21-2003, 12:06 AM
Thanks for all your help I made some minor additions to use in the application I need. It work great.

Thanks