Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Unique Colorbox classes for better theming
$(document).ready(function (){
// element-1 and element-2 are hrefs that trigger any given colorbox
$(".element-1").click(function() {
$('#colorbox').addClass("cb1").removeClass('cb2'); //add a custom class to #colorbox
});
$(".element-2").click(function() {
$('#colorbox').addClass("cb2").removeClass('cb1'); //add a custom class to #colorbox
});
});
/* Then, in CSS, you can fine tune various elements of of your specific Colorboxes.
e.g.
*/
#colorbox.cb1 {
/* custom css here...*/
}
#colorbox.cb2 {
}
#colorbox.cb1 #cboxContent {
}
#colorbox.cb2 #cboxContent {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment