Closed framelita closed 11 years ago
i added the code in case needed.
You should use the latest version of the plugin and the integrated filter feature. See the updated example-filter samples.
(function ($){
$('#tiles').imagesLoaded(function() {
// Prepare layout options.
var options = {
autoResize: false, // This will auto-update the layout when the browser window is resized.
container: $('#right'), // Optional, used for some extra CSS styling
offset: 3, // Optional, the distance between grid items
itemWidth: 253, // Optional, the width of a grid item
};
// Get a reference to your grid items.
var handler = $('#tiles li'),
filters = $('#filters li');
// Call the layout function.
handler.wookmark(options);
$('#tiles a', handler).colorbox({
rel: 'test'
});
/**
* When a filter is clicked, toggle it's active state and refresh.
*/
var onClickFilter = function(event) {
var item = $(event.currentTarget),
activeFilters = [];
if (!item.hasClass('active')) {
filters.removeClass('active');
}
item.toggleClass('active');
// Filter by the currently selected filter
if (item.hasClass('active')) {
activeFilters.push(item.data('filter'));
}
handler.wookmarkInstance.filter(activeFilters);
}
// Capture filter click events.
filters.click(onClickFilter);
});
})(jQuery);
Now the lightbox is not working. I have colorbox applied for another thing on same page, it's still working for that.
One of the list
Do I have to put the anchor inside the list then it will work?
--edit--
It's still not working, even after i put the anchor into list
Yes the links should be inside the li-tags because links should not be wrapping block elements.
The selector for the colorbox call is the problem, use this:
$('a', handler).colorbox({
rel: 'test'
});
In your code the resulting selector would be "#tiles li #tiles a"
I tried that before and it's not working. However, I realised it's because I put the link out side the li tag. After putting it inside and using the one u show, it's working now. Thanks!
I'm using filter and colorbox just like the example page. However, when I choose to close, the lightbox, the whole page will go up to beginning of the images. How do I make the page stays?
return false;