Basically, I have a division which shows a clickable jpg. (id="cap"). Overlying this is an display:none division which contains a different colored version (id="capB"). My intent is on mouseenter to have $('#capB') show ONCE for several milliseconds as a quick "flash", then condition returns to normal image (id="cap") unless mouse leaves and re-enters.
My problem is that the script functions basically, but $('#capB') continues to flicker if the mouse is in constant motion being dragged across the element. I thought this was 'bounce' and tried inserting a delay, but to no avail. What's going on here and is it possible to squelch chatter so that my alternate jpg blips only once? A quick entry with the mouse and then leaving it held still in one place usually produces at least a double flash. If you look closely, you can see that the cursor oscillates between a pointer and an arrow, so it obviously "thinks" mouseouts have occurred. Can I prevent this? My code follows and you can see the action on my test page at:
http://michaelstorer.com/index2B.htmlMany thanks in advance!!!
Mike
<script type="text/livescript">
$('#cap').bind('mouseenter', function() {
$('#capB').show(8, function() {
$('#capB').hide(120, function() {
$('#cap').stop(false, false, function() {
$('#sound').focus(function() {
// Animation complete.
});
});
});
});
});
</script>
Also, can I string my script together tighter somehow? Sorry, but I'm new to jQuery and javascript in general.