Created
May 4, 2012 19:37
-
-
Save jueyang/2597219 to your computer and use it in GitHub Desktop.
How do i make the switcher and the in-text link independent from each other?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MB.layers = function(switcher, m, layers) { | |
$.each(layers, function(i, l) { | |
if (l.el) { | |
$('#' + l.el) | |
.click(function(e) { | |
e.preventDefault(); | |
//('#' + switcher + ' .layer').removeClass('active'); | |
$(this).addClass('active'); | |
MB.refresh(m, l); | |
}); | |
} | |
/* change something here? | |
if (switcher) { | |
$('#' + switcher).append($('<a href="#">' + l.name + '</a>') | |
.attr('id', 'layer-' + i) | |
.addClass('layer') | |
.click(function(e) { | |
e.preventDefault(); | |
$('#' + switcher + ' .layer').removeClass('active'); | |
$(this).addClass('active'); | |
MB.refresh(m, l); | |
}) | |
); | |
}*/ | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment