Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Aug 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question with frames

    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
    Last edited by Squash; 08-07-2005 at 08:03 PM. Reason: forgot something

  • #2
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    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.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #3
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Basically you'd wana stick this Javascript in the frame head where the button will be...

    Code:
    <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.

  • #4
    New Coder
    Join Date
    Aug 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ok

    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

  • #5
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oh yea forgot it was for a blog site. I doubt what you want will be possible then...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •