支持手机移动端图片相册大图查看浏览js特效代码,点击图片浏览大图,可以关闭、上/下一张。
基本样式
baguetteBox.run('.baguetteBoxOne');
响应式图片
baguetteBox.run('.baguetteBoxTwo');
<a href="img/2-1.png"
data-at-450="img/thumbs/2-1.png"
data-at-800="img/small/2-1.png"
data-at-1366="img/medium/2-1.png"
data-at-1920="img/big/2-1.png">
<img src="img/thumbs/2-1.png">
</a>
渐显动画
baguetteBox.run('.baguetteBoxThree', {
animation: 'fadeIn',
noScrollbars: true
});
小图像,按钮禁用(使用箭头或滑动手势)
baguetteBox.run('.baguetteBoxFour', {
buttons: false
});
单个图像(默认情况下隐藏的按钮,自定义标题函数)
baguetteBox.run('.baguetteBoxFive', {
captions: function(element) {
return element.getElementsByTagName('img')[0].alt;
}
});