diff --git a/public/css/main.css b/public/css/main.css index 0fd66da..8455dfa 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -10,6 +10,11 @@ padding: 0; } +.fancybox__caption { + color: #fff; + font-size: 1.1rem; +} + .g-main figure .g-img, .g-main figure .img-wrapper img { -webkit-backface-visibility: hidden; diff --git a/public/js/main.js b/public/js/main.js index 1d0aeda..89e3a4c 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -1,5 +1,4 @@ $(document).ready(function() { - resizeGallery(); $('.gallery-more').css('cursor', 'pointer').on('click', function() { $('.next-item').slideDown('fast'); @@ -47,11 +46,11 @@ $(document).ready(function() { Fancybox.show(gallery, { // Your options go here }); + resizeGallery(); } }); } - function getGalleryList() { $.get('/main/gallery', { 'page': currentPage }, function(result) { if (!result.data.lists.length) { @@ -96,21 +95,3 @@ $(document).ready(function() { getGalleryList(); }) }); - -$(window).on('resize', function() { - resizeGallery(); -}); - -function resizeGallery() { - $('.g-main').each(function() { - if($(this).find('.empty-txt').length > 0 || $(this).find('.grid').length == 0) return; - - var gel = $(this).find('.grid').eq(0); - var gw = parseFloat(gel[0].getBoundingClientRect().width); - var gpl = parseFloat(gel.css('padding-left').replace(/[^0-9]/g,'')); - var gpr = parseFloat(gel.css('padding-right').replace(/[^0-9]/g,'')); - var g_img_height = (gw - (gpl+gpr)) * parseFloat(1); - - $(this).find('.grid .g-img').css('height', g_img_height + 'px'); - }); -}