Created
July 18, 2016 14:42
-
-
Save Avanger2512/4eb301ee26e21200ff020a9b75432efc to your computer and use it in GitHub Desktop.
Revisions
-
Avanger2512 renamed this gist
Jul 18, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Avanger2512 created this gist
Jul 18, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ //popup $('.js-popup__close').on('click', function(){ $('.popup').hide() $('.js-popup').slick('unslick') }) $('.js-gallery__item').on('click', function(){ var el = $(this); $('.popup').show(); getContent(el); }) function getContent(el) { if (el.data('gallery') == 1){ var $content = $('.js-world-luxary_first').find('.js-gallery__item').clone(); showContentInPopup($content, el.data('num')); } else if (el.data('gallery') == 2){ var $content = $('.js-world-luxary_second').find('.js-gallery__item').clone(); showContentInPopup($content, el.data('num')); console.log($content); } } function showContentInPopup($content, num){ $('.js-popup').html($content); $('.js-popup').find('div').removeAttr('class'); $('.js-popup').find('div').addClass('popup__item'); $('.js-popup').slick({ infinite: false, slidesToShow: 1, slidesToScroll: 1, nextArrow: $('.popup__next'), prevArrow: $('.popup__prev'), arrows: true, initialSlide: num }); }