Results 1 to 4 of 4

Thread: Scrolling iFrame not working in Chrome. Help?

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

    Default Scrolling iFrame not working in Chrome. Help?

    1) Script Title: Scrollable iFrame

    2) Script URL (on DD):
    http://dynamicdrive.com/dynamicindex17/iframescroll.htm

    3) Describe problem:
    Ok, so I'm using the scrollable iframe code and it's working fine in Firefox and IE, but the scroll is completely dead in Chrome.

    Any ideas? any workarounds? any help? I can extend the entire page or change the code to allow a scroll bar but that just defeats the purpose of having a gorgeous iframe.

  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

    The demo page here on DD:

    http://dynamicdrive.com/dynamicindex17/iframescroll.htm

    works fine in Chrome for me. How about you?

    If so, it's probably something to do with your implementation. If not, it probably has to do with browser settings in Chrome.

    If it's the implementation, one thing that folks sometimes get tripped up on is using a valid HTML page inside the iframe.

    If you look in the demo's source code for this page in the iframe you will see:

    Code:
    <b>What's Hot</b></p>
    <p align="left"><strong><font face="Verdana"><small><a href="http://www.dynamicdrive.com/dynamicindex9/encrypter.htm" target="_top">Source
    code encrypter</a>&nbsp;</small></font></strong><br>
    <font face="Verdana" size="2">Scramble the source of any chunk of code using
    this unique script.</font></p>
    <p align="left"><strong><font face="Verdana"><small><a href="http://www.dynamicdrive.com/dynamicindex5/flashlink.htm" target="_top">Flashing
    links</a>&nbsp;</small></font></strong><br>
    <font face="Verdana"><small>Bring attention to special links, by making them
    flash!</small></font></p>
    <p align="left"><small><strong><font face="Verdana"><a href="http://www.dynamicdrive.com/dynamicindex13/roamcursor.htm" target="_top">Roaming
    Cursor</a>&nbsp;</font></strong></small><br>
    <small><font face="Verdana">Display a second, &quot;roaming&quot; cursor on your
    page with this fun animation script.</font></small></p>
    <p align="left"><font face="Verdana"><strong><a href="http://www.dynamicdrive.com/dynamicindex11/animatedtitle.htm" target="_top"><small>Animated
    Document title</small></a><br>
    </strong><small>Animate into view your document's title!</small></font>
    
    
    <!--DO NOT REMOVE BELOW SCRIPT. IT SHOULD ALWAYS APPEAR AT THE VERY END OF YOUR CONTENT-->
    
    <script language="JavaScript1.2">
    
    //Scrollable content III- By http://www.dynamicdrive.com
    
    var speed, currentpos=curpos1=0,alt=1,curpos2=-1
    
    function initialize(){
    if (window.parent.scrollspeed!=0){
    speed=window.parent.scrollspeed
    scrollwindow()
    }
    }
    
    function scrollwindow(){
    temp=(document.all)? document.body.scrollTop : window.pageYOffset
    alt=(alt==0)? 1 : 0
    if (alt==0)
    curpos1=temp
    else
    curpos2=temp
    
    window.scrollBy(0,speed)
    }
    
    setInterval("initialize()",10)
    
    </script>
    Notice no DOCTYPE, head, meta or body tags. It only contains the content and the script. Yours should be similar.

    If that doesn't fix it for you:

    Please post a link to a page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

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

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    senraven (07-30-2010)

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

    Talking

    John, thank you for the reply.

    I did what you said with the inside iframe file but it was still not working. Then after a few choice words I decided to upload the files so i could post the link here as well as check it online, and it works. So I don't know what the deal is, but when checking it in browser just opening from the hard drive the scroll is not working, but once I uploaded it, everything is working fine.

    Thanks for taking a shot at helping
    Last edited by senraven; 07-30-2010 at 04:42 AM.

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

    Well, I perhaps should have thought of that. In Chrome there is enhanced local security involving javascript communication between files, including pages that normally are allowed to. On the web, this security is about average - like other browsers. So that's probably what was preventing it from working locally.
    - John
    ________________________

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

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
  •