24/12/18 브라우저 리사이즈 시 팝업 위치 변경

This commit is contained in:
subsub 2024-12-18 14:17:58 +09:00
parent 4594a9fb96
commit 6d8c5080ce

View File

@ -31,10 +31,21 @@ $(document).ready(function (){
</c:forEach> </c:forEach>
// 팝업 위치 조정 // 팝업 위치 조정
let offset = 30;
var bodyWidth = $("body").width(); var bdWidth = $("body").width();
popupSet(bdWidth);
});
$(window).on("resize",function(){
var bdWidth = $("body").width();
popupSet(bdWidth);
})
// 팝업 css 설정
function popupSet(bodyWidth){
let offset = 30;
if(bodyWidth>1199){ if(bodyWidth>1199){
$(".popup").each(function(idx,itm) { $(".popup").each(function(idx,itm) {
$(this).css({ $(this).css({
@ -59,11 +70,7 @@ $(document).ready(function (){
offset += $(this).outerWidth(true)+30; // 다음 팝업의 위치를 현재 팝업의 너비만큼 이동 offset += $(this).outerWidth(true)+30; // 다음 팝업의 위치를 현재 팝업의 너비만큼 이동
}); });
} }
}
});
/* ******************************************************** /* ********************************************************