在页面中引入下面的文件。
1 2 | < link rel = "stylesheet" href = "css/style.css" > < script src = "js/spotlight.bundle.js" ></ script > |
HTML结构
1 2 3 4 5 6 7 8 9 | < a class = "spotlight" href = "gallery/t4.png" > < img src = "gallery/t4.png" alt = "Lorem ipsum dolor sit amet" > </ a > < a class = "spotlight" href = "gallery/t5.png" > < img src = "gallery/t5.png" > </ a > < a class = "spotlight" href = "gallery/t6.png" > < img src = "gallery/t6.png" > </ a > |
也可以不使用a标签。
1 2 3 4 5 | < div class = "spotlight-group" > < div class = "spotlight image" data-src = "gallery/t1.png" style = "background-image:url(gallery/t1.png)" ></ div > < div class = "spotlight image" data-src = "gallery/t2.png" style = "background-image:url(gallery/t2.png)" ></ div > < div class = "spotlight image" data-src = "gallery/t3.png" style = "background-image:url(gallery/t3.png)" ></ div > </ div > |
要对图片进行分组,使用spotlight-group class即可。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | < div class = "spotlight-group" > < a class = "spotlight" href = "dog1.jpg" > < img src = "dog1-thumb.jpg" > </ a > < a class = "spotlight" href = "dog2.jpg" > < img src = "dog2-thumb.jpg" > </ a > < a class = "spotlight" href = "dog3.jpg" > < img src = "dog3-thumb.jpg" > </ a > </ div > < div class = "spotlight-group" > < a class = "spotlight" href = "cat1.jpg" > < img src = "cat1-thumb.jpg" > </ a > < a class = "spotlight" href = "cat2.jpg" > < img src = "cat2-thumb.jpg" > </ a > < a class = "spotlight" href = "cat3.jpg" > < img src = "cat3-thumb.jpg" > </ a > </ div > |
特别申明:
本站所有资源都是由网友投稿发布,或转载各大下载站,请自行检测软件的完整性!
本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!
如有侵权请联系我们删除下架,联系方式:lei1294551502@163.com