HTML5 Add Lightbox plugin tutorials that support desktop, mobile touch phones and tablets

Source: Internet
Author: User

I. Methods of Use
First introduce jquery and Swipebox js files before <body> tags or <script src= "Lib/jquery-2.0.3.js" ></script>
<script src= "Src/js/jquery.swipebox.js" ></script>

Introduce the Swipebox.css file in the <link rel= "stylesheet" href= "Src/css/swipebox.css" >

Second, HTML structure
<a href= "big/image.jpg" class= "Swipebox" title= "My Caption" >

</a>

Third, call the plug-in
<script type= "Text/javascript" >
;(function ($) {
$ ('. Swipebox '). Swipebox ();
}) (JQuery);
</script>

Iv. Advanced Configuration
(1) Gallery
<a rel= "gallery-1" href= "big/image1.jpg" class= "Swipebox" >

</a>
<a rel= "gallery-1" href= "big/image2.jpg" class= "Swipebox" >

</a>

<!--Gallery 2--
<a rel= "gallery-2" href= "big/image3.jpg" class= "Swipebox" >

</a>
<a rel= "gallery-2" href= "big/image4.jpg" class= "Swipebox" >

</a>

(2) Video support
<a class= "Swipebox-video" rel= "Vimeo" href= "http://vimeo.com/29193046" >my videos</a>

(3) Dynamic Call Gallery
$ (' #gallery '). Click (function (e) {
E.preventdefault ();
$.swipebox ([
{href: ' big/image1.jpg ', title: ' My Caption '},
HREF: ' big/image2.jpg ', title: ' My Second Caption '}
] );
} );

(4) Detection status
if ($.swipebox.isopen) {
}

(5) Available parameters
<script type= "Text/javascript" >
;(function ($) {
$ ('. Swipebox '). Swipebox ({
Usecss:true,
Usesvg:true,
initialindexonarray:0,
Hideclosebuttononmobile:false,
hidebarsdelay:3000,
videomaxwidth:1140,
Beforeopen:function () {},
Afteropen:null,
Afterclose:function () {}
Loopatend:false
} );
}) (JQuery);
</script>

Keymob Mobile advertising Platform advertising display form rich, high 99% of the fill rate. The Keymob mobile advertising platform can also help application developers to extend their applications to large target groups. Bring sustainable, stable and lucrative returns to developers.

HTML5 Add Lightbox plugin tutorials that support desktop, mobile touch phones, and tablets

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.