Created
June 23, 2011 15:26
-
-
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
This file contains hidden or 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
// 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