So I added some transitions to a image rollover:
$(document).ready(function(){
$('.project').hover(function(){
$(this).children('.description').stop().slideDown('fast');
}, function(){
$(this).children('.description').stop().slideUp('fast');
});
});
However sometimes the description box only slide halfway down, or even just 1 tenth of the length it should slide… the description box is 300 by 300px, and is supposed to slide into a 300x300px box…
This seems to happen if I hover over the .project very quickly, could the stop() be adding itself to the queue thus stopping things when it shouldn’t?
Try
stop( true, true )if you want the animation to be completed immediately orstop( true, false )if you don’t want to complete the animation, just reverse it. The first true will clear the queue so the animation can start over. I’m not completely sure why it’s going wrong and I apologize for not being able to give a more complete answer but right now I’m not in the position to look it up. You can read more about it here though: http://api.jquery.com/stop/, I’ve found the jQuery API usually pretty useful.