Skip to content

Commit

Permalink
Merge pull request usablica#274 from raahede/hotfix-transform-zindex
Browse files Browse the repository at this point in the history
Fixing z-index issue (when parent elements have css transform applied)
  • Loading branch information
afshinm committed Aug 9, 2014
2 parents 8b03565 + 545b8e8 commit 83c2ba3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion intro.js
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,8 @@
//More detail: https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Understanding_z_index/The_stacking_context
var zIndex = _getPropValue(parentElm, 'z-index');
var opacity = parseFloat(_getPropValue(parentElm, 'opacity'));
if (/[0-9]+/.test(zIndex) || opacity < 1) {
var transform = _getPropValue(parentElm, 'transform') || _getPropValue(parentElm, '-webkit-transform') || _getPropValue(parentElm, '-moz-transform') || _getPropValue(parentElm, '-ms-transform') || _getPropValue(parentElm, '-o-transform');
if (/[0-9]+/.test(zIndex) || opacity < 1 || transform !== 'none') {
parentElm.className += ' introjs-fixParent';
}

Expand Down
5 changes: 5 additions & 0 deletions introjs.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
.introjs-fixParent {
z-index: auto !important;
opacity: 1.0 !important;
-webkit-transform: none !important;
-moz-transform: none !important;
-ms-transform: none !important;
-o-transform: none !important;
transform: none !important;
}

.introjs-showElement,
Expand Down

0 comments on commit 83c2ba3

Please sign in to comment.