vGrid中的不同图像宽度

时间:2014-01-24 14:48:18

标签: jquery css

我正在使用vGrid,一个类似砖石的插件,来显示我的图像。我试图显示它们,以便随机图像比其他图像更大,我得到了这个答案(Jquery Isotope plugin: Generating random sized images),但它似乎不适用于我的网站?没有明显的变化。

添加的代码:

.frontpageimagehigh {
    height: 420px !important;
    width: 300px !important;}

<script>$('#grid-content .figure:nth-child(2)').find('.mainGallery .image').addClass('frontpageimagehigh');</script>

是否还有其他方法可以随机获取(我目前刚刚开始使用第二张图像)图像与vGrid有不同的尺寸?谢谢!

如果需要,这是my site

1 个答案:

答案 0 :(得分:0)

我想问题出在您的选择器上:

您正在ID为figure的容器中搜索第{02}类的第二个孩子:

grid-content

这很好但是有这个:

#grid-content .figure:nth-child(2)

您正在使用类find('.mainGallery .image') figure元素内搜索,这是不正确的mainGallery与id grid-content相同,那么您在{{1}内找不到该元素将其更改为:

mainGallery

其中figure是包含find('.openLightBox .image') 的{​​{1}}标记。

称之为:

openLightBox