Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iFrame loading in the wrong location #1350

Open
markjamesm opened this issue Oct 18, 2024 · 1 comment
Open

iFrame loading in the wrong location #1350

markjamesm opened this issue Oct 18, 2024 · 1 comment

Comments

@markjamesm
Copy link

Describe the bug
Sometimes when a page with the iFrame Resizer loads, the form appears below the footer of the website instead of where it should be (to the right of "Curious about how Maya HTT can help you?" in the screenshot below.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://www.mayahtt.com/products/simcenter-3d-for-additive-manufacturing/.
  2. Scroll down to the contact us section.
  3. Sometimes the form will appear below the site footer like in the screenshot below.

Expected behavior
The form loads in the correct place.

Screenshots

contact-form

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Microsoft Edge
  • Version: 29.0.2792.89 (Official build) (64-bit)

Additional context
This is the embed I'm using on my site:

<style>
    #pardotForm {
        width: 100%;
        height: 100vh;
        border: 0px;
    }
</style>

<noscript>
    <iframe src="https://www2.mayahtt.com/l/504061/2018-02-06/67n2mt" id="pardotForm" type="text/html"
        allowTransparency="true"></iframe>
</noscript>

<iframe id="pardotForm" src="https://www2.mayahtt.com/l/504061/2018-02-06/67n2mt"></iframe>

<script src="https://cdn.jsdelivr.net/npm/@iframe-resizer/parent"></script>

<script>
    iframeResize({
        license: 'xxxx',
        waitForLoad: true,
        log: false,
    }, '#pardotForm');
</script>
@markjamesm markjamesm changed the title iFrame appearing in the wrong location iFrame loading in the wrong location Oct 18, 2024
@davidjbradshaw
Copy link
Owner

davidjbradshaw commented Oct 22, 2024

Looking at your code embed, if you don't have JS you will end up loading the iframe twice. You don't need that <noscript/> block and given it uses the same ID on both iframes, I'm not sure what effect that will have on iframe-resizer. Beyond that your code looks good to me.

<style>
    #pardotForm {
        width: 100%;
        height: 100vh;
        border: 0px;
    }
</style>

<iframe src="https://www2.mayahtt.com/l/504061/2018-02-06/67n2mt" id="pardotForm" type="text/html" allowTransparency="true"></iframe>

<script src="https://cdn.jsdelivr.net/npm/@iframe-resizer/parent"></script>
<script>
    iframeResize({
        license: 'xxxx',
        waitForLoad: true,
        log: false,
    }, '#pardotForm');
</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants