-
Notifications
You must be signed in to change notification settings - Fork 186
Open
Description
Is it possible to set the targetheight new after resize of the window?
I try this.
// All images need to be loaded for this plugin to work so
// we end up waiting for the whole window to load in this example
$(window).load(function () {
$(document).ready(function(){
collage();
});
});
var size = "150"
// Here we apply the actual CollagePlus plugin
function checkWidth() {
var windowSize = $(window).width();
if (windowSize < 480) {
var size = "120";
}
else if (windowSize < 720) {
var size = "120";
}
else if (windowSize < 1160 ) {
var size = "120";
}
else {
var size = "150";
}
console.log(size);
};
// Execute on load
checkWidth();
// Bind event listener
$(window).resize(checkWidth);
$(window).resize(collage);
function collage() {
$('.Collage').removeWhitespace().collagePlus(
{
'fadeSpeed' : 'fast',
'targetHeight' : size,
'direction' : 'vertical'
}
);
};
Metadata
Metadata
Assignees
Labels
No labels