图片点击放大满屏切换,可视图5张

1.链接引用

<script type="text/javascript" src="js/jquery.min.js"></script>

<script type="text/javascript" src="src/images-grid.js"></script>

<link rel="stylesheet" href="src/images-grid.css">

2.html代码:

<p>More than five images</p>
<div id="gallery1"></div>

<p>Diff-size images</p>
<div id="gallery2"></div>

3.调用imagesGrid

$('#gallery1').imagesGrid({
images: [
'imgs/1.jpg',
{ src: 'imgs/2.jpg', alt: 'Second image', title: 'Second image' },
'imgs/3.jpg',
{ src: 'imgs/4.jpg', caption: 'Beautiful forest' },
'imgs/5.jpg'


]
});

$('#gallery2').imagesGrid({
images: [
'imgs/diff-size/1.jpg',
'imgs/diff-size/2.jpg',
'imgs/diff-size/3.jpg',
'imgs/diff-size/4.jpg',
'imgs/diff-size/5.jpg'

],
align: true
});

</script>

posted @ 2016-11-01 14:32  MiniDuck  阅读(250)  评论(0编辑  收藏  举报