Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add highlight class #46

Merged
merged 2 commits into from Feb 14, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions guiders-1.2.0.css
Expand Up @@ -130,3 +130,8 @@
background-position: 0px -84px;
left: -42px;
}

.guider_highlight {
position: relative;
z-index: 101;
}
9 changes: 6 additions & 3 deletions guiders-1.2.0.js
Expand Up @@ -60,7 +60,6 @@ var guiders = (function($) {
guiders._guiders = {};
guiders._lastCreatedGuiderID = null;
guiders._nextButtonTitle = "Next";
guiders._zIndexForHighlight = 101;

guiders._addButtons = function(myGuider) {
// Add buttons
Expand Down Expand Up @@ -190,11 +189,11 @@ var guiders = (function($) {
};

guiders._highlightElement = function(selector) {
$(selector).css({'z-index': guiders._zIndexForHighlight});
$(selector).addClass('guider_highlight');
};

guiders._dehighlightElement = function(selector) {
$(selector).css({'z-index': 1});
$(selector).removeClass('guider_highlight');
};

guiders._hideOverlay = function() {
Expand Down Expand Up @@ -345,6 +344,10 @@ var guiders = (function($) {

guiders.hideAll = function(omitHidingOverlay) {
$(".guider").fadeOut("fast");
var currentGuider = guiders._guiders[guiders._currentGuiderID];
if (currentGuider.highlight) {
guiders._dehighlightElement(currentGuider.highlight);
}
if (typeof omitHidingOverlay !== "undefined" && omitHidingOverlay === true) {
// do nothing for now
} else {
Expand Down