Advanced Modal Popup Plugin - jQuery yBox

Advanced Modal Popup Plugin - jQuery yBox
File Size: 16.6 KB
Views Total: 272
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

yBox is an animated, easy-to-use, feature-rich, jQuery modal popup plugin for any web content such text, iframes, images, galleries, and much more.

More Features:

  • Simple to implement without any JS call.
  • Supports Youtube videos.
  • AJAX content is supported as well.
  • Allows you to open another modal from within the current one.
  • Allows you to navigate between images with keyboard.

How to use it:

1. To use this modal popup plugin, download and insert the following files into your HTML page.

<!-- jQuery (required) -->
<script src="/path/to/cdn/jquery.min.js"></script>
<!-- yBox Stylesheet -->
<link rel="stylesheet" href="/path/to/dist/css/yBox.min.css" />
<!-- yBox Directives (optional) -->
<script src="/path/to/dist/js/directive.min.js"></script>
<!-- yBox JavaScript -->
<script src="/path/to/dist/js/yBox.min.js"></script>

2. Add the CSS class 'yBox' to the trigger element and specify the selector of the content to be displayed in the modal popup.

<a href="#content" class="yBox">Trigger Link</a>
<div style="display:none;">
  <div id="content">
    Any Modal Content Here
  </div>
</div>

3. That's it. You can also display a modal popup on page load using the yBox method.

yBox('WelCome!');

4. Fetch and display an iframe (like a Youtube video) in the modal popup.

<a href="https://www.youtube.com/watch?v=eEMpCcLm6NI&list=RDeEMpCcLm6NI&start_radio=1" class="yBox yBox_iframe" rel="nofollow" title="Click Here">
  <img src="https://img.youtube.com/vi/eEMpCcLm6NI/0.jpg"  />
</a>

5. Apply an additional CSS class to the modal popup.

<a href="#content" data-ybox-class="myYboxClass" class="yBox">
  Trigger Link
</a>

6. Fetch and display an external page to the modal popup via AJAX requests.

<a href="https://www.google.com" class="yBox yBox_ajax">Click Me</a>

7. Create a gallery lightbox by grouping your images using the data-ybox-group attribute:

<a href="1.jpg" class="yBox" data-ybox-group="group1">
  <img src="1.jpg" alt="" width="200" />
</a>
<a href="2.jpg" class="yBox" data-ybox-group="group1">
  <img src="2.jpg" alt="" width="200" />
</a>
<a href="3.jpg" class="yBox" data-ybox-group="group1">
  <img src="3.jpg" alt="" width="200" />
</a>

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