Blame view

js/magnific-popup-options.js 1.25 KB
4569bbd1   liuqimichale   init website
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
  $(document).ready(function() {
    // MagnificPopup
  	var magnifPopup = function() {
  		$('.image-popup').magnificPopup({
  			type: 'image',
  			removalDelay: 300,
  			mainClass: 'mfp-with-zoom',
  			gallery:{
  				enabled:true
  			},
  			zoom: {
  				enabled: true, // By default it's false, so don't forget to enable it
  
  				duration: 300, // duration of the effect, in milliseconds
  				easing: 'ease-in-out', // CSS transition easing function
  
  				// The "opener" function should return the element from which popup will be zoomed in
  				// and to which popup will be scaled down
  				// By defailt it looks for an image tag:
  				opener: function(openerElement) {
  				// openerElement is the element on which popup was initialized, in this case its <a> tag
  				// you don't need to add "opener" option if this code matches your needs, it's defailt one.
  				return openerElement.is('img') ? openerElement : openerElement.find('img');
  				}
  			}
  		});
  	};
  
  	var magnifVideo = function() {
  		$('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({
          disableOn: 700,
          type: 'iframe',
          mainClass: 'mfp-fade',
          removalDelay: 160,
          preloader: false,
  
          fixedContentPos: false
      });
  	};
  
  	
  
  
  	// Call the functions 
  	magnifPopup();
  	magnifVideo();
  
  });