Responsive Inline Frame

This section is for posting questions which are not directly related to WYSIWYG Web Builder.
Examples of off topics: web server configuration, hosting, programming related questions, third party scripts.

Note that these questions will generally not be answered by the administrators of this forum.
Post Reply
girija.mahapatra
 
 
Posts: 26
Joined: Tue Sep 26, 2017 10:22 am

Responsive Inline Frame

Post by girija.mahapatra »

I have a simple responsive iFrame that work fine offline. But when I add an Inline Frame to my wbs project, I don't get responsiveness in auto height adjustment.
I have read the thread "viewtopic.php?t=98316&hilit=inline+fram ... d40f52c718" and procedure is bit complex there.

How can I add my code piece in the .wbs project page to make it work.

My HTML code is:
==============================
<!DOCTYPE html>
<html>
<head>
<link rel ="stylesheet" href ="quiz.css">
</head>
<body>
<div class="container">
<iframe id="dynamic-iframe" src="My External Link that I will insert"></iframe>
</div>
<script>
window.addEventListener('message', (event) => {
// Check if the message is from the authorized origin
if(event.origin === 'My External Link that I will insert') {
if (event.data === 'Unauthorized access') {
alert('You are not authorized to access the quiz');
}
}
});

</script>
<!-- <script src="script.js"></script> -->
</body>
</html>
======================
My CSS
======================
.container {
width: 800px;
margin: 0 auto;
display: block;
}

.link-container a {
display: block;
margin-bottom: 10px;
padding: 10px;
background-color: #2529f7;
text-decoration: none;
color: #333;
}

#dynamic-iframe {
width: 100%;
height: 550px;
border: 1px solid #2529f7;
}
User avatar
Pablo
 
Posts: 22472
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Responsive Inline Frame

Post by Pablo »

You will need to remove the page structure tags (html, body, head) from the code and then you can paste it between the head tags in Page HTML.
You can use the build-in inline frame as a place holder. So, there is no need for the 'iframe' code.

See also:
https://wysiwygwebbuilder.com/add_html.html
girija.mahapatra
 
 
Posts: 26
Joined: Tue Sep 26, 2017 10:22 am

Re: Responsive Inline Frame

Post by girija.mahapatra »

Genius :D

Thanks Pablo
Post Reply