var $ = jQuery.noConflict(); $(document).ready(function(){ if($('.jbmodal').length > 0){ function loadModal(newModal) { theTitle = $('.jbmodal-title'); theImg = $('.jbmodal-img > img'); theCaption = $('.jbmodal-caption'); theHTML = $('.jbmodal-HTML'); thePinit = $('.jbmodal-img > a.pinit'); newTitle = $(newModal).attr('data-jbmodal-title'); newImg = $(newModal).attr('data-jbmodal-img'); newCaption = $(newModal).attr('data-jbmodal-caption'); newHTML = $(newModal).attr('data-jbmodal-HTML'); newPinit = $(newModal).attr('data-jbmodal-pinit'); if(theTitle !== undefined && newTitle !== undefined) { $(theTitle).hide().html(newTitle).fadeIn(); } else { $(theTitle).hide(); } if(theImg !== undefined && newImg !== undefined) { $(theImg).hide().attr('src', newImg).fadeIn(); } else { $(theImg).hide(); } if(theCaption !== undefined && newCaption !== undefined) { $(theCaption).hide().html(newCaption).fadeIn(); } else { $(theCaption).hide(); } if(theHTML !== undefined && newHTML !== undefined) { $(theHTML).hide().html(newHTML).fadeIn(); } else { $(theHTML).hide(); } if(thePinit !== undefined && newPinit !== undefined) { $(thePinit).hide().attr('href', newPinit).fadeIn(); } else { $(thePinit).hide(); } $(newModal).addClass('jbmodal-trigger'); } $('.jbmodal').click(function(){ $('.jbmodal').removeClass('jbmodal-trigger'); $(this).addClass('jbmodal-trigger'); // setup the modal content jbmodal = '