RapidWeaver Media Albums with prettyPhoto

language: Other
license: Other

Code for Snippet:

// add lightbox/prettyPhoto to albums
var sdLightboxAlbums = (function() {
// test if either album is true
if ($('.album-wrapper').length || $('.movie-thumbnail-frame').length) {
// load css (prettyPhoto)
rel: "stylesheet",
type: "text/css",
href: RwGet.pathto('css/jquery.prettyPhoto.css')
// load js (prettyPhoto)
function() {
// once script is loaded
// test if photo album is true
if ($('.album-wrapper').length) {
// get thumbnail links and alter attributes
$('.thumbnail-frame').each(function() {
var thisAnch = $('a', this);
var thisImg = $('a img', this);
var thisCap = $('.thumbnail-caption', this);
'href': thisImg.attr('src').replace(/thumb/i, 'full'),
'rel': 'prettyPhoto[gallery]',
'title': thisCap.text()
} else {
// since photo album is false movie album is true
// get thumbnails links and alter attributes
$('.movie-thumbnail-frame').each(function() {
var thisAnch = $('a', this);
var thisCap = $('.movie-thumbnail-caption', this);
var thisPage = thisAnch.attr('href');
'href': thisPage + '?iframe=true&width=75%&height=75%',
'rel': 'prettyPhoto[iframes]',
'title': thisCap.text()
// apply effects (prettyPhoto)
animation_speed: 'fast',
show_title: false,
theme: 'light_square'
comments powered by Disqus


Source Site:


Tags: prettyPhoto lightbox rapidweaver photo album Movie Album

Link to this snippet:

Download to Code Collector

To use the direct link to your snippet on CodeCollector.net either copy the html from the above section or drag the Download to Code Collector to where you would like to use it.

More Info:

Times Viewed: 1035
Date Added: 2013-08-06 20:38:37
Last Modified: 2013-08-08 10:43:33

Web Analytics