Hi all,
first of all, thanks in advance for looking at this piece of jquery. This jquery piece should fold out three pictures only to the right, which is working perfectly. Thing is that because of the hover, it's building up a queue and when you hover over it three times or something like that, it doesn't slide back on mouseleave, but it stays slided out, because of this queue... I was told to add a stop function... So I tried...but it doesn't really work... I'm really an amateur on jquery, so it might be a really easy sollution

This is my jquery:
<script type="text/javascript">
$(document).ready(function(){
$('.slideout').hover(function() {
if ( ! $(this).hasClass('foldedOut') ) {
$(this).animate({
width: "1089px",
}, 1000, '', function() {
$(this).addClass('foldedOut');
updateFoldedOutClickFunctions();
});
}
});
});
function updateFoldedOutClickFunctions () {
$('.foldedOut').hover(function() {
if ( $(this).hasClass('foldedOut') ) {
var parentID = $(this).parent().attr('id');
var idx = $('#'+parentID).children('.slideout').index(this);
var size = fibonacciGetSize( idx );
$(this).removeClass('foldedOut');
$(this).animate({
width: size+"px",
}, 3000 );
.next().stop(true, true).foldedOut();
}
});
}
var fibonacciSizeValues = new Array(144,233);
function fibonacciGetSize ( num ) {
return fibonacciSizeValues[num];
}
</script>