0
我在我的網站上使用jQuery Isotope加載圖像牆。我的工作正常,但我想添加一些額外的東西,但我找不到任何東西在他們的網站上做到這一點...jquery isotope在窗口上隨機隨機調整大小
當瀏覽器窗口調整大小時,我希望它窒息,因爲它重新排序圖片。
可以這樣做嗎?
這是我到目前爲止有:
(function($) {
$(document).ready(function() {
var $container = $('#isotope-container');
$container.isotope({
itemSelector: '.isotope-element',
sortBy : 'random' // THIS IS NOT WORKING TO SORT
});
var $optionSets = $('#isotope-options .option-set'),
$optionLinks = $optionSets.find('a');
$optionLinks.click(function(){
var $this = $(this);
// don't proceed if already selected
if ($this.hasClass('selected')) {
return false;
}
var $optionSet = $this.parents('.option-set');
$optionSet.find('.selected').removeClass('selected');
$this.addClass('selected');
var options = {},
key = $optionSet.attr('data-option-key'),
value = $this.attr('data-option-value');
// parse 'false' as false boolean
value = value === 'false' ? false : value;
options[ key ] = value;
if (key === 'layoutMode' && typeof changeLayoutMode === 'function') {
// changes in layout modes need extra logic
changeLayoutMode($this, options)
} else {
// otherwise, apply new options
$container.isotope(options);
}
return false;
});
$('.isotope-element img').each(function(){
var $this = $(this);
setTimeout(function(){
$this.fadeIn(Math.floor(Math.random()*1500));
}, Math.floor(Math.random()*1500));
}
);
});
})(jQuery);
任何幫助,這將是非常讚賞。
感謝 Ç
http://jsfiddle.net/apaul34208/SsFGy/ 3 /看起來像是有效的。 – apaul 2013-04-27 17:45:08
完美,非常感謝! – Cybercampbell 2013-04-28 23:35:50