Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: linking to a Scrollable IFRAME

  1. #1
    Join Date
    Jan 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default linking to a Scrollable IFRAME

    script: Scrollable IFRAME
    http://www.dynamicdrive.com/dynamici...ramescroll.htm

    a few questions about customizing the Scrollable IFRAME script:

    is it possible to have links outside of the iframe link into it from a sourced html file? I want to use it as the means to navigate a website.

    can you have multiple up and/or down buttons at different speeds. I want 2 down buttons: one at normal scroll speed and one so fast it'll take you to the end of the document instantly.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    If you give the iframe a name and target it with your links on the top page, yes:

    HTML Code:
    <iframe name="norma" src= . . .
    HTML Code:
    <a href="some.htm" target="norma">Link Text</a>
    You can also make up links (for the top page, not the contained page) with events like these:

    HTML Code:
    <a href="javascript:toTop();" onclick="norma.scrollTo(0,0);return false;">Top</a>
    and:

    HTML Code:
    <a href="javascript:toBottom();" onclick="norma.scrollTo(0,10000);return false;">End</a>
    Notes: The href values of these last two links are dummies. They could as well be:

    HTML Code:
    href="#"
    But, whatever they are will show in the status bar (in many browsers) onmouseover so, might as well make them seem official. This also means that if you make the event onmouseover, you still need to return false onclick, ex:

    HTML Code:
    <a href="javascript:toBottom();" onclick="return false;" onmouseover="norma.scrollTo(0,10000);">End</a>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jan 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default IFrame Transparant?

    Can you change background from white to transparant or a picture or a color?

    Warner B.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Warner
    Can you change background from white to transparent or a picture or a color?

    Warner B.
    That depends upon the browser and upon what's displayed in the iframe. Generally most browsers that support iframes will allow you to set the background color and/or image of the iframe via style and then that will show through as the background of the content of the iframe. However, in IE only a page with no background of its own set will do this and even then the proprietary allowtransparency="true" attribute must be set for the iframe. So, do something like so:

    HTML Code:
    <iframe style="background-color:green;" allowtransparency="true" src="page_with_no_background_set.htm"></iframe>
    or for an image:

    HTML Code:
    <iframe style="background-image:url('some.gif');" allowtransparency="true" src="page_with_no_background_set.htm"></iframe>
    Notes: Style can also be set in a stylesheet or stylesheet section if you are familiar with how that is done. If no page is used, for example if an image only is the content of the iframe, this will not work in IE.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Apr 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    If you give the iframe a name and target it with your links on the top page, yes:

    HTML Code:
    <iframe name="norma" src= . . .
    HTML Code:
    <a href="some.htm" target="norma">Link Text</a>
    You can also make up links (for the top page, not the contained page) with events like these:

    HTML Code:
    <a href="javascript:toTop();" onclick="norma.scrollTo(0,0);return false;">Top</a>
    and:

    HTML Code:
    <a href="javascript:toBottom();" onclick="norma.scrollTo(0,10000);return false;">End</a>
    Notes: The href values of these last two links are dummies. They could as well be:

    HTML Code:
    href="#"
    But, whatever they are will show in the status bar (in many browsers) onmouseover so, might as well make them seem official. This also means that if you make the event onmouseover, you still need to return false onclick, ex:

    HTML Code:
    <a href="javascript:toBottom();" onclick="return false;" onmouseover="norma.scrollTo(0,10000);">End</a>
    Hi, while searching for help I found this topic that looks like it is what I am trying to accomplish. Although I dont quite understand the html portion even if it looks easy.

    I am attempting to use links in the following site:
    http://www.californiabullfights.org/...es/index.shtml

    This is the code:
    HTML Code:
    <table border="1" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber7">
              <tr>
                <td width="50%" align="center"><font face="Arial" size="2">2004</font></td>
                <td width="50%" align="center"><font face="Arial" size="2">2005</font></td>
              </tr>
              <tr>
                <td width="50%" align="center"><font face="Arial" size="2"><a href="../schedules/2006/index.shtml" target="datamain">2006</a></font></td>
                <td width="50%" align="center"><font face="Arial" size="2">2007</font></td>
              </tr>
            </table>
            <!--Scrollable iframe script- By Dynamic Drive-->
    <!--For full source code and more DHTML scripts, visit http://www.dynamicdrive.com-->
    <!--This credit MUST stay intact for use-->
    
    <iframe id="datamain" src="../schedules/2007/sched2007.shtml" width=550 height=400 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=1 scrolling=no></iframe>
    
    <layer visibility=hide>
    <div style="width:550px;" align="left">
    <a href="#" onMouseover="scrollspeed=-2" onMouseout="scrollspeed=0">Up</a> | <a href="#" onMouseover="scrollspeed=2" onMouseout="scrollspeed=0">Down</a>
    </div>
    </layer></p>
    As you can see in the third cell of table is where the link is, and the target is the iframe id: datamain. But when I click on link, a new window opens.

    Hope I am not to confused, or this is confusing.

    Any help? Thanks

    Gcam

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You target by name:

    Code:
    <a href="../schedules/2006/index.shtml" target="datamain">2006</a>
    Code:
    <iframe name="datamain" id="datamain" src="../schedules/2007/sched2007.shtml" width=550 height=400 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=1 scrolling=no></iframe>
    Fortunately, you can use the same name and id for one iframe.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Apr 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    John,

    Well That is the way I have it set up, yet the link keeps opening a new window. Anything I might be doing wrong?

    Gerry

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by gcam View Post
    Code:
    <iframe id="datamain" src="../schedules/2007/sched2007.shtml" width=550 height=400 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=1 scrolling=no></iframe>
    Quote Originally Posted by gcam View Post
    John,

    Well That is the way I have it set up, yet the link keeps opening a new window. Anything I might be doing wrong?

    Gerry
    Yes, you only have the id specified.

    Quote Originally Posted by me
    Code:
    <iframe name="datamain" id="datamain" src="../schedules/2007/sched2007.shtml" width=550 height=400 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=1 scrolling=no></iframe>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #9
    Join Date
    Apr 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    John,

    Bingo. Got it now, thanks. Mucho help, u Are.

    Gerry

  10. #10
    Join Date
    Apr 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Going to read up on this iframe stuff, like what it does. I heard it was getting phased out, is that true?

    Thanks again,

    Gerry

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
  •