Guest User

Untitled

a guest
May 23rd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. /* -- code for image gallery pop-up -- */
  2. $(document).ready(function() {
  3. $('#shopify-section-press img').each(function() {
  4. var currentImage = $(this);
  5. currentImage.wrap("<a class='image-link' title='" + currentImage.attr("title") + "' href='" + currentImage.attr("src") + "'</a>");
  6. });
  7.  
  8. $('.image-link').magnificPopup({
  9. type: 'image',
  10. titleSrc: function(item) {
  11. return item.el.attr('title');
  12. },
  13. gallery: {
  14. enabled: true,
  15. preload: [0,2],
  16. navigateByImgClick: true,
  17. arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
  18. tPrev: 'Previous (Left arrow key)',
  19. tNext: 'Next (Right arrow key)',
  20. tCounter: '<span class="mfp-counter">%curr% of %total%</span>'
  21. },
  22. mainClass: 'mfp-with-zoom',
  23. zoom: {
  24. enabled: true,
  25. duration: 300,
  26. easing: 'ease-in-out',
  27. opener: function(openerElement) {
  28. return openerElement.is('img') ? openerElement : openerElement.find('img');
  29. }
  30. }
  31. });
  32. });
  33. /* - end - */
Add Comment
Please, Sign In to add comment