Skip to content

Commit aae3e28

Browse files
committed
Merge pull request usablica#276 from piascikj/master
Add overlayOpacity option
2 parents 3412270 + aa05cff commit aae3e28

File tree

3 files changed

+33
-29
lines changed

3 files changed

+33
-29
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ introJs().onafterchange(function(targetElement) {
332332
- `showButtons`: Show introduction navigation buttons or not, `true` or `false`
333333
- `showBullets`: Show introduction bullets or not, `true` or `false`
334334
- `scrollToElement`: Auto scroll to highlighted element if it's outside of viewport, `true` or `false`
335+
- `overlayOpacity`: Adjust the overlay opacity, `Number`
335336

336337
See [setOption](https://github.com/usablica/intro.js/#introjssetoptionoption-value) to see an example.
337338

intro.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@
5555
/* Show tour bullets? */
5656
showBullets: true,
5757
/* Scroll to highlighted element? */
58-
scrollToElement: true
58+
scrollToElement: true,
59+
/* Set the overlay opacity */
60+
overlayOpacity: .8
5961
};
6062
}
6163

@@ -554,7 +556,7 @@
554556

555557
//show the tooltip
556558
oldtooltipContainer.style.opacity = 1;
557-
oldHelperNumberLayer.style.opacity = 1;
559+
if (oldHelperNumberLayer) oldHelperNumberLayer.style.opacity = 1;
558560
}, 350);
559561

560562
} else {
@@ -848,9 +850,10 @@
848850
};
849851

850852
setTimeout(function() {
851-
styleText += 'opacity: .8;';
853+
styleText += 'opacity: ' + self._options.overlayOpacity.toString() + ';';
852854
overlayLayer.setAttribute('style', styleText);
853855
}, 10);
856+
854857
return true;
855858
}
856859

0 commit comments

Comments
 (0)