prettyPhoto path variable, repeat

jordanrodriguez

So i’ve noticed when trying to customize the social media section of prettyPhoto many users ran into an error that made the {path} variable not work.

In trying ot solve this i ran into a script that sends that variable to the social media section, but you are not capable of repeating it.

I did a simple fix on a project that allows us to use the {path} variable, as many times as we want in the socialmedia option of prettyPhoto.

Check out my alterations to the open source Pretty Photo script.

The code i added looks like this.

if(settings.social_tools){
var regex = new RegExp('{path}', 'g');
jnes_link = settings.social_tools.replace(regex, jnes_media);
jnes_social = jnes_link.replace('{title}', jnes_title); 
$pp_pic_holder.find('.pp_social').html(jnes_social);
//if(jnes_title) alert(jnes_title);
}

Last updated by on .

What Are Your Thoughts?

Your email address will not be published. Required fields are marked *