Using Events

Using Events

By M.Muzammil | December 31, 2018

You can use a wide range of events to add costume code. Available aventes are listed as under:

  • Locked - Fires when content is locked
  • Unlocked - Fires when content is unlocked
  • Canceled - Fires when locking of content is cancled


// IMPORTANT: put handlers for events before creating the locker        

// - locked

$.pandalocker.hooks.add( 'opanda-lock', function(e, locker, sender){
    alert('The content was locked!');

// - unlocked

$.pandalocker.hooks.add( 'opanda-unlock', function(e, locker, sender){
    alert('The content was unlocked via: ' + sender + "!");

// - canceled
// happens when the user already unlocked content and visits your page again

$.pandalocker.hooks.add( 'opanda-cancel', function(e, locker, sender){
    alert('Locking of content was canceled!');

    locker: { timer: 30, close: true }

Related Posts


I am a web Designer & Graphics Designer. I love to program and design. Sharing knowledge is my passion & Programming is my Hobby. Want Help? Contact Me its free.!

Be The First To Comment