WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] BUG: jQuery mouseover caption incorrectly stacks tweens (4 posts)

  1. Magi182
    Member
    Posted 10 months ago #

    The hover effect for the tiled gallery annoyingly stacks up the tweens. If you mouse over and back several times in quick succession, the current script will execute an animation on the caption for every mouseover/mouseout. A more desireable effect would be to have the animation animate to the current state of the mouse, and if extra tweens are fired, to discard them.

    Current code:

    /**
     * Story
     */
    TiledGallery.prototype.Captions = function() {
    	/* Hide captions */
    	this.caption.hide();
    
    	this.item.hover(
    		function() { $( this ).find( '.tiled-gallery-caption' ).slideDown( 'fast' ); },
    		function() { $( this ).find( '.tiled-gallery-caption' ).slideUp( 'fast' ); }
    	);
    };

    Would work better if stop() was added to kill any active tween before a new tween was executed:

    /**
     * Story
     */
    TiledGallery.prototype.Captions = function() {
    	/* Hide captions */
    	this.caption.hide();
    
    	this.item.hover(
    		function() { $( this ).find( '.tiled-gallery-caption' ).stop(true, true).slideDown( 'fast' ); },
    		function() { $( this ).find( '.tiled-gallery-caption' ).stop(true, true).slideUp( 'fast' ); }
    	);
    };

    http://wordpress.org/plugins/jetpack/

  2. Richard Archambault
    Happiness Engineer
    Plugin Author

    Posted 9 months ago #

    Hi, thanks for the report!

    Would you mind creating a Trac ticket for this issue?

    http://plugins.trac.wordpress.org/newticket?component=jetpack

    You could also have a look at our Contribute page, which has info on submitting your own patches too, if you're interested:

    http://jetpack.me/contribute/

    If you don't want to file a ticket let me know and I'll take care of it.

  3. Magi182
    Member
    Posted 9 months ago #

    Trac filed. Thanks for the pointers.

  4. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 9 months ago #

    For reference, the Trac ticket can be found here:
    http://plugins.trac.wordpress.org/ticket/1966

Reply

You must log in to post.

About this Plugin

About this Topic