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.
What I want to do is say "when you hover over the #photoContent div, check what it's EQ number is. If it's the Xth div, then highlight the Yth p in the sidebar"
$('#photoContent div').hover(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 accomplish this, but the concept/functionality is what I'm going for. Thanks for your help!