I’ve got a WP portfolio site using isotope to filter and sort. It works well; however, one thing I want to do is just not working.
When I hover over an image on the portfolio page, I want it to highlight all other images that are in that category. I can do it by adding each category manually using jQuery. The person whose portfolio it will be will be adding a lot more categories and won’t be able to go in and fiddle with the .js file every time he adds something.
I’m sure there’s a way, I just don’t know how to write code. I’ve got this and it works nicely, but I’d rather it be able to work dynamically and not have to define the category specifically.
$('.portfolio_categories-mood-images').bind('hover', function(e){
$('.portfolio_categories-mood-images').each(function(i){
$(this).toggleClass('highlight-all');
}, function() { $(this).removeClass('highlight-all'); }); });
I’m not sure if I’m making sense. I’m still fairly new with jQuery and Javascript, so thanks in advance for your patience.
REDO:
Based on your response regarding what your
<div>
code looks like per image, see if this revision works better. I have notated for clarity: