Tagged: autoscroll, iframe
-
AuthorPosts
-
June 1, 2024 at 1:09 am #1447225
Hello team,
I hope you are well. I am experiencing an issue with the Enfold theme on my WordPress site and I am hoping you can assist me.
Every time I insert an iFrame on my page and reload the page, an autoscroll is triggered. The autoscroll occurs depending on the position where the page was scrolled before the reload, causing the page to land at different positions after the reload.
Could you please take a look at this on my site and help me resolve this problem? There is a link to the relevant page in the private content.
I look forward to your response and thank you in advance for your help.Best regards,
MaxJune 1, 2024 at 12:59 pm #1447272Hey kalimeromax,
It looks like your iframe contains: data-scrolltop, please try removing this from the iframe snippetBest regards,
MikeJune 2, 2024 at 12:46 pm #1447434Hey Mike,
Thanks for the quick response. I’ve removed the parameter. Unfortunately, the same behavior is occurring. Do you have any other ideas?
Best regards,
MaxJune 2, 2024 at 12:59 pm #1447437may i see your example page too?
As participant i do not see your private content area. Or describe your problem in more details.
F.e. a lot of users say iframe and they mean a lightbox window.June 2, 2024 at 1:04 pm #1447439Hey Guenni,
thanks for your reply! here you go: https://kiz.on-testumgebung.de/fort-und-weiterbildung/
i use the codeblock for the iframe.June 2, 2024 at 1:20 pm #1447445June 2, 2024 at 8:17 pm #1447492ok – that is something different. But i think the script does not work as it should anyway.
because a modal window should actually be created – right?
” // PG: this version of the js-file handles the modal without the need of jQuery ”Then the scroll position of the modal window makes sense. And mike pointed out where the code is for doing that.
For me it looks like the modal should open on page load – and the top of that iframe inside the modal window is then on top.
But there is no modal window.can you please post the code of the code-block element here ( use the code tag from the options above please )
________
Was wird denn dort innerhalb des iframe angezeigt? woher speist sich der Inhalt? Meinst du nicht, das es auch mit Enfold mitteln gehen sollte? – ohne extra scripte?What is displayed within the iframe? Where does the content come from? Don’t you think that it should also work with Enfold means? – without extra scripts?
June 2, 2024 at 8:28 pm #1447493Hi,
Yes, please post the code that you are using for the iframe, but also check where you are getting this code, there may be different snippets to use for different situation and there may be a snippet that doesn’t do this.
Since this snippet is loading the javascript file from outside your site, you may not be able to override this behavior, if you can’t find a different snippet to use you may need to ask the support for this snippet and tell them about this scroll function we found for them to offer you a solution.Best regards,
MikeJune 3, 2024 at 12:39 pm #1447545Hi everyone,
Thank you all for your responses and for pinpointing the issue so quickly. Here is some background information to address your questions:
The implementation of this iframe is a requirement from the client. Unfortunately, the documentation for the external software is very poor, which is why the script is not explained in detail. I appreciate your help in identifying the critical part of the code.
As for your questions:
Mike: The JavaScript that scrolls to the top of the iframe seems to be causing the issue. Here’s the relevant code snippet as you requested:
<script type='text/javascript' src="https://evidenz.de/download/iframe_js_code.js"></script> <iframe name="evidenz_obs-2" src="https://seminare.kinderschutz-zentren.org/?view=kartenansicht&th_id=16" style="border:none; height:800px; width:100%;" frameborder="0" seamless></iframe>
I will reach out to the company behind the software to get more information and possible solutions, especially regarding this scroll function.
Regarding the iframe content: The content within the iframe is provided by the external software. Given the client’s requirements, we have to use this iframe and cannot switch to Enfold’s native solutions alone.
Thank you once again for your assistance. I will follow up with the external software provider and update you with any new information.
Best regards,
MaxJune 3, 2024 at 8:55 pm #1447595June 4, 2024 at 6:36 am #1447651by the way – the source site of evidenz.de is an Enfold site too. Maybe you can ask them what you should do to hamper that scrolling.
The script is small enough to not load from their site- download it – make some change to the script and compress it (f.e. on https://jscompress.com/) to have a minified version of it. enqueue that minified script from your own server.June 4, 2024 at 11:28 am #1447788Hey Guenni,
Thank you very much for the input. I’ll take care of it. Good point. I will point out to Evidenz again that their site uses the same theme. Thanks for your help. I’ll get back to you once the problem is fixed. -
AuthorPosts
- You must be logged in to reply to this topic.