Search code examples
javascriptjqueryprettyphoto

unbind a prettyPhoto element


I have a question about Jquery, it is possible to unbind an element to a script. Example:

$("a[rel^='prettyPhoto']").prettyPhoto();

I want to run something like:

$("a[rel^='prettyPhoto']").unbind('prettyPhoto');

and if I click on the element, the prettyPhoto doesn't work.

I have try this but... it is not working.. :/

it is possible?

thank you


Solution

  • Ok I have find the issues.

    So, in the PrettyPhoto ( or others plugins ) they have some Bind event. So,

    for my issue, the binding is

    click.prettyphoto
    

    so the code fixed code is:

     $("a[rel^='prettyPhoto']").unbind('click.prettyphoto');
    

    :-)

    I hope this will help someone!