This time I will share jQuery Plugin and tutorial about Creative Image Modal With Blur Background – jQuery ClarityLightbox, hope it will help you in programming stack.
ClarityLightbox is a lightweight jQuery plugin to showcase your images in a responsive modal popup while blurring the overlaid main content using the CSS3 blur filter.
How to use it:
1. The plugin uses the simple-line-icons for the modal icons (OPTIONAL).
2. Load jQuery library (slim build is recommonded) and the jQuery ClarityLightbox plugin’s files in the document.
1 |
< link rel = "stylesheet" href = "dist/clarity-lightbox.min.css" > |
3 |
integrity = "sha256-fNXJFIlca05BIO2Y5zh1xrShK3ME+/lYZ0j+ChxX2DA=" |
4 |
crossorigin = "anonymous" > |
6 |
< script src = "dist/clarity-lightbox.min.js" ></ script > |
3. Add a link with the CSS class of ‘lightbox’ to your images and done.
01 |
< a class = "lightbox" href = "large-1.jpg" > |
02 |
< img src = "thumb-1.jpg" > |
05 |
< a class = "lightbox" href = "large-2.jpg" > |
06 |
< img src = "thumb-2.jpg" > |
09 |
< a class = "lightbox" href = "large-3.jpg" > |
10 |
< img src = "thumb-3.jpg" > |
4. To customize the close icon, override the default modal template in the JavaScript.
1 |
$( 'body' ).append( '<div class="modal">n' + |
2 |
' <div class="modal-content">n' + |
3 |
' <span class="close icon-close"></span>n' + |
4 |
' <img src="" class="modal-image">n' + |
This awesome jQuery plugin is developed by danielverh. For more Advanced Usages, please check the demo page or visit the official website.