I may have a dumb question but I just can't figure it out:
I've got 3 columns, and I want to change the background of their parent when I hover over each of them with different background.
I am using this code:
$('#first-col').hover(function(){
$(this).parent().parent().toggleClass('first-pic');
})
$('#second-col').hover(function(){
$(this).parent().parent().toggleClass('second-pic');
})
$('#third-col').hover(function(){
$(this).parent().parent().toggleClass('third-pic');
})
And it works great! Now the question part: Is there any way to make it change smoother?
I tried applying
transition: background 0.5s linear
to the parent but it doesn't do anything. Is there any other way of doing something about it?