Skip to content

Instantly share code, notes, and snippets.

@adrianrodriguez
Created June 23, 2011 15:26
Show Gist options
  • Save adrianrodriguez/1042756 to your computer and use it in GitHub Desktop.
Save adrianrodriguez/1042756 to your computer and use it in GitHub Desktop.
Trying to add a class to a modal generated by a plugin when clicking an anchor
// I am using a prettyPhoto plugin for a modal
//and I want to add a class to only certain modals by using only anchors with the .lower class as the trigger
// How do I add a class to say... ('.pic_holder') after I have clicked on the trigger
$("a.lower[rel^='prettyPhoto']").prettyPhoto({
default_width: 480,
});
// Found a solution, prettyPhoto had some callback functions. Just learning something new:
$("a.lower[rel^='prettyPhoto']").prettyPhoto({
default_width: 480,
changepicturecallback: function(){
$('.pp_pic_holder').addClass('lower_video');
},
callback: function(){
$('.pp_pic_holder').removeClass('lower_video');
}/* Called everytime an item is shown/changed */
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment