inline fancybox modal testing

just testing to see if i can get a fancybox popup loading using an inline script rather than a document ready one, might be easier to implement.
similar to this one, but without the need for document ready checking. also if you enable the modal mode, then it remove the x at the top of the box and stops you from being able to close out of it, which is kind of annoying, but useful if you want to lock some content behind the modal. Added an example of modal:false and modal:true below. You can test a working version of the code below.

clicking modal demo

HTML

<button id='open_popup' class='btn btn-primary' onclick="$.fancybox.open({ src: '#pop-up', modal: false});">Open Popup (Modal False)</button>
<button id='open_popup' class='btn btn-primary' onclick="$.fancybox.open({ src: '#pop-up', modal: true});">Open Popup (Modal True)</button>

<div style="display: none; max-width:700px;" id="pop-up" >
<div>
    <h2>My Content</h2>
    <p>some content</p>
    <center><button data-fancybox-close class="button">Close</button></center>
</div>
</div>

Scripts

<link rel="stylesheet" type="text/css" media="all" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.3.5/jquery.fancybox.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.3.5/jquery.fancybox.js"></script>

Other Items in javascript
Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code snippits here, mostly for my reference. Also if i find a good site, i usually add it here.

❤👩‍💻🕹

Random Quote
When I realized that, no individual step is hard in any process. Building this airport I'm standing in right now started with a guy writing the architectural plans on paper. That's not hard for him to do. Then laying the first beam isn't had. The whole thing is really hard. So, just take each step kind of piece by piece and when I was able to do that and stop trying to chase this prize and started putting in the work, things just started coming together.
Unknown