"Next" and "Previous"

M

Mary Hartman

This probably has no answer.

I am putting pictures of my granddaughter's 1st birthday on the family
website. I have the pages all in the same directory and numbered like
this:

birthday01001.htm
birthday01002.htm

Is there way to program a next and previous button and put it on a DWT
page or any type of page that will automatically go to the next number
or previous number page in the directory so that I don't have to go to
every single page and create two hyperlinks - one to the next page and
one to the previous page?

I know this sounds lazy, but I'm a proud grandparent and have over 100
pictures to post! :>)

Thank you
 
J

Jon Spivey

Hi Mary,
You could make the buttons like this,
<script type="text/javascript">
function goNext(){
var a=location.href.toLowerCase().split('/');
b=a[a.length-1].replace('birthday','');
b=parseInt(b.replace('.htm',''),10) + 1;
location.href='birthday0' + b + '.htm';
}
function goPrev(){
var a=location.href.toLowerCase().split('/');
b=a[a.length-1].replace('birthday','');
b=parseInt(b.replace('.htm',''),10) - 1;
location.href='birthday0' + b + '.htm';
}
</script>
<a href="javascript:;" onclick="goNext();">next page</a>
<a href="javascript:;" onclick="goPrev();">previous page</a>

This isn't a perfect solution but it should do the job.

Cheers,
Jon
 
S

Stefan B Rusynko

Or if you don't want to use any scripting code
Drag all your pages (birthday01001.htm thru birthday0100X.htm) onto your Nav View in sequence
(under any other page)
Then Add a Nav bar to the page using Same level and a link to the starting page


--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


| Hi Mary,
| You could make the buttons like this,
| <script type="text/javascript">
| function goNext(){
| var a=location.href.toLowerCase().split('/');
| b=a[a.length-1].replace('birthday','');
| b=parseInt(b.replace('.htm',''),10) + 1;
| location.href='birthday0' + b + '.htm';
| }
| function goPrev(){
| var a=location.href.toLowerCase().split('/');
| b=a[a.length-1].replace('birthday','');
| b=parseInt(b.replace('.htm',''),10) - 1;
| location.href='birthday0' + b + '.htm';
| }
| </script>
| <a href="javascript:;" onclick="goNext();">next page</a>
| <a href="javascript:;" onclick="goPrev();">previous page</a>
|
| This isn't a perfect solution but it should do the job.
|
| Cheers,
| Jon
|
| | >
| > This probably has no answer.
| >
| > I am putting pictures of my granddaughter's 1st birthday on the family
| > website. I have the pages all in the same directory and numbered like
| > this:
| >
| > birthday01001.htm
| > birthday01002.htm
| >
| > Is there way to program a next and previous button and put it on a DWT
| > page or any type of page that will automatically go to the next number
| > or previous number page in the directory so that I don't have to go to
| > every single page and create two hyperlinks - one to the next page and
| > one to the previous page?
| >
| > I know this sounds lazy, but I'm a proud grandparent and have over 100
| > pictures to post! :>)
| >
| > Thank you
|
|
 
M

Mary Hartman

On Tue, 23 Jan 2007 12:44:53 -0500, Mary Hartman


I used the script that Jon gave me before you answered Stefan.

The script works great but not on all computers. Does someone know
why?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top