SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot Oznob's Avatar
    Join Date
    Jun 2002
    Posts
    161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    iframe question 2

    Can i change my code below so that the Iframe can have a name so i can point hyperlinks on the page to load content only in the iframe window ?

    how would code below change and how would hyperlink look?

    thank in advance,
    Oznob

    Code:
     
    <IFRAME 
    
    src=http://www.acme.com frameBorder=0 
    
    width=100% scrolling=yes height=578></iframe>
    
    

  2. #2
    SitePoint Member AngelaR's Avatar
    Join Date
    Jul 2004
    Location
    Brighton, UK
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <IFRAME src=http://www.acme.com name="main" frameBorder=0 width=100% scrolling=yes height=578></iframe>
    Then the link would look like:

    Code:
    <a href="whatever.html" target="main">link</a>

  3. #3
    SitePoint Enthusiast trigxine's Avatar
    Join Date
    Jul 2004
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're going to want to reference the iframe in JavaScript, for something like custom scrolling, I'd recommend you gave it an id as well. Just like you would a div, just stick in id="whatever". It's a good coding practice, even if you don't need it for your site. Plus, if you give it an ID, you can move the width and height attributes out of the tag and into a stylesheet.


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
  •