Skip to content

Commit

Permalink
Add a small z-index by default
Browse files Browse the repository at this point in the history
  • Loading branch information
roborourke committed Sep 5, 2024
1 parent 615528f commit f3e3b85
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build/lottie-rtl.css
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[data-lottie]{position:relative}[data-lottie].lottie-img-hidden img{visibility:hidden}[data-lottie] canvas{height:auto;inset:0 0 0 0;max-width:100%;position:absolute;width:100%}
[data-lottie]{position:relative}[data-lottie].lottie-img-hidden img{visibility:hidden}[data-lottie] canvas{height:auto;inset:0 0 0 0;max-width:100%;position:absolute;width:100%;z-index:2}
2 changes: 1 addition & 1 deletion build/lottie.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => '38ceffcb2901b74125e7');
<?php return array('dependencies' => array(), 'version' => 'f395b5b0f8626960462c');
2 changes: 1 addition & 1 deletion build/lottie.css
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[data-lottie]{position:relative}[data-lottie].lottie-img-hidden img{visibility:hidden}[data-lottie] canvas{height:auto;inset:0 0 0 0;max-width:100%;position:absolute;width:100%}
[data-lottie]{position:relative}[data-lottie].lottie-img-hidden img{visibility:hidden}[data-lottie] canvas{height:auto;inset:0 0 0 0;max-width:100%;position:absolute;width:100%;z-index:2}
2 changes: 1 addition & 1 deletion build/lottie.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/lottie.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
width: 100%;
height: auto;
max-width: 100%;
z-index: 2; /* Modest z-index by default, but may need to be overridden for other cases. */
}
4 changes: 2 additions & 2 deletions src/lottie.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ document.querySelectorAll( '[data-lottie]' ).forEach( ( lottie ) => {
}

if ( config.trigger === 'hover' ) {
canvas.addEventListener( 'mouseenter', () => {
canvas.addEventListener( 'mouseover', () => {
dotLottie.setMode( 'forward' );
dotLottie.play();
} );
canvas.addEventListener( 'mouseleave', () => {
canvas.addEventListener( 'mouseout', () => {
dotLottie.setMode( 'reverse' );
} );
}
Expand Down

0 comments on commit f3e3b85

Please sign in to comment.