Results 1 to 7 of 7

Thread: I-Frame external file access

  1. #1
    Join Date
    Apr 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default I-Frame external file access

    1) Script Title: IFRAME scroller

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...e-scroller.htm

    3) Describe problem: Does the exteranl file the script accesses HAVE to be named "external." If I change the file name all I get is a white box-no scrolling content.

    Any help or ideas would be greatly appreciated. Just found DD but finding lots to look at
    Thanks
    Kevin

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    It doesn't have to be named that, but then in the javascript, where it says:
    Code:
    //specify path to your external page:
    var iframesrc="external.htm"
    Would have to be changed, so change the highlighted to the file name.
    This is very simple. You can also make nemerous scollers by chaning your js to this:
    Code:
    <script type="text/javascript">
    
    /***********************************************
    * IFRAME Scroller script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    //specify path to your external page:
    var iframesrc= new Array();
    var iframesrc = ["page1.html","page2.html"] //and then keep going with the same patern, you can change file name.
    for(i=0;i<=iframesrc.length-1;i++){
    //You may change most attributes of iframe tag below, such as width and height:
    document.write('<iframe id="datamain" src="'+iframesrc[i]+'" width="150px" height="150px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="1" scrolling="no"></iframe>');
    }
    </script>
    I Hope this Helps,
    Nile
    Jeremy | jfein.net

  3. #3
    Join Date
    Mar 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I am guessing but if you changed the name of the external file did you also make the name change in the code you inserted in the page to load the iframe?

    <script type="text/javascript">

    /***********************************************
    * IFRAME Scroller script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/

    //specify path to your external page:
    var iframesrc="external.htm"

    //You may change most attributes of iframe tag below, such as width and height:
    document.write('<iframe id="datamain" src="'+iframesrc+'" width="150px" height="150px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="1" scrolling="no"></iframe>')

    </script>

    You would have to change the var iframesrc to the proper name to match your new one.

  4. #4
    Join Date
    Mar 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Haha beat me to it.

  5. #5
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    I beat you to it . And also in the future when your putting codes down, use:
    [code] and [/code] To make it look neater, It also helps us seperate text from code.
    Jeremy | jfein.net

  6. #6
    Join Date
    Mar 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Will do thanks!

  7. #7
    Join Date
    Apr 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks everyone for some reason the text was not showing up in Frontpage preview but when i opened in IE it was fine. If anyone knows why that happens I would be interested though
    Kevin

Bookmarks

Posting Permissions

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