responsive iframe
Forum rules
IMPORTANT NOTE!!
DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.
PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
IMPORTANT NOTE!!
DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.
PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
responsive iframe
I would like to know if there is a way to make the iframe responsive to height with content?
S.A
- BaconFries
-
- Posts: 5648
- Joined: Thu Aug 16, 2007 7:32 pm
Re: responsive iframe
Haven't you previously asked this? see the following from yourself with Pablos reply to you with a possible solution.
viewtopic.php?p=468801#p468801I say the iframe of the page exists how to make it responsive?
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
Re: responsive iframe
the method taught is not working or something is not right, follow the link to see
https://jbastosimoveis.com.br/im%C3%B3veis/7192.php
https://jbastosimoveis.com.br/im%C3%B3veis/7192.php
S.A
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
Re: responsive iframe
Could you send the code on how to turn the iframe into responsive at the height?
S.A
Re: responsive iframe
Maybe this might be what you are looking for?
https://wwb.art-studio.top/index.php?ro ... duct_id=72
https://wwb.art-studio.top/index.php?ro ... duct_id=72
Running WYSIWYG Web Builder since 2007...
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
- BaconFries
-
- Posts: 5648
- Joined: Thu Aug 16, 2007 7:32 pm
Re: responsive iframe
Understand you need a solution but have you looked at the two suggestions given one by Pablo and zinc either one will work.Guys, I really need a solution here, if anyone can help
Pablo wrote: ↑Sat Dec 18, 2021 7:11 am Maybe this will be helpful?
https://www.tutorialrepublic.com/faq/au ... script.php
Note that this may not work because of browser security restrictions
zinc wrote: ↑Fri Jan 26, 2024 2:24 pm Maybe this might be what you are looking for?
https://wwb.art-studio.top/index.php?ro ... duct_id=72
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
Re: responsive iframe
Code: Select all
<script>
// Selecting the iframe element
var iframe = document.getElementById("imovel");
// Adjusting the iframe height onload event
iframe.onload = function(){
iframe.style.height = iframe.contentWindow.document.body.scrollHeight + 'px';
}
</script>
when adding the iframe in the code, it doesn't work
Last edited by alexoliveira on Fri Jan 26, 2024 5:03 pm, edited 2 times in total.
S.A
- BaconFries
-
- Posts: 5648
- Joined: Thu Aug 16, 2007 7:32 pm
Re: responsive iframe
The reason it doesn't work is because it is only meant as an "Example" for it to work you will need to reference your own iframe with its id. Please note if you wish to use external code it is for reference only and you need to know how to use it yourself.
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
Re: responsive iframe
yes, I added the id correctly with the iframe that is on the page, id name: imovel
S.A
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
Re: responsive iframe
the iframe id: imovel in the code notice that I put imovel too, I added it in the <head></head>
S.A
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
- BaconFries
-
- Posts: 5648
- Joined: Thu Aug 16, 2007 7:32 pm
Re: responsive iframe
Can you provide a url with just a iframe with how you have added the code nothing else so it can be viewed.
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
Re: responsive iframe
What to do in this case, the code points to the iframe id, it still doesn't work
S.A
- BaconFries
-
- Posts: 5648
- Joined: Thu Aug 16, 2007 7:32 pm
Re: responsive iframe
The reason why it doesn't work is because you have not included the required style!!.
Code: Select all
<style>
iframe{
width: 100%;
border: 2px solid #ccc
}
</style>
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
- BaconFries
-
- Posts: 5648
- Joined: Thu Aug 16, 2007 7:32 pm
Re: responsive iframe
You insert via Page HTML Between the <head></head> tags*
Re: responsive iframe
I think you are going to have issues getting the iframe to be 100% if the page you are showing in the iFrame is from another domain. If you are hosting the page yourself then it should work. If not, there are solutions for cross domain but you have to have access to the other domain to add some code for it to work.
Otherwise, I think you will need to set a specific height to the iframe. You can use CSS.
You could also set height to 100vh and that would make it at lease a minimum height of the browser window.
Otherwise, I think you will need to set a specific height to the iframe. You can use CSS.
Code: Select all
<style>
#imove1{width:100%;height:800px;}
</style>
- BaconFries
-
- Posts: 5648
- Joined: Thu Aug 16, 2007 7:32 pm
Re: responsive iframe
crispy68 (Ron) the css I gave is not by me it was from the original author at the following url below I only gave as alexoliveira hadn't added it to anywhere in his page source only the javascript.
https://www.tutorialrepublic.com/faq/au ... script.php
https://www.tutorialrepublic.com/faq/au ... script.php
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
Re: responsive iframe
Yes, the iframe domain is on the same hosting as the website, I'm kind of integrating a real estate system on the website made in wysiwyg, which I'm not able to do and make the iframe 100% responsive in height to show the complete content.
S.A
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
Re: responsive iframe
Does your extension work for links outside of wysiwyg?zinc wrote: ↑Fri Jan 26, 2024 2:24 pm Maybe this might be what you are looking for?
https://wwb.art-studio.top/index.php?ro ... duct_id=72
S.A
- BaconFries
-
- Posts: 5648
- Joined: Thu Aug 16, 2007 7:32 pm
Re: responsive iframe
Other than what I have written have you tried crispy68 suggestion? Also note if the page you are viewing in the iframe the (real estate) is not responsive itself then it will not adjust with the iframe meaning you will need to make the (real estate) page responsive.
- BaconFries
-
- Posts: 5648
- Joined: Thu Aug 16, 2007 7:32 pm
Re: responsive iframe
zinc wrote: ↑Fri Jan 26, 2024 2:24 pm Maybe this might be what you are looking for?
https://wwb.art-studio.top/index.php?ro ... duct_id=72
Please contact the developer of the extension for all questions on how it works.Does your extension work for links outside of wysiwyg?
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
Re: responsive iframe
Yes, the iframe page is 100% responsive, but I still couldn't make the code work in the iframe, here's the code:
Code: Select all
<script>
// Selecting the iframe element
var iframe = document.getElementById("imovel");
// Adjusting the iframe height onload event
iframe.onload = function(){
iframe.style.height = iframe.contentWindow.document.body.scrollHeight + 'px';
}
</script>
<style>
iframe{
width: 100%;
border: 2px solid #ccc
}
</style>
S.A
- BaconFries
-
- Posts: 5648
- Joined: Thu Aug 16, 2007 7:32 pm
Re: responsive iframe
Did you read my reply about trying the css suggestion by crispy68?.
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
Re: responsive iframe
Does the real estate system offer any sort of embed code to embed it on a website?
Using my suggestion will only make the iframe as long as the browser window. If the content in the iframe is longer than the browser window, you will still have vertical scrollbars.
Using my suggestion will only make the iframe as long as the browser window. If the content in the iframe is longer than the browser window, you will still have vertical scrollbars.
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
Re: responsive iframe
Yes, it supports it, it is responsive when accessed by mobile device, the problem here is making the iframe responsive, as I already had this happen in previous versions of wysiwyg, after updating to the new one, it no longer worked.
S.A
Re: responsive iframe
This has nothing to with WWB. An Inline frame is a standard HTML feature. it work the same as in previous versions.
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
Re: responsive iframe
The code is not working. How to make the iframe adjust to the size of the content inside the iframe. i.e. make the iframe responsive in autura.
S.A
Re: responsive iframe
If the code does not work then this is unrelated to WWB, it an issue with your code.
Please check the error console of the browser to see why it does not work.
Please check the error console of the browser to see why it does not work.
- BaconFries
-
- Posts: 5648
- Joined: Thu Aug 16, 2007 7:32 pm
Re: responsive iframe
If it doesn't work then it is the script itself and not related to WWB. You should contact the script developer for help. Note it was provided for you to try and hopefully you could use it on the understanding you know how to use and insert correctly yourself.The code is not working. How to make the iframe adjust to the size of the content inside the iframe. i.e. make the iframe responsive in autura.
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
Re: responsive iframe
I completely understand that it is not related to WWB, I am just here for a solution, I would really like to make the iframe responsive in height.
I tried using the extension iframe resizer but I have no solution.
I tried using the extension iframe resizer but I have no solution.
S.A
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
Re: responsive iframe
some extension that automatically adjusts the height of the iFrame according to its content?
S.A
Re: responsive iframe
Yes, but this only works if you have control over the page inside the frame:
https://www.wysiwygwebbuilder.com/iframeresizer.html
But did you check this?
https://www.wysiwygwebbuilder.com/iframeresizer.html
But did you check this?
This should give you a clue why it does not work.Please check the error console of the browser to see why it does not work.
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
Re: responsive iframe
I don't understand how to use this pablo extension, is there anything easier to use?
S.A
Re: responsive iframe
No, there is nothing easier.
But did you read the documentation?
But did you read the documentation?
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
Re: responsive iframe
still unsuccessful, If someone could send a zip file, with wysiwyg already working with a responsive iframe, it would help me a lot.
S.A
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
Re: responsive iframe
The iframeresizer extension that Pablo mentioned is probably the best way to handle this but you have to have access to page in the iframe. If you are hosting it on your own site, then I would think you should have access to use it. You will need to follow the instructions in adding to both pages. It is really hard to help you when we don't have access to the page in the iframe. If we try, then it is cross domain which causes issues and we don't have access to your page, so there is no way for us to create a working example to test and give you.
What software are you using for whats in the iframe?
What software are you using for whats in the iframe?
- BaconFries
-
- Posts: 5648
- Joined: Thu Aug 16, 2007 7:32 pm
Re: responsive iframe
crispy68 (Ron) the site in question is the following:It is really hard to help you when we don't have access to the page in the iframe.
https://adm.jbastosimoveis.com.br/imove ... esidencial
Re: responsive iframe
So I'm assuming this is on a 3rd party site then? I was under the impression he was hosting it on his own server. If 3rd party then the extension won't work.
- BaconFries
-
- Posts: 5648
- Joined: Thu Aug 16, 2007 7:32 pm
Re: responsive iframe
I believe so, viewing the source it is a "theme" meaning it could be from the likes of Drupal/Joomla or something similar.
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
Re: responsive iframe
Guys, the site is hosted on my server, what should I do next, add some code to the page that goes in the iframe?
S.A
Re: responsive iframe
You still have not included a demo of what you have done. That makes it very difficult to help you...
- alexoliveira
-
- Posts: 212
- Joined: Fri Oct 01, 2021 5:12 am
- Contact:
Re: responsive iframe
Here's a demo of how I'm using the iframe with the code
https://startagencia.net.br/demo.zip
https://startagencia.net.br/demo.zip
S.A
Re: responsive iframe
The code does not work because the page displayed inside the inline frame in not in the same domain. So, it cannot be accessed for security reasons.
You can check this in the error console of the browser.
You can check this in the error console of the browser.
Re: responsive iframe
So I put together a demo using the code for iframe resizer. You will need to add the code manually because there will be code needed to be added to the page you want to show in the inline frame.
Here is my demo:
https://wizbangwebdesign.com/demo/frame/
My demo is a header and footer with the inline frame in between.
To make it work, visit https://github.com/davidjbradshaw/iframe-resizer and download the zip file and unzip it.
The steps below assume that you have your .js files in a separate folder on the server.
1. In WB, add a HTML box and add the following code set to the before </body> tag:
Between the {} above you can add other options (see the github link above for more info). Make sure to change the ID in the above code to match your inline frame ID.
2. You will need to access the page you want to appear in the inline frame and add the following code at the end of the HTML before the end body tag </body>:
3. You will need to upload the following .js files to the appropriate spots. Both of these files can be found in the downloaded js folder from github:
iframeResizer.min.js = upload this file to the .js folder for page that contains the iframe
iframeResizer.contentWindow.min.js = upload this file to the .js folder for the page that is appearing in the iframe.
NOTE: I will leave my demo up for a very short time for viewing and then it will be removed.
Here is my demo:
https://wizbangwebdesign.com/demo/frame/
My demo is a header and footer with the inline frame in between.
To make it work, visit https://github.com/davidjbradshaw/iframe-resizer and download the zip file and unzip it.
The steps below assume that you have your .js files in a separate folder on the server.
1. In WB, add a HTML box and add the following code set to the before </body> tag:
Code: Select all
<script type="text/javascript" src="js/iframeResizer.min.js"></script>
<script>
iFrameResize({}, '#InlineFrame1')
</script>
2. You will need to access the page you want to appear in the inline frame and add the following code at the end of the HTML before the end body tag </body>:
Code: Select all
<script type="text/javascript" src="js/iframeResizer.contentWindow.min.js" defer=""></script>
iframeResizer.min.js = upload this file to the .js folder for page that contains the iframe
iframeResizer.contentWindow.min.js = upload this file to the .js folder for the page that is appearing in the iframe.
NOTE: I will leave my demo up for a very short time for viewing and then it will be removed.