Skip to content

Instantly share code, notes, and snippets.

@danny-englander
Created October 31, 2012 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danny-englander/3989332 to your computer and use it in GitHub Desktop.
Save danny-englander/3989332 to your computer and use it in GitHub Desktop.
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