lightbox0.5—jquery幻灯片插件

第一步:在页面引入插件和JQ库
- <script type="text/javascript" src="js/jquery.js"></script>
- <script type="text/javascript" src="js/jquery.lightbox-0.4.js"></script
第二步:在页面引入相应的css样式文件
- <link rel="stylesheet" type="text/css" href="css/jquery.lightbox-0.4.css" media="screen" />
- <h4>第三步:在要使用灯箱效果的图片上建立如下结构</h4>
- <a href="image1.jpg"><img src="thumb_image1.jpg" width="72" height="72" alt="" /></a>
第四步:初始化插件
- $(function() {
- // Use this example, or...
- $('a[@rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
- // This, or...
- $('#gallery a').lightBox(); // Select all links in object with gallery ID
- // This, or...
- $('a.lightbox').lightBox(); // Select all links with lightbox class
- // This, or...
- $('a').lightBox(); // Select all links in the page
- // ... The possibility are many. Use your creative or choose one in the examples above
- });



[...] lightbox0.5 推荐指数: [...]