Welcome to TalkGraphics.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2009
    Location
    Canberra, Australia
    Posts
    121

    Default iFrame Effect on Page.

    Hi all,

    I've noticed that by adding an iFrame to the bottom of a page, when the page loads the top of the page is in view but then it suddenly jumps to where the iFrame is located. I assume this is happening when the contents of the iFrame has loaded.

    Does anyone know if there is a way to prevent this?

    Thanks.

    = Steve

  2. #2
    Join Date
    Apr 2015
    Location
    Germany
    Posts
    927

    Default Re: iFrame Effect on Page.

    Maybe it is the same problem as THIS one?

  3. #3
    Join Date
    Mar 2009
    Location
    Canberra, Australia
    Posts
    121

    Default Re: iFrame Effect on Page.

    Quote Originally Posted by siran View Post
    Maybe it is the same problem as THIS one?
    Thanks Siran!

  4. #4
    Join Date
    Mar 2009
    Location
    Canberra, Australia
    Posts
    121

    Default Re: iFrame Effect on Page.

    Quote Originally Posted by siran View Post
    Maybe it is the same problem as THIS one?
    Ok, I tried those suggestions and unfortunately none of them worked. It's not possible to include an anchor because the page is accessed via a navigation bar.

    I'm not sure what a "fast reveal animation" is but when I tried to use an animation it completely messed up the iFrame.

    It would be nice if Xara had actions that could be performed on certain events.

    = Steve

  5. #5
    Join Date
    Apr 2015
    Location
    Germany
    Posts
    927

    Default Re: iFrame Effect on Page.

    Can you give us a link to an example?
    I'm off for about a week. If your problem is not solved until then I would like to have a look at it...

  6. #6
    Join Date
    May 2002
    Location
    Canada
    Posts
    3,338

    Default Re: iFrame Effect on Page.

    Try this. Make a layer called iframe only. Move it to the top in the layer section. Give that a go and see what happens.

    Also try this too.

    Instead of placing your html code body/head on the placeholder tab, use the page tab and place your code there.

  7. #7
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,744

    Info Re: iFrame Effect on Page.

    I have had success before in getting back to the parent window but never thought about an IFRAME that hogged the limelight.

    All the code here is in and around the IFRAME.

    1. Add the Name UsesJQuery to the IFRAME.
    2. In its Head, include:
    Code:
    <script>$(document).ready(function() {
    $('html').attr('id', 'parent');
    $('#emptyiframe').attr('src', 'index.htm');
    });
    </script>
    This adds an ID to the parent page that is needed to invoke it.

    3. In its body, include:
    Code:
    <script>var initialFocus = false;</script>
    
    <iframe src="index.htm" id="iframethatstealsfocus" width="100%" height="100%" frameborder="0" scrolling="auto" name="iframe"  onfocus="if (initialFocus==false) { document.getElementById('parent').focus(); initialFocus = true; }"><p>Your browser does not support iframes.</p></iframe>
    Change the source attribute to your IFRAME destination URL.
    The variable initialFocus is to ensure the first visit forces back to the parent windwo. Thereafter, the user has chosen to go into the IFRAME.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  8. #8
    Join Date
    Mar 2009
    Location
    Canberra, Australia
    Posts
    121

    Default Re: iFrame Effect on Page.

    Thanks Acorn and Behzad for your help.

    The iFrame contains a web application I wrote. I posted the issue on a developer's support forum a couple of days ago. I got a response today that resolved the problem. By adding one line of code it prevents the application from taking the focus.

    Thanks again.

    = Steve

 

 

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
  •