A Pen by Janis Skarnelis on CodePen.
Created
February 17, 2020 11:58
-
-
Save hqkqn/3ead2b6f8a70782a7adb4ae66d51b85d to your computer and use it in GitHub Desktop.
fancybox v3.5 - Iframe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <h2>fancybox v3.5 - Iframe</h2> | |
| <p>Customization of iframed page - custom dimensions, disabled preloading and small close button on top of the content</p> | |
| <hr class="my-5" /> | |
| <div class="row mb-4"> | |
| <div class="card-deck col-9"> | |
| <div class="card"> | |
| <div class="card-body"> | |
| <p> | |
| Using <code>.fancybox()</code> method | |
| </p> | |
| <p class="mb-0"> | |
| <a data-fancybox data-type="iframe" href="https://codepen.io/about/" class="btn btn-primary fancybox"> | |
| Click me | |
| </a> | |
| </div> | |
| </div> | |
| <div class="card"> | |
| <div class="card-body"> | |
| <p> | |
| Using <code>data</code> attributes | |
| </p> | |
| <p class="mb-0"> | |
| <a data-fancybox data-type="iframe" href="https://codepen.io/about/" class="btn btn-primary" data-small-btn="true" data-iframe='{"preload":false}'> | |
| Click me | |
| </a> | |
| </p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $('.fancybox').fancybox({ | |
| toolbar : false, | |
| smallBtn : true, | |
| iframe : { | |
| preload : false | |
| } | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.6/dist/jquery.fancybox.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .fancybox-slide--iframe .fancybox-content { | |
| width : 800px; | |
| height : 600px; | |
| max-width : 80%; | |
| max-height : 80%; | |
| margin: 0; | |
| background: #191919; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <link href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.6/dist/jquery.fancybox.min.css" rel="stylesheet" /> | |
| <link href="https://codepen.io/fancyapps/pen/Kxdwjj" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment