Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
62
rated 0 times [  69] [ 7]  / answers: 1 / hits: 23985  / 6 Years ago, mon, may 7, 2018, 12:00:00

I am new to javascript. Now I have a link in home page which redirects to other html page, but I want to show that as a popup in my home page with responsiveness and some styles like a corner is folded.Is there any way to do that in javascript.



Thank you


More From » jquery

 Answers
7

You can simply use <iframe> to display the another page content in the modal content.





$(window).load(function(){
$('#exampleModal').modal('show');
});

iframe {
display:block;
width:100%;
}

<script src=https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js></script>
<link href=https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css rel=stylesheet integrity=sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB crossorigin=anonymous>
<script src=https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js integrity=sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T crossorigin=anonymous></script>
<button type=button class=btn btn-primary data-toggle=modal data-target=#exampleModal>
Launch demo modal
</button>

<div class=modal fade id=exampleModal tabindex=-1 role=dialog aria-labelledby=exampleModalLabel aria-hidden=true>
<div class=modal-dialog role=document>
<div class=modal-content>
<div class=modal-header>
<h5 class=modal-title id=exampleModalLabel>Modal title</h5>
<button type=button class=close data-dismiss=modal aria-label=Close>
<span aria-hidden=true>&times;</span>
</button>
</div>
<div class=modal-body>
<iframe src=www.google.com>
</div>
<div class=modal-footer>
<button type=button class=btn btn-secondary data-dismiss=modal>Close</button>
<button type=button class=btn btn-primary>Save changes</button>
</div>
</div>
</div>
</div>




[#54493] Thursday, May 3, 2018, 6 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
debra

Total Points: 583
Total Questions: 111
Total Answers: 111

Location: Reunion
Member since Mon, Dec 28, 2020
3 Years ago
;