Results 1 to 4 of 4

Thread: IFRAME scroller IE: use inside table

  1. #1
    Join Date
    Sep 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default IFRAME scroller IE: use inside table

    I'm a complete novice ... so apologies if this is a dumb question.

    I've been trying out the IFRAME scroller IE

    http://www.dynamicdrive.com/dynamici...e-scroller.htm

    and it works fine ... except when I try to insert the script into the cell of a table. When I view the page I just see the actual script commands and no scrolling text. I'd be very grateful if someone would tell me where I'm going wrong.

    Thanks ...

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    It shouldn't matter whether the script is inside a table cell or not. Do you have a URL to the problem?

  3. #3
    Join Date
    Sep 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The links are:

    Works - not inside table

    http://www.liv.ac.uk/~jan/Test.htm

    and

    Doesn't work - inside table

    http://www.liv.ac.uk/~jan/Test2.htm

    Thanks for any help ...

  4. #4
    Join Date
    Aug 2004
    Location
    Brighton
    Posts
    1,563
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I viewed the source of the tabled site, this is what it says:

    Code:
    <table width="75%" border="1">
      <tr>
        <td>&lt;script type=&quot;text/javascript&quot;&gt;
          <p>/***********************************************<br>
    
            * IFRAME Scroller script- &copy; Dynamic Drive DHTML code library (www.dynamicdrive.com)<br>
            * This notice MUST stay intact for legal use<br>
            * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source 
            code<br>
            ***********************************************/</p>
          <p>//specify path to your external page:<br>
    
            var iframesrc=&quot;external.htm&quot;</p>
          <p>//You may change most attributes of iframe tag below, such as width and 
            height:<br>
            document.write('&lt;iframe id=&quot;datamain&quot; src=&quot;'+iframesrc+'&quot; 
            width=&quot;150px&quot; height=&quot;150px&quot; marginwidth=&quot;0&quot; 
            marginheight=&quot;0&quot; hspace=&quot;0&quot; vspace=&quot;0&quot; frameborder=&quot;1&quot; 
            scrolling=&quot;no&quot;&gt;&lt;/iframe&gt;')</p>
    
          <p>&lt;/script&gt;</p>
        </td>
      </tr>
    </table>
    As you can see, you've accidentally pasted the code as text into your HTML composing program, and it has treated it as such. It's a simple mistake to make. You need to make your HTML code this:

    Code:
    <table width="75%" border="1">
      <tr>
        <td>
    <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>')
    </td>
      </tr>
    </table>
    </script>
    Regards
    cr3ative
    A retired member, drop me a line through my site if you'd like to find me!
    cr3ative media | read the stickies

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
  •