Responsive Link triggered Modal Plugin With jQuery simple overlay - Download Responsive Link-triggered Modal Plugin With jQuery - simple-overlay

Download Responsive Link-triggered Modal Plugin With jQuery – simple-overlay

Posted on

This time I will share jQuery Plugin and tutorial about Responsive Link-triggered Modal Plugin With jQuery – simple-overlay, hope it will help you in programming stack.

Responsive Link triggered Modal Plugin With jQuery simple overlay - Download Responsive Link-triggered Modal Plugin With jQuery - simple-overlay
File Size: 11.5 KB
Views Total: 2818
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

simple-overlay is a tiny and easy-to-use jQuery modal plugin which displays ajax content, Youtube / Vimeo videos in a fullscreen, responsive popup window while preventing window scroll.

How to use it:

1. Link to the style sheet simple-overlay.css that will provide the primary CSS styles for the modal window & fullscreen background overlay.

1 <link rel="stylesheet" href="simple-overlay.css">

2. Place jQuery library and the simple-overlay.js script at the bottom of the webpage.

1 <script src="//code.jquery.com/jquery.min.js"></script>
2 <script src="simple-overlay.js"></script>

3. Create a link to toggle a modal window that loads an external file via AJAX request.

1 <a href="ajax.html" class="ajax-demo"></a>
1 $(".ajax-demo").simpleOverlay();

4. Create a link to toggle a Youtube or Vimeo video modal.

2   data-vimeo="<iframe src='https://player.vimeo.com/video/138192484?autoplay=1&title=0&byline=0&portrait=0' width='640' height='360' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>"
3   class="viemo-demo"></a>
4    
6    data-youtube="<iframe width='560' height='315' src='https://www.youtube.com/embed/c6kiddk735g' frameborder='0' allowfullscreen></iframe>"
7     class="youtube-demo"></a>
1 $(".vimeo-demo").simpleOverlay({
2   "insertBy": "embed",
3   "attribute": "data-vimeo"
4 });
5  
6 $(".youtube-demo").simpleOverlay({
7   "insertBy": "embed",
8   "attribute": "data-youtube"
9 });

5. Execute a callback after the modal is shown.

1 $(".ajax-demo").simpleOverlay({
2   // options here
3 }, function () {
4   // callback
5 });

6. Possible plugin options.

1 $(".ajax-demo").simpleOverlay({
2   "namespace": "simple-overlay",
3   "insertBy": "load",
4   "attribute": "href",
5   "speed": 400
6 });

Change log:

2016-06-14

  • Fix to prevent multiple overlays
  • Improve no-scroll for body

This awesome jQuery plugin is developed by bdiekert. For more Advanced Usages, please check the demo page or visit the official website.

source : jqueryscript.net