...

View Full Version : Question with frames



Squash
08-07-2005, 08:02 PM
OK, Im like a newbie, i mean seriously, just started like 3 days ago while pondering on making my own site. Of course im just trying to figure out how to get it all done. Its a free one put on a blogs website. OK heres the question. I want something like in the example below




|-------------------------------------------------------------------------------------------------------|
| Page1: I want this part to lead to a new page but keep in the frame set. I want the button below to load upthe next page kinda like a list type thing
| |
| |
| |
| |
| |
| |
|-------------------------------------------------------------------------------------------------------|
| (Button that leads to next page but stays here)
| |
| |
---------------------------------------------------------------------------------------------------------

ok. heres what i want. Ineed something that has a framset like aboc\ve that has a button at the bottokm and says like next page but like it isnty random but keeps going through a list of pages. Buyt all I want is a button there? How do i do this? Will I need to create a new page just to have the button there? help me out here!

Example:
(button) Next Page
( i want the button to go through like a list of pages like a 1, 2, 3 , 4 , 5 ,5 ,6 etc...
thanks to all who can help me

nikkiH
08-08-2005, 07:30 PM
If you feel some need to use frames for this, yes, it has to be a separate page. That's what a frameset IS. Two (or more) window objects, each with its own document in it.
I personally would just use an include file of some kind for this. Server-side, preferably, but for a free host, you may be stuck with javascript.

mark87
08-08-2005, 08:01 PM
Basically you'd wana stick this Javascript in the frame head where the button will be...



<script>
var start = 1, end = 3, nr = 1, index = "index.html";

function fChange( num ) {
fname = top.frames[0].location.href;
// alert('fname='+fname);
ii=0; jj=0;
for(i=0;i<fname.length;i++) {
if(fname.charAt(i) == '/') ii=i;
if(fname.charAt(i) == '.') jj=i;
}
nr = parseInt( fname.substring(ii+1,jj) )+ parseInt(num);
if ((nr>=start) & (nr<=end)) {
top.frames[0].location.href = ""+ nr +".html";
}
else top.frames[0].location.href = index;
}
</script>

Then have the button like this -

<input type="button" onClick="fChange('+1')" value="Next">

Each page should be named 1.html , 2.html , 3.html , etc.

Squash
08-08-2005, 09:35 PM
k thanks for this but will i have to make a new page for each 1.html...cuz i dont have a site, i was gunna put this on a free blogs site and dont know if this would work...thanmks

mark87
08-08-2005, 09:57 PM
Oh yea forgot it was for a blog site. I doubt what you want will be possible then... :o



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum