lavkach3
1$(function () {2$(".image-popup-vertical-fit").magnificPopup({3type: "image",4closeOnContentClick: true,5mainClass: "mfp-img-mobile",6image: {7verticalFit: true,8},9});10
11$(".image-popup-fit-width").magnificPopup({12type: "image",13closeOnContentClick: true,14image: {15verticalFit: false,16},17});18
19$(".image-popup-no-margins").magnificPopup({20type: "image",21closeOnContentClick: true,22closeBtnInside: false,23fixedContentPos: true,24mainClass: "mfp-no-margins mfp-with-zoom", // class to remove default margin from left and right side25image: {26verticalFit: true,27},28zoom: {29enabled: true,30duration: 300, // don't foget to change the duration also in CSS31},32});33
34$(".popup-gallery").magnificPopup({35delegate: "a",36type: "image",37tLoading: "Loading image #%curr%...",38mainClass: "mfp-img-mobile",39gallery: {40enabled: true,41navigateByImgClick: true,42preload: [0, 1], // Will preload 0 - before current, and 1 after the current image43},44image: {45tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',46titleSrc: function (item) {47return item.el.attr("title") + "<small>by Marsel Van Oosten</small>";48},49},50});51
52$(".zoom-gallery").magnificPopup({53delegate: "a",54type: "image",55closeOnContentClick: false,56closeBtnInside: false,57mainClass: "mfp-with-zoom mfp-img-mobile",58image: {59verticalFit: true,60titleSrc: function (item) {61return (62item.el.attr("title") +63' · <a class="image-source-link" href="' +64item.el.attr("data-source") +65'" target="_blank">image source</a>'66);67},68},69gallery: {70enabled: true,71},72zoom: {73enabled: true,74duration: 300, // don't foget to change the duration also in CSS75opener: function (element) {76return element.find("img");77},78},79});80
81$("#image-popups").magnificPopup({82delegate: "a",83type: "image",84removalDelay: 500, //delay removal by X to allow out-animation85callbacks: {86beforeOpen: function () {87// just a hack that adds mfp-anim class to markup88this.st.image.markup = this.st.image.markup.replace(89"mfp-figure",90"mfp-figure mfp-with-anim"91);92this.st.mainClass = this.st.el.attr("data-effect");93},94},95closeOnContentClick: true,96midClick: true, // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source.97});98
99$(".popup-youtube, .popup-vimeo, .popup-gmaps").magnificPopup({100disableOn: 700,101type: "iframe",102mainClass: "mfp-fade",103removalDelay: 160,104preloader: false,105
106fixedContentPos: false,107});108$(".popup-with-form").magnificPopup({109type: "inline",110preloader: false,111focus: "#name",112
113// When elemened is focused, some mobile browsers in some cases zoom in114// It looks not nice, so we disable it:115callbacks: {116beforeOpen: function () {117if ($(window).width() < 700) {118this.st.focus = false;119} else {120this.st.focus = "#name";121}122},123},124});125
126$(".simple-ajax-popup-align-top").magnificPopup({127type: "ajax",128alignTop: true,129overflowY: "scroll", // as we know that popup content is tall we set scroll overflow by default to avoid jump130});131
132$(".simple-ajax-popup").magnificPopup({133type: "ajax",134});135});136