Merge pull request #22784 from woocommerce/fix/21959
Trigger zoom if moving cursor over image quickly in product gallery
This commit is contained in:
commit
4e485b75c3
|
@ -44,7 +44,19 @@ jQuery( function( $ ) {
|
|||
} )
|
||||
// Star ratings for comments
|
||||
.on( 'init', '#rating', function() {
|
||||
$( '#rating' ).hide().before( '<p class="stars"><span><a class="star-1" href="#">1</a><a class="star-2" href="#">2</a><a class="star-3" href="#">3</a><a class="star-4" href="#">4</a><a class="star-5" href="#">5</a></span></p>' );
|
||||
$( '#rating' )
|
||||
.hide()
|
||||
.before(
|
||||
'<p class="stars">\
|
||||
<span>\
|
||||
<a class="star-1" href="#">1</a>\
|
||||
<a class="star-2" href="#">2</a>\
|
||||
<a class="star-3" href="#">3</a>\
|
||||
<a class="star-4" href="#">4</a>\
|
||||
<a class="star-5" href="#">5</a>\
|
||||
</span>\
|
||||
</p>'
|
||||
);
|
||||
} )
|
||||
.on( 'click', '#respond p.stars a', function() {
|
||||
var $star = $( this ),
|
||||
|
@ -210,6 +222,12 @@ jQuery( function( $ ) {
|
|||
|
||||
zoomTarget.trigger( 'zoom.destroy' );
|
||||
zoomTarget.zoom( zoom_options );
|
||||
|
||||
setTimeout( function() {
|
||||
if ( zoomTarget.find(':hover').length ) {
|
||||
zoomTarget.trigger( 'mouseover' );
|
||||
}
|
||||
}, 100 );
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue