473,396 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Simple Prev/Next Navigation

Hi,
I would like to have a navigation menu with prev/next in a top frame
and in the main frame a PDF file.
I think this might be possible with javascript:
- get current file name
- go to next prev in the list of 10 files

Unfortunately I do not know JavaScript - that's why my post.... ;-)
Could anybody point me in the right direction please?

Cheers
Saturinus
Jul 23 '05 #1
1 1877
saturnius wrote:
I would like to have a navigation menu with prev/next in a top frame
and in the main frame a PDF file.
I think this might be possible with javascript:
- get current file name
- go to next prev in the list of 10 files


Here are 4 files in a same directory (cross-frame scripting will need
the same domain anyhow). These should help you - just open index.htm
then.

--------------
index.htm
--------------
<html>
<head>
<frameset rows="70,*">
<frame name="top" src="top.htm">
<frame name="main" src="down.htm">
</frameset>
</head>
<body>
</body>
</html>

--------------
top.htm
--------------
<html>
<body>
<form>
<center>
<input type="button" value="Back"
onClick="parent.frames['main'].history.go(-1)">
<input type="button" value="Forward"
onClick="parent.frames['main'].history.go(+1)">
</center>
</form>
</body>
</html>

--------------
down.htm
--------------
<html>
<body>
<p>this is down.htm</p>
<p>go to <a href="down2.htm">down2.htm</a></p>
</body>
</html>

--------------
down2.htm
--------------
<html>
<body>
<p>this is down2.htm</p>
</body>
</html>

I'm not sure what you mean by "go to next prev in the list of 10
files". Actually, you can go back and forward to any file in in your
browser's window as long as it's present.

Example:
<input type="button" value="Go back 5 pages"
onClick="parent.frames['main'].history.go(-5)">
will get you back five pages (that is, if you had already visited 5
pages before invoking the script).

I don't see why you would need the current filename as you wrote.
Anyway, here it is:

<html>
<body>
Your current full file name = <br>
<script language="javascript">
document.write(location.href);
</script>
</body>
</html>

--
Bart
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: lokman | last post by:
Hi, In the following code, can someone tell me the difference between *p++ and p++ ? I can see both achieve the same result. Thanks a lot !
9
by: Astra | last post by:
Hi everybody Wonder if you could help me out. I created a simple JavaScript routine to enable a user to click backwards and forwards between small news articles. This routine works fine in IE...
6
by: Lars Eighner | last post by:
I suppose this is a meta-html question, but it seems to go directly to an authoring issue. Which order of next, home (menu, index, main, contents), prev links do you prefer, and why? 1. next...
5
by: disco | last post by:
I am working on this example from a book "C Primer Plus" by Prata 4th edition - p. 672. There is no erata on this problem at the publisher's website. 1) Is it a violation of copyright laws to...
6
by: Patrick Coghlan | last post by:
I want to create about 4 forms with the same dimensions and background colours, similar to the forms one has to traverse when installing various software packages. I'm using Visual Studio and...
2
by: RB | last post by:
Hi All, The ASP.NET Datagrid's pagination capability allows me to display either the Next/Prev buttons or the Page numbers to allow the user to navigate through the datagrid page by page as...
13
by: Joseph Garvin | last post by:
When I first came to Python I did a lot of C style loops like this: for i in range(len(myarray)): print myarray Obviously the more pythonic way is: for i in my array: print i
8
by: GaryDean | last post by:
I have a Wizard page and need to affect the next and previous buttons from my code-behind. I've googled around and found two solutions, and neither appear to work. I can access the SideBarList...
8
by: Chris M. Thomasson | last post by:
Here is the initial crude implmentation which compiles under Comeau with no warnings: ___________________________________________________________________ #include <cassert> #include <cstdlib>...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.