• Resolved paulinewarman

    (@paulinewarman)


    I have a small WP website which pulls in dynamic data from a non-WP site using an iframe on 4 pages. The content below the iframe on those pages scrolls down continously in Internet Explorer (9) and Google Chrome, including the footer.

    The “Contact Us” page which does not have an iframe behaves as it should and the footer remains static in all the browsers I have tried.

    The scrolling problem does not happen in Firefox or Waterfox. . My OS is Windows 7.

    I am pulling my hair out here – help please.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • You have this on your page:

    jQuery(document).ready(function(){
    	setInterval( function() { AutoiFrameAdjustiFrameHeight( 'auto-iframe', 50); }, 1000 );
    });
    

    You also have AutoiFrameAdjustiFrameHeight set to run as the onload attribute on the iframe.

    That function appears to set the height of the iframe element to the height of the contents, plus 50 pixels. The problem is that this runs every second, and seems to be adding the fudge each time. The problem seems to be that different browsers give different values for contentDocument.body.offsetHeight. Chrome (and Safari for that matter) seem to include the extra height that was added the last time the function was run, causing the height to go up and up.

    The most obvious solution is just to not run this every second. It’s not clear to me what the purpose of this is.

    A more permanent solution would be to find a more reliable way to get the iframe contents height. According to this StackOverflow answer, the margin on the body element of the iframe source could cause a problem. If you have control over its CSS, removing that margin might help.

    Thread Starter paulinewarman

    (@paulinewarman)

    Thank you very much for that – I will have a look and see what I can do. I have control of the CSS for the content in the iframe so that is a possibility. Otherwise it appears it could be something within the AutoIframe plugin itself as I too do not understand why the function you have identified runs every second.

    Thread Starter paulinewarman

    (@paulinewarman)

    Hello again,
    I can’t thank you enough – it was driving me mad. I have edited the plugin in WordPress (very carefully) and used “setTimeout” instead of “setInterval” and it appears to have solved the problem. My javascript knowlege is not great as most of my programming when I was working was with .Net so I am very grateful that you took the time to help me.

    Thread Starter paulinewarman

    (@paulinewarman)

    Resolved

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Content after iframe scrolls continuously in IE and Chrome’ is closed to new replies.