1. $("a[rel^='prettyPhoto']").prettyPhoto(ppArgs);
  2. <?php if($data['lightbox_post_images']): ?>
  3. $('.single-post .post-content a').has('img').prettyPhoto(ppArgs);
  4. <?php endif; ?>
  5. var mediaQuery = 'desk';
  6. if (Modernizr.mq('only screen and (max-width: 600px)') || Modernizr.mq('only screen and (max-height: 520px)')) {
  7. mediaQuery = 'mobile';
  8. $("a[rel^='prettyPhoto']").unbind('click');
  9. <?php if($data['lightbox_post_images']): ?>
  10. $('.single-post .post-content a').has('img').unbind('click');
  11. <?php endif; ?>
  12. }
  13. // Disables prettyPhoto if screen small
  14. $(window).resize(function() {
  15. if ((Modernizr.mq('only screen and (max-width: 600px)') || Modernizr.mq('only screen and (max-height: 520px)')) && mediaQuery == 'desk') {
  16. $("a[rel^='prettyPhoto']").unbind('click.prettyphoto');
  17. <?php if($data['lightbox_post_images']): ?>
  18. $('.single-post .post-content a').has('img').unbind('click.prettyphoto');
  19. <?php endif; ?>
  20. mediaQuery = 'mobile';
  21. } else if (!Modernizr.mq('only screen and (max-width: 600px)') && !Modernizr.mq('only screen and (max-height: 520px)') && mediaQuery == 'mobile') {
  22. $("a[rel^='prettyPhoto']").prettyPhoto(ppArgs);
  23. <?php if($data['lightbox_post_images']): ?>
  24. $('.single-post .post-content a').has('img').prettyPhoto(ppArgs);
  25. <?php endif; ?>
  26. mediaQuery = 'desk';
  27. }
  28. });