touch topbox - Free Download Full-featured Touch-enabled Lightbox Plugin - TopBox

Free Download Full-featured Touch-enabled Lightbox Plugin – TopBox

Posted on

This time I will share jQuery Plugin and tutorial about Full-featured Touch-enabled Lightbox Plugin – TopBox, hope it will help you in programming stack.

touch topbox - Free Download Full-featured Touch-enabled Lightbox Plugin - TopBox
File Size: 7.95 MB
Views Total: 2854
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

TopBox is the upgraded version of the Nivo Lightbox plugin that provides a full-featured lightbox solution for modern web & mobile design.

Key features:

  • Fully responsive and retina-ready.
  • Supports touch swipe events.
  • Supports Youtube & Vimeo videos.
  • Supports iframe content.
  • Supports more file formats: PDF, SVG, GIF, WebP image, etc…
  • Auto exacts captions from title attribute.
  • Keyboard navigation.
  • Content loading indicator.
  • 7 extra skins.
  • 6 smooth transition effects.
  • Gallery lightbox mode.
  • And much more.

Basic usage:

1. Load the jQuery TopBox plugin along with the latest jQuery library.

1 <link rel="stylesheet" href="/path/to/topbox.css">
2 <script src="/path/to/cdn/jquery.min.js"></script>
3 <script src="/path/to/topbox.js"></script>

2. Load a skin CSS of your choice in the document.

1 <link rel="stylesheet" href="/skins/blue_hue/styles.css">
2 <link rel="stylesheet" href="/skins/galaxy/styles.css">
3 <link rel="stylesheet" href="/skins/impact/styles.css">
4 <link rel="stylesheet" href="/skins/intense_kiss/styles.css">
5 <link rel="stylesheet" href="/skins/monospace/styles.css">
6 <link rel="stylesheet" href="/skins/real_estate/styles.css">
7 <link rel="stylesheet" href="/skins/whiteout/styles.css">

3. Initialize the lightbox plugin and we’re ready to go.

1 $(function(){
2   $('.lightbox').topbox();
3 });

4. Add the CSS class lightbox to the media links. Done.

01 <a href="1.jpg" class="lightbox" title="Image Caption">Image</a>
02  
03 <a href="1" data-lightbox-hidpi="1@2x.jpg" class="lightbox" title="Retina Image">Retina Image</a>
04  
05 <a href="1.mp3" class="lightbox" title="HTML5 Audio">HTML5 Audio</a>
06 <a href="1.mp4" class="lightbox" title="HTML5 Video">HTML5 Video</a>
07  
08 <a href="1.html" class="lightbox" title="Iframe Contnet" data-lightbox-type="iframe">Iframe Contnet</a>
09  
10 <a href="https://youtu.be/2xX7RrxyRac" class="lightbox" title="YouTube Video">YouTube Video</a>
11 <a href="https://vimeo.com/143418951" class="button lightbox" title="Vimeo Video">Vimeo Video</a>
12  
13 <a href="#inline" class="lightbox" data-lightbox-type="inline" title="Inline Content">Inline HTML Content</a>
14  
15 <div id="inline" style="display: none;">
16   <h3>Inline Content</h3>
17 </div>
18  
19 <a href="ajax.txt" class="lightbox" data-lightbox-type="ajax" title="AJAX Content">AJAX Content</a>

5. Available plugin options.

01 $('.lightbox').topbox({
02  
03   // fade, fadeScale, slideLeft, slideDown, slideUp or fall
04   effect: 'fade',
05  
06   // blurs the background
07   backgroundBlur: false,
08  
09   // skin name
10   skin: 'darkroom',
11  
12   // enable keyboard navigation
13   keyboardNav: true,
14  
15   // closes lightbox by clicking on image
16   clickImgToClose: false,
17  
18   // closes lightbox by clicking on background overlay
19   clickOverlayToClose: true,
20  
21   // close text
22   closeToolTip: 'Close',
23  
24   // previous text
25   previousToolTip: 'Previous',
26  
27   // next text
28   nextToolTip: 'Next',
29  
30   // exacts caption text from title attribute
31   titleSource: 'title',
32    
33   // loading message
34   loadingMessage: 'Loading...',
35  
36   // PDF message
37   pdfMessage: 'View the PDF in a new window:',
38  
39   // PDF button
40   pdfButton: 'Tap Here',
41  
42   // error message
43   errorMessage: 'The requested content cannot be loaded. Please try again later.'
44  
45 });

6. Available callback functions.

01 $('.lightbox').topbox({
02  
03   onInit: function() {},
04   beforeShowLightbox: function() {},
05   afterShowLightbox: function(lightbox) {},
06   beforeHideLightbox: function() {},
07   afterHideLightbox: function() {},
08   beforePrev: function(element) {},
09   onPrev: function(element) {},