I usually manage to make (this) work in JQuery, but in this specific case it simply doesn't work.
I've got a list of articles, with each article having a div with photos. But in case an article has many photos that can't fit in the div's regular height (430px), the div that holds the photos inside an article div should have overflow scroll. The css manipulation to make overflow scroll is delayed with setTimeout. However, if I don't use the this selector, all articles get overflow scroll when I only hover one of them. To give this effect only to the specific div that I hover I have to use the this selector, but when I do that, nothing happens.
Here's my code:
$(document).ready(function() {
$(".scrapPhotosThree").mouseover(function() {
setTimeout(function () {
$(this).css( "overflow", "scroll" );
}, 1000);
});
$(".scrapPhotosThree").mouseout(function() {
setTimeout(function () {
$(this).css( "overflow", "hidden" );
}, 1000);
});
});
When I replace $(this).css... with $(".scrapPhotosThree").css..., the effect appears that all articles change when I only hover one.
Who knows how I can fix this?