同位素和漂亮照片
有没有人设法让 PrettyPhoto 与 Isotope 一起工作?
我已经集成了它 - 但是当我使用同位素过滤来查看一组特定的图像时,我仍然在 PrettyPhoto 中获得完整的图像集。
您可以在我的测试网站上看到该页面:http://wordpress.markrichardson.co。 uk/wedding-photography-gallery/
我使用的代码是:
<script type="text/javascript" charset="utf-8">
$(function(){ var $container = $('#wedding');
$checkboxes = $('#filters input'); $checkboxes.change(function(){
var filters = [];
$checkboxes.filter(':checked').each(function(){
filters.push( this.value );
});
filters = filters.join(', ');
$container.isotope({ filter: filters });
});
$container.isotope({
// options
itemSelector : '.photo',
layoutMode : 'fitRows',
sortBy : 'random',
sortAscending : true
});
}); </script> <script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("a[rel^='[wedding_photography]']").prettyPhoto({
slideshow: 5000, /* false OR interval time in ms */
opacity: 0.70,
show_title: false,
allow_resize: false,
default_width: 950,
default_height: 500,
theme: 'light_rounded',
horizontal_padding: 20,
overlay_gallery: false,
social_tools: false,
deeplinking: false
});
});
</script>
Has anyone managed to get prettyPhoto to work along with Isotope?
I have got it integrated - however when I filter using isotope to view a particular set of images, I still get the full set of images in prettyPhoto.
You can see the page on my test site: http://wordpress.markrichardson.co.uk/wedding-photography-gallery/
The code I'm using is:
<script type="text/javascript" charset="utf-8">
$(function(){ var $container = $('#wedding');
$checkboxes = $('#filters input'); $checkboxes.change(function(){
var filters = [];
$checkboxes.filter(':checked').each(function(){
filters.push( this.value );
});
filters = filters.join(', ');
$container.isotope({ filter: filters });
});
$container.isotope({
// options
itemSelector : '.photo',
layoutMode : 'fitRows',
sortBy : 'random',
sortAscending : true
});
}); </script> <script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("a[rel^='[wedding_photography]']").prettyPhoto({
slideshow: 5000, /* false OR interval time in ms */
opacity: 0.70,
show_title: false,
allow_resize: false,
default_width: 950,
default_height: 500,
theme: 'light_rounded',
horizontal_padding: 20,
overlay_gallery: false,
social_tools: false,
deeplinking: false
});
});
</script>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定您是否已经解决了这个问题,但我可以分享我如何通过将同位素与 Shadowbox.js 集成来完成此任务。我一直在寻找与您描述的功能相同的功能,但使用了不同的工具来实现这一点。首先,我从shadowbox网站下载了css和js代码并将它们放在我的文件夹中。然后,我将以下代码添加到 html 文档的 header 元素中:
然后,在 HTML 中,我将其添加到图像中,以使它们出现在 Shadowbox 内。 [niceboxes] 是图库名称,带有此标签的所有图像都会放入同一个图库中:
I'm not sure if you solved this yet, but I can share how I approached this task by integrating isotope with shadowbox.js. I was looking for the same functionality as you described, but used a different tool to get there. First, I downloaded the css and js code from the shadowbox website and put them in my folder. Then I added the following code to the header element of my html document:
Then, in the HTML, I added this to the images to get them to appear inside the shadowbox. [niceboxes] is the gallery name and all images with this tag get put into the same gallery: