Add function inside Quicksand jquery

105 views Asked by At

I'm using quicksand but I'd like to add a hover effect inside the element that is filtered by Quicksand jquery.

(function ($) {
    var $itemsHolder = $('ul.proyectosthumb');
    var $itemsClone = $itemsHolder.clone(); 
    var $filterClass = "";
    $('ul.filter li').click(function(e) {
        e.preventDefault();
        $filterClass = $(this).attr('data-value');
        if ($filterClass == 'all') { 
            var $filters = $itemsClone.find('li'); 
        }
        else { 
            var $filters = $itemsClone.find('li[data-type='+ $filterClass +']'); 
        }
        $itemsHolder.quicksand($filters);
    });
}(jQuery));

Function for hover effect:

$('.thumbnail').hover(
    function(){
        $(this).find('.caption-hover').fadeIn(250); //.fadeIn(250)
    },
    function(){
        $(this).find('.caption-hover').fadeOut(250); //.fadeOut(205)
    }
); 

Any Idea to add this function inside Quicksand?

1

There are 1 answers

0
Manoj Dhiman On

I also had the same issue with quick sand elemnts question here. this worked for me.use this function .this may help .

jQuery(document).on('hover',".thumbnail",function(){

     //code here .
        });

reason behind this is

The .on() method attaches event handlers to the currently selected set of elements in the jQuery object. check full desc