Skip to content

Commit 581b385

Browse files
committed
removing absolute position from fixParent
1 parent 93e5aa0 commit 581b385

File tree

4 files changed

+87
-3
lines changed

4 files changed

+87
-3
lines changed

example/hello-world/positions.html

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Different element positions</title>
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<meta name="description" content="Intro.js - Better introductions for websites and features with a step-by-step guide for your projects.">
8+
<meta name="author" content="Afshin Mehrabani (@afshinmeh) in usabli.ca group">
9+
10+
<!-- styles -->
11+
<link href="../assets/css/bootstrap.min.css" rel="stylesheet">
12+
<link href="../assets/css/demo.css" rel="stylesheet">
13+
14+
<!-- Add IntroJs styles -->
15+
<link href="../../introjs.css" rel="stylesheet">
16+
17+
<link href="../assets/css/bootstrap-responsive.min.css" rel="stylesheet">
18+
19+
<style>
20+
.container-narrow div.masthead{
21+
position: fixed;
22+
width: 700px;
23+
top: 0;
24+
background-color: #fff;
25+
border: 1px solid #E4E4E4;
26+
z-index: 1;
27+
padding: 10px;
28+
border-radius: 2px;
29+
border-top: 0;
30+
}
31+
32+
</style>
33+
</head>
34+
35+
<body>
36+
37+
<div class="container-narrow">
38+
39+
<div class="masthead" data-intro="fixed position">
40+
<ul class="nav nav-pills pull-right" data-step="5" data-intro="Get it, use it." style="margin-bottom: 0;">
41+
<li><a href="https://github.com/usablica/intro.js/tags"><i class='icon-black icon-download-alt'></i> Download</a></li>
42+
<li><a href="https://github.com/usablica/intro.js">Github</a></li>
43+
<li><a href="https://twitter.com/usablica">@usablica</a></li>
44+
</ul>
45+
<h3 class="muted" style="margin: 0;">Intro.js</h3>
46+
</div>
47+
48+
<div class="jumbotron">
49+
<h1 data-step="1" data-intro="This is a tooltip!" style="position: relative;">Different element positions</h1>
50+
<p class="lead" data-step="4" data-intro="Another step.">In this example you see that Intro.js works with all types of <code>position</code>.</p>
51+
<a class="btn btn-large btn-success" href="javascript:void(0);" onclick="javascript:introJs().start();">Show me how</a>
52+
</div>
53+
54+
<hr>
55+
56+
<div class="row-fluid marketing">
57+
<div class="span6" data-step="2" data-intro="Ok, wasn't that fun?" data-position='right' style="position: relative;">
58+
<h4>Position fixed</h4>
59+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis mollis augue a neque cursus ac blandit orci faucibus. Phasellus nec metus purus.</p>
60+
61+
<h4>Section Two</h4>
62+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis mollis augue a neque cursus ac blandit orci faucibus. Phasellus nec metus purus.</p>
63+
64+
<h4>Section Three</h4>
65+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis mollis augue a neque cursus ac blandit orci faucibus. Phasellus nec metus purus.</p>
66+
</div>
67+
68+
<div class="span6" data-step="3" data-intro="More features, more fun." data-position='left'>
69+
<h4>Section Four</h4>
70+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis mollis augue a neque cursus ac blandit orci faucibus. Phasellus nec metus purus.</p>
71+
72+
<h4>Section Five</h4>
73+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis mollis augue a neque cursus ac blandit orci faucibus. Phasellus nec metus purus.</p>
74+
75+
<h4>Section Six</h4>
76+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis mollis augue a neque cursus ac blandit orci faucibus. Phasellus nec metus purus.</p>
77+
78+
</div>
79+
</div>
80+
81+
<hr>
82+
</div>
83+
<script type="text/javascript" src="../../intro.js"></script>
84+
</body>
85+
</html>

intro.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@
10601060
while (parentElm != null) {
10611061
if (!parentElm.tagName || parentElm.tagName.toLowerCase() === 'body') break;
10621062

1063-
//fix The Stacking Contenxt problem.
1063+
//fix The Stacking Context problem.
10641064
//More detail: https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Understanding_z_index/The_stacking_context
10651065
var zIndex = _getPropValue(parentElm, 'z-index');
10661066
var opacity = parseFloat(_getPropValue(parentElm, 'opacity'));

introjs.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
.introjs-fixParent {
2424
z-index: auto !important;
2525
opacity: 1.0 !important;
26-
position: absolute !important;
2726
-webkit-transform: none !important;
2827
-moz-transform: none !important;
2928
-ms-transform: none !important;

0 commit comments

Comments
 (0)