magnific-popup-options.js 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. $(document).ready(function() {
  2. // MagnificPopup
  3. var magnifPopup = function() {
  4. $('.image-popup').magnificPopup({
  5. type: 'image',
  6. removalDelay: 300,
  7. mainClass: 'mfp-with-zoom',
  8. gallery:{
  9. enabled:true
  10. },
  11. zoom: {
  12. enabled: true, // By default it's false, so don't forget to enable it
  13. duration: 300, // duration of the effect, in milliseconds
  14. easing: 'ease-in-out', // CSS transition easing function
  15. // The "opener" function should return the element from which popup will be zoomed in
  16. // and to which popup will be scaled down
  17. // By defailt it looks for an image tag:
  18. opener: function(openerElement) {
  19. // openerElement is the element on which popup was initialized, in this case its <a> tag
  20. // you don't need to add "opener" option if this code matches your needs, it's defailt one.
  21. return openerElement.is('img') ? openerElement : openerElement.find('img');
  22. }
  23. }
  24. });
  25. };
  26. // Call the functions
  27. magnifPopup();
  28. });