main.js 불필요한 코드 삭제

master
barunsoft 2 years ago
parent 86784f8415
commit 6dba7be395

@ -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;

@ -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');
});
}

Loading…
Cancel
Save