Skip to content

Commit 545b8e8

Browse files
committed
Fixing issue where elements won't shine through overlay if their parents have transform applied
1 parent 10fab7d commit 545b8e8

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

intro.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@
294294
*/
295295
function _previousStep() {
296296
this._direction = 'backward';
297-
297+
298298
if (this._currentStep === 0) {
299299
return false;
300300
}
@@ -317,7 +317,7 @@
317317
function _exitIntro(targetElement) {
318318
//remove overlay layer from the page
319319
var overlayLayer = targetElement.querySelector('.introjs-overlay');
320-
320+
321321
//return if intro already completed or skipped
322322
if (overlayLayer == null) {
323323
return;
@@ -363,7 +363,7 @@
363363
} else if (document.detachEvent) { //IE
364364
document.detachEvent('onkeydown', this._onKeyDown);
365365
}
366-
366+
367367
//set the step to zero
368368
this._currentStep = undefined;
369369
}
@@ -423,7 +423,7 @@
423423
arrowLayer.className = 'introjs-arrow left';
424424
break;
425425
case 'left':
426-
if (this._options.showStepNumbers == true) {
426+
if (this._options.showStepNumbers == true) {
427427
tooltipLayer.style.top = '15px';
428428
}
429429
tooltipLayer.style.right = (_getOffset(targetElement).width + 20) + 'px';
@@ -712,14 +712,15 @@
712712
while (parentElm != null) {
713713
if (parentElm.tagName.toLowerCase() === 'body') break;
714714

715-
//fix The Stacking Contenxt problem.
715+
//fix The Stacking Contenxt problem.
716716
//More detail: https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Understanding_z_index/The_stacking_context
717717
var zIndex = _getPropValue(parentElm, 'z-index');
718718
var opacity = parseFloat(_getPropValue(parentElm, 'opacity'));
719-
if (/[0-9]+/.test(zIndex) || opacity < 1) {
719+
var transform = _getPropValue(parentElm, 'transform') || _getPropValue(parentElm, '-webkit-transform') || _getPropValue(parentElm, '-moz-transform') || _getPropValue(parentElm, '-ms-transform') || _getPropValue(parentElm, '-o-transform');
720+
if (/[0-9]+/.test(zIndex) || opacity < 1 || transform !== 'none') {
720721
parentElm.className += ' introjs-fixParent';
721722
}
722-
723+
723724
parentElm = parentElm.parentNode;
724725
}
725726

@@ -738,7 +739,7 @@
738739
window.scrollBy(0, bottom + 100); // 70px + 30px padding from edge to look nice
739740
}
740741
}
741-
742+
742743
if (typeof (this._introAfterChangeCallback) !== 'undefined') {
743744
this._introAfterChangeCallback.call(this, targetElement.element);
744745
}

introjs.css

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
.introjs-fixParent {
2323
z-index: auto !important;
2424
opacity: 1.0 !important;
25+
-webkit-transform: none !important;
26+
-moz-transform: none !important;
27+
-ms-transform: none !important;
28+
-o-transform: none !important;
29+
transform: none !important;
2530
}
2631

2732
.introjs-showElement {
@@ -72,7 +77,7 @@
7277
line-height: 20px;
7378
border: 3px solid white;
7479
border-radius: 50%;
75-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3019', endColorstr='#cf0404', GradientType=0); /* IE6-9 */
80+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3019', endColorstr='#cf0404', GradientType=0); /* IE6-9 */
7681
filter: progid:DXImageTransform.Microsoft.Shadow(direction=135, strength=2, color=ff0000); /* IE10 text shadows */
7782
box-shadow: 0 2px 5px rgba(0,0,0,.4);
7883
}
@@ -132,8 +137,8 @@
132137
text-align: right;
133138
}
134139

135-
/*
136-
Buttons style by http://nicolasgallagher.com/lab/css3-github-buttons/
140+
/*
141+
Buttons style by http://nicolasgallagher.com/lab/css3-github-buttons/
137142
Changed by Afshin Mehrabani
138143
*/
139144
.introjs-button {
@@ -170,7 +175,7 @@
170175

171176
.introjs-button:hover {
172177
border-color: #bcbcbc;
173-
text-decoration: none;
178+
text-decoration: none;
174179
box-shadow: 0px 1px 1px #e3e3e3;
175180
}
176181

@@ -252,4 +257,4 @@
252257
width: 0;
253258
left: 50%;
254259
top: 50%;
255-
}
260+
}

0 commit comments

Comments
 (0)