Jquery how to test if current hovered div is eq(x)
- by j-man86
Hi all!
I am trying to create a jQuery hover function that will highlight a different section of the page depending on what number EQ (index position number) the div is.
$('#photoContent div').hoverIntent(function () {
if( $(this).filter(':lt(5)') ) {
$('#photoSidebar').find('p:eq(0)').addClass('currentPhoto');
}
if( $(this).filter(':gt(5)') ) {
$('#photoSidebar').find('p:eq(1)').addClass('currentPhoto');
}
}, function () {
$('#photoSidebar').find('p').removeClass('currentPhoto');
});
The above code obviously does not work, but the concept/functionality is what I'm going for. Thanks for your help!