【发布时间】:2017-03-11 01:46:14
【问题描述】:
我尝试将此代码添加到我的页面,但它不起作用?谁能告诉我为什么?
http://www.booclin.ovh/tom/1/test.html
var gallery = $('.photos').gallerify({ margin:10,
mode:{ maxHeight: screen.height * 0.5,
breakPoints:[
{ minWidth: 1170, columns: 4, },
{ minWidth: 970, columns: 3, },
{ minWidth: 750, columns: 2, },
{ maxWidth: 750, columns: 1, }
]},lastRow:'adjust' });
.photos { margin:auto; font-size:0px; }
.photo { position: relative; }
<div class="photos">
<img class="photo" src="http://placehold.it/600x400">
<img class="photo" src="http://placehold.it/600x400">
<img class="photo" src="http://placehold.it/600x400">
<img class="photo" src="http://placehold.it/600x400">
<img class="photo" src="http://placehold.it/600x400">
<img class="photo" src="http://placehold.it/600x320">
<img class="photo" src="http://placehold.it/600x400">
<img class="photo" src="http://placehold.it/600x400">
<img class="photo" src="http://placehold.it/600x900">
<img class="photo" src="http://placehold.it/900x600">
<img class="photo" src="http://placehold.it/600x400">
<img class="photo" src="http://placehold.it/600x280">
<img class="photo" src="http://placehold.it/600x400">
<img class="photo" src="http://placehold.it/600x600">
<img class="photo" src="http://placehold.it/600x400">
<img class="photo" src="http://placehold.it/600x400">
<img class="photo" src="http://placehold.it/600x900">
<img class="photo" src="http://placehold.it/900x600">
<img class="photo" src="http://placehold.it/600x400">
<img class="photo" src="http://placehold.it/600x280">
<img class="photo" src="http://placehold.it/600x400">
<img class="photo" src="http://placehold.it/600x600">
<img class="photo" src="http://placehold.it/600x400">
<img class="photo" src="http://placehold.it/600x400">
<img class="photo" src="http://placehold.it/600x900">
<img class="photo" src="http://placehold.it/900x600">
<img class="photo" src="http://placehold.it/900x600">
</div>
<!-- Scripts -->
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://cdn.rawgit.com/xremix/xGallerify/master/dist/jquery.xgallerify.min.js"></script>
.fancyboxthumbnailsgallerybook0{ max-width: 500px; height:500px; float:left; width: 23%; margin:5px 5px 0px 5px; background-color:#1E1E1E; overflow:hidden; }
@media (max-width: 1260px) { .fancyboxthumbnailsgallerybook0 { width: 30%; } }
@media (max-width: 1024px) { .fancyboxthumbnailsgallerybook0 { width: 47%; } }
@media (max-width: 500px) { .fancyboxthumbnailsgallerybook0 { width: 98%; } }
<div class="right">
<img class="fancyboxthumbnailsgallerybook0" src="http://www.starkasia.com/wp-content/uploads/book4/01.jpg" alt="Book 4"/>
<img class="fancyboxthumbnailsgallerybook0" src="http://www.starkasia.com/wp-content/uploads/book4/02.jpg" alt="Book 4"/>
<img class="fancyboxthumbnailsgallerybook0" src="http://www.starkasia.com/wp-content/uploads/book4/03.jpg" alt="Book 4"/>
<img class="fancyboxthumbnailsgallerybook0" src="http://www.starkasia.com/wp-content/uploads/book4/04.jpg" alt="Book 4"/>
<img class="fancyboxthumbnailsgallerybook0" src="http://www.starkasia.com/wp-content/uploads/book4/02.jpg" alt="Book 4"/>
<img class="fancyboxthumbnailsgallerybook0" src="http://www.starkasia.com/wp-content/uploads/book4/04.jpg" alt="Book 4"/>
<img class="fancyboxthumbnailsgallerybook0" src="http://www.starkasia.com/wp-content/uploads/book4/01.jpg" alt="Book 4"/>
</div>
如何在我的 jsfiddle 中设置口粮。这正是我需要的,但我只有身高有问题。
【问题讨论】:
-
老兄,NSFW请警告!
-
完成,错误见谅
-
对我的问题有什么想法吗?
-
您希望不同尺寸的图片具有相同的高度?
-
看起来不错,请问您有什么问题?
标签: jquery html css image responsive-design