Results 1 to 9 of 9

Thread: scrolling two (or more) iframes

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

    Default scrolling two (or more) iframes

    i have two iframes in the same window, each with its own set of up/down arrows for vertical scrolling. first test showed that each pair of arrows triggers the scolling action in both iframes, which was rather inconvenient. being determined to have each iframe individually triggered by only its related arrows, i have tried, but failed, to identify any reference in the code to the target of the scrolling action (i am inexperienced in java script, and my search was rather intuitive). i would greatly appreciate if anyone could help with solving this issue.

    thanks heaps,
    victor

  2. #2
    Join Date
    Aug 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    Default scrolling

    is it possible to make the first iframe large enough so you don't need to scroll the exterior iframe and just make the interior iframe scrollable? Or is there too much information to pull that off?

    I am also a novice when it comes to javascript and such, the only scrolling option I see in the iframe object regarding scrolling capabilities is either to activate it or deactivate it...

    I'm just a layout junkie, and in that respect I think it would be cumbersome to the user scroll through two iframe interfaces. That's why I would suggest creating the first iframe to be large enough to hold the secondary iframe and allow that one to be scrollable.

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

    Default

    You'll want to check out John's update to this script, which includes several improvements: http://home.comcast.net/~jscheuer1/s...side_table.htm
    Last edited by ddadmin; 08-15-2006 at 10:50 PM.

  5. #5
    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

    Actually DD, that turns out to have been the beta version. As mentioned later in the thread that introduces it, this is a more x browser version:

    http://home.comcast.net/~jscheuer1/s...side_table.htm

    Neither of these nor the script link mentioned by musatv uses iframes though.
    Last edited by jscheuer1; 08-15-2006 at 06:53 AM.
    - John
    ________________________

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

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

    Default

    Ops, URL updated. I'm going to post this script to DD soon.

    Neither of these nor the script link mentioned by musatv uses iframes though.
    I was a little confused as well. But anyhow, to musatv, the only script on DD that does scroll an iframe would be: http://dynamicdrive.com/dynamicindex17/iframescroll.htm

  7. #7
    Join Date
    Aug 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks a lot guys. my problem is not scrolling an iframe, have used the DD script a lot so far, with one frame, but how to adjust the code to make the arrows address only the iframe to which it is attached (at the moment, as in: http://www.themarqueerocks.com/, both sets of arrows will trigger scrolling in both iframes at once).

  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

    To get the effect of two or more scrollers on your page, you have two basic choices, you can use an on page scroller, such as the one you first mentioned in this thread, modified for multiple usage on a page like the one shown here:

    http://home.comcast.net/~jscheuer1/s...side_table.htm

    Or, you can adapt the iframe scroller that you are using. To do that, each scroller must have its own scrollspeed variable. So the for first one, you can use the script 'as is'. For the second, make these changes to the controls:

    Code:
    <div style="width:150px;" align="right">
    <a href="#" onMouseover="scrollspeed2=-2" onMouseout="scrollspeed2=0">Up</a> | <a href="#" onMouseover="scrollspeed2=2" onMouseout="scrollspeed2=0">Down</a>
    </div>
    And on the script on its content page:

    Code:
    function initialize(){
    if (window.parent.scrollspeed2!=0){
    speed=window.parent.scrollspeed2
    scrollwindow()
    }
    }
    For yet more scrollers, use scrollspeed3 and so on.

    Notes: There are relative advantages and disadvantages to each method.
    - John
    ________________________

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

  9. #9
    Join Date
    Aug 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default many thanks

    thanks a lot john, can see what you mean.
    that helps a lot

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
  •