Fancybox照片插件示例
<!DOCTYPE html>
<html>
<head>
<title>Fancybox照片插件</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="js/fancybox.umd.js" type="text/javascript"></script>
<link href="css/fancybox.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
body{width: 1200px; margin: 10px auto;}
.photo img{width: 100%;}
</style>
</head>
<body>
<div class="photo">
<a href="img/1_updated.jpg" data-fancybox="gallery" >
<img src="img/1_updated.jpg" alt="图片1">
</a>
<a href="img/2_updated.jpg" data-fancybox="gallery" >
<img src="img/2_updated.jpg" alt="图片2">
</a>
<a href="img/3_updated.jpg" data-fancybox="gallery" >
<img src="img/3_updated.jpg" alt="图片3">
</a>
<a href="img/4_updated.jpg" data-fancybox="gallery" >
<img src="img/4_updated.jpg" alt="图片4">
</a>
</div>
<script>
// (function() { // ① 函数定义
// // 代码...
// })(); // ② 立即调用
(function() {
Fancybox.bind("[data-fancybox]", {
Toolbar: {
display: {
left: ["infobar"],
middle: [
"zoomIn",
"zoomOut",
"toggle1to1",
"rotateCCW",
"rotateCW",
"flipX",
"flipY",
],
right: ["slideshow", "thumbs", "close"],
},
},
});
})();
</script>
</body>
</html>
网站:http://www.shibowl.top
github:https://github.com/hanbinjxnc
博客园:https://www.cnblogs.com/hool
博客:https://blog.shibowl.top
淘宝店:https://boxunwl.taobao.com/
作者:世博 2019年4月28日----
github:https://github.com/hanbinjxnc
博客园:https://www.cnblogs.com/hool
博客:https://blog.shibowl.top
淘宝店:https://boxunwl.taobao.com/
作者:世博 2019年4月28日----
浙公网安备 33010602011771号