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