www.webdeveloper.com
Results 1 to 5 of 5

Thread: go to next page in iframes using button command (next & back)

  1. #1
    Join Date
    Sep 2012
    Posts
    3

    go to next page in iframes using button command (next & back)

    hi.. i zul.. I have problem with my coding.. i want to go to the next page (i have 3 page : 5x4(1).html, 5x4(2).html and 5x4(3).html) in i frame.. the main iframes (Flyout1.html) is 5x4(1).html. when i click next button, it will go to the next page : 5x4(2).html in the same iframes(Flyout1.html). and when we click next button, its go to next page 5x4(3).html in a same iframe. I tried to do some coding to do like that but it not working. Since i not a very good in programming, i so difficult to me. I hope anybody can help me solve this problem. This is my error code that i write.

    * sorry, my english is bad.

    ------------------------------------------------------------------------
    <html>
    <head>
    <script>
    function DoInit() \
    {
    document.body.style.width = 750;
    document.body.style.height =350;// fixed width, variable height
    }

    </script>

    <script language="javascript">
    var currPage;

    function Next()
    {
    currPage += 1;


    if (currPage>3)
    {
    currPage= 3 ;
    }


    switch(currPage)
    {
    case 1:
    document.getElementById('Iframe1').src='5x4(1).html';
    case 2:
    document.getElementById('Iframe1').src='5x4(2).html';
    case 3:
    document.getElementById('Iframe1').src='5x4(3).html';
    break;
    default:

    }

    }
    function Back()
    {

    currPage -= 1;


    if (currPage<1)
    {
    currPage= 1 ;
    }

    switch(currPage)
    {
    case 1:
    document.getElementById('Iframe1').src='5x4(1).html';
    break;
    case 2:
    document.getElementById('Iframe1').src='5x4(2).html';
    break;
    case 3:
    document.getElementById('Iframe1').src='5x4(3).html';
    break;
    default:

    }
    }
    </script>
    </head>
    <body onload="DoInit()">
    <p><b> INFINEON MONITORING CHAMBER
    </b></p>
    <iframe id="Iframe1" frameborder="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" width="600" scrolling="yes" height="550" src="5x4(1).html">
    </iframe>
    </br>
    <input type="button" onClick="Iframe1('Back');" value="Back" />
    <input type="button" onClick="Iframe1('Next');" value="Next" />

    </body>
    </html>

  2. #2
    Join Date
    Mar 2009
    Posts
    452
    <script>
    function DoInit()
    {
    document.body.style.width = 750;
    document.body.style.height =350;// fixed width, variable height
    }

    </script>

    <input type="button" onClick="Back();" value="Back" />
    <input type="button" onClick="Next();" value="Next" />

  3. #3
    Join Date
    Sep 2012
    Posts
    3
    i already change like u states, but still can't function this next & back button..

  4. #4
    Join Date
    Sep 2012
    Posts
    3
    Quote Originally Posted by ZABI View Post
    <script>
    function DoInit()
    {
    document.body.style.width = 750;
    document.body.style.height =350;// fixed width, variable height
    }

    </script>

    <input type="button" onClick="Back();" value="Back" />
    <input type="button" onClick="Next();" value="Next" />
    --------------------------------------------------------------------------

    i already change, but still not working..

  5. #5
    Join Date
    Mar 2009
    Posts
    452
    <html>
    <head>
    <script>
    var currPage=1;
    var page=new Array();
    page[1]='5x4(1).html';
    page[2]='5x4(2).html';
    page[3]='5x4(3).html';


    function DoInit(){
    document.body.style.width = 750;
    document.body.style.height =350;// fixed width, variable height
    }

    function Next(){
    currPage += 1;


    if (currPage>3){
    currPage= 3 ;
    }

    status=currPage;
    document.getElementById('Iframe1').src=page[currPage];
    }


    function Back(){

    currPage -= 1;


    if (currPage<1){
    currPage= 1 ;
    }
    status=currPage;
    document.getElementById('Iframe1').src=page[currPage];
    }
    </script>
    </head>
    <body onLoad="DoInit()">
    <p><b> INFINEON MONITORING CHAMBER
    </b></p>
    <iframe id="Iframe1" frameborder="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" width="600" scrolling="yes" height="550" src="5x4(1).html">
    </iframe>
    </br>
    <input type="button" onClick="Back();" value="Back" />
    <input type="button" onClick="Next();" value="Next" />

    </body>
    </html>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles