Issue with next arrow causing page reload
  • USING VERSION: 2.5.6

    I love your gallery and I am using, but tweaked the jquery plugin in a couple of spots.

    Firstly there is an issue with the code in method:_checkPosition()

    The unbind for the next arrows does remove the click event, however this allows browsers to go to default behavior for onclick event, where when the href="#" will cause an onload in some browsers. So you need to bind an onclick event that returns false to override default behavior.

    I changed 2 lines of code from:
    $pp_pic_holder.find('a.pp_arrow_next').addClass('disabled').unbind('click'); //line 428
    $pp_pic_holder.find('a.pp_arrow_previous').addClass('disabled').unbind('click'); //line 440

    TO....

    $pp_pic_holder.find('a.pp_arrow_next').addClass('disabled').unbind('click').bind('click',function(){return false;}); //line 428
    $pp_pic_holder.find('a.pp_arrow_previous').addClass('disabled').unbind('click').bind('click',function(){return false;}); //line 440

    Next...you cannot by default run the jquery "prettyPhoto" extension more than 1 time...I load some ajax and wanted the ability to run this after specific areas of the page had loaded. To fix this, just need to comment out line 85.

    //$pp_pic_holder, $ppt, $pp_overlay, //removed because otherwise cannot run multiple scripts

    Truthfully not sure why this makes it all work, but it did. Just tried it as the error I was getting involved the $ppt variable.

    Otherwise great script....thanks a bunch for the great work.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter