I'm using https://github.com/GBKS/Wookmark-jQuery to do some dynamic layout, i'm also attaching a function on window resize:
var $windowWidth = $window.width();
var options = {
itemWidth: 100,
autoResize: true,
container: $('#tiles'),
offset: 5,
outerOffset: 0,
flexibleWidth: '30%'
};
if ($windowWidth >= 768 && $windowWidth <= 1200) {
options.itemsize = 200;
options.offset = 7;
} else if ($windowWidth > 1200) {
options.itemsize = 300;
options.offset = 10;
}
$('#tiles li').woodmark(options); <-- this is fine
but i want to create a function to return the properties:
function getOptions() {
var $windowWidth = $(window).width();
var sizes = {
itemsize: 100,
offset: 5,
autoResize: true,
outerOffset: 0,
flexibleWidth: '30%'
};
if ($windowWidth >= 768 && $windowWidth <= 1200) {
sizes.itemsize = 200;
sizes.offset = 7;
} else if ($windowWidth > 1200) {
sizes.itemsize = 300;
sizes.offset = 10;
}
return sizes;
}
$('#tiles li').wookmark(getOptions); <-- doesn't work
$('#tiles li').wookmark(function() { getOptions }); <-- doesn't work
all the code samples in wookmark are done as a jquery plugin, and normal breakpoint doesn't work in chrome inspector..