|
|
@@ -730,53 +730,85 @@
|
|
|
$(".common_search").addClass('active');
|
|
|
});
|
|
|
|
|
|
+ // 띠배너 닫기(쿠키설정)
|
|
|
+ let fnGnbTobBannerClose = function(unexpDays){
|
|
|
+ let chkNoShow = $("#chk-cookie").is(":checked");
|
|
|
+ if(chkNoShow){
|
|
|
+ let todayDate = new Date();
|
|
|
+ todayDate = new Date(parseInt(todayDate.getTime() / 86400000) * 86400000); // 당일 자정처리
|
|
|
+ todayDate.setDate(todayDate.getDate() + unexpDays);
|
|
|
+ document.cookie = "gnbtop_banner=Y; path=/; expires=" + todayDate.toGMTString() + ";";
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// 띠배너 조회
|
|
|
let fnCreateTopBanner = function (){
|
|
|
$.getJSON('/display/gnb/topbanner/list', function (result, status){
|
|
|
if(status=='success'){
|
|
|
if(result.length>0){
|
|
|
+ let bannerYn = "N";
|
|
|
var bannerImgUrl = [[${@environment.getProperty('domain.image')}]];
|
|
|
$.each(result, function (idx, item) {
|
|
|
$('#divTopbanner').html('');
|
|
|
- let tag = '';
|
|
|
- if(item.contentsType == 'OPEN'){
|
|
|
- tag +='<div class="bnrtype_open" style="background-color:#'+item.strVar5+';">';
|
|
|
- tag +=' <a href="'+item.strVar1+'" target="">';
|
|
|
- tag +=' <img src="'+bannerImgUrl+''+item.imgPath1+'" alt="">';
|
|
|
- tag +=' <div class="open_bnr_area">';
|
|
|
- tag +=' <img src="'+bannerImgUrl+''+item.imgPath2+'" alt=""/>';
|
|
|
- tag +=' </div>';
|
|
|
- tag +=' </a>';
|
|
|
- tag +=' <button class="btn_toggle_bnr"><span>열기</span></button>';
|
|
|
- tag +='</div>';
|
|
|
- if(item.strVar8=='Y'){
|
|
|
+ if(document.cookie.match('(^|;)?gnbtop_banner=([^;]*)(;|$)')==null){
|
|
|
+ bannerYn = "Y";
|
|
|
+ let tag = '';
|
|
|
+ if(item.contentsType == 'OPEN'){
|
|
|
+ tag +='<div class="bnrtype_open" style="background-color:#'+item.strVar5+';">';
|
|
|
+ tag +=' <a href="'+item.strVar1+'" target="">';
|
|
|
+ tag +=' <img src="'+bannerImgUrl+''+item.imgPath1+'" alt="">';
|
|
|
+ tag +=' <div class="open_bnr_area">';
|
|
|
+ tag +=' <img src="'+bannerImgUrl+''+item.imgPath2+'" alt=""/>';
|
|
|
+ tag +=' </div>';
|
|
|
+ tag +=' </a>';
|
|
|
+ tag +=' <button class="btn_toggle_bnr"><span>열기</span></button>';
|
|
|
+ tag +='</div>';
|
|
|
+ if(item.strVar8=='Y'){
|
|
|
+ tag+='<div class="close_bnr_area">';
|
|
|
+ tag+=' <form class="form_wrap">';
|
|
|
+ tag+=' <div class="form_field">';
|
|
|
+ tag+=' <input id="chk-cookie" type="checkbox"><label for="chk-cookie"><span>오늘 하루 보지 않기</span></label>';
|
|
|
+ tag+=' </div>';
|
|
|
+ tag+=' </form>';
|
|
|
+ tag+=' <button id="btn_close_bnr" class="btn_close" onclick="fnGnbTobBannerClose(1);"><span>닫기</span></button>';
|
|
|
+ tag+='</div>';
|
|
|
+ }
|
|
|
+ }else if(item.contentsType == 'IMG'){
|
|
|
+ tag+='<div class="bnrtype_img" style="background-color:#'+item.strVar5+';">';
|
|
|
+ tag+=' <a href="'+item.strVar1+'" target="">';
|
|
|
+ tag+=' <img src="'+bannerImgUrl+''+item.imgPath1+'" alt=""/>';
|
|
|
+ tag+=' </a>';
|
|
|
+ tag+='</div>';
|
|
|
tag+='<div class="close_bnr_area">';
|
|
|
tag+=' <form class="form_wrap">';
|
|
|
tag+=' <div class="form_field">';
|
|
|
tag+=' <input id="chk-cookie" type="checkbox"><label for="chk-cookie"><span>오늘 하루 보지 않기</span></label>';
|
|
|
tag+=' </div>';
|
|
|
tag+=' </form>';
|
|
|
- tag+=' <button id="btn_close_bnr" class="btn_close"><span>닫기</span></button>';
|
|
|
+ tag+=' <button id="btn_close_bnr" class="btn_close" onclick="fnGnbTobBannerClose(1);"><span>닫기</span></button>';
|
|
|
+ tag+='</div>';
|
|
|
+ }else{
|
|
|
+ tag+='<div class="bnrtype_text" style="background-color:#fd4801;">';
|
|
|
+ tag+=' <a href="'+item.strVar1+'" target="">';
|
|
|
+ tag+=' <div style="color:#fff; font-size:20px; font-weight:300;">';
|
|
|
+ tag+=' <span style="font-weight:500">'+item.strTitle1+'</span>';
|
|
|
+ tag+=' </div>';
|
|
|
+ tag+=' </a>';
|
|
|
+ tag+='</div>';
|
|
|
+ tag+='<div class="close_bnr_area">';
|
|
|
+ tag+=' <form class="form_wrap">';
|
|
|
+ tag+=' <div class="form_field">';
|
|
|
+ tag+=' <input id="chk-cookie" type="checkbox"><label for="chk-cookie"><span>오늘 하루 보지 않기</span></label>';
|
|
|
+ tag+=' </div>';
|
|
|
+ tag+=' </form>';
|
|
|
+ tag+=' <button id="btn_close_bnr" class="btn_close" onclick="fnGnbTobBannerClose(1);"><span>닫기</span></button>';
|
|
|
tag+='</div>';
|
|
|
}
|
|
|
- }else if(item.contentsType == 'IMG'){
|
|
|
- tag+='<div class="bnrtype_img" style="background-color:#'+item.strVar5+';">';
|
|
|
- tag+=' <a href="'+item.strVar1+'" target="">';
|
|
|
- tag+=' <img src="'+bannerImgUrl+''+item.imgPath1+'" alt=""/>';
|
|
|
- tag+=' </a>';
|
|
|
- tag+='</div>';
|
|
|
- }else{
|
|
|
- tag+='<div class="bnrtype_text" style="background-color:#'+item.strVar5+';">';
|
|
|
- tag+=' <a href="'+item.strVar1+'" target="">';
|
|
|
- tag+=' <div style="color:#'+item.strVar6+'; font-size:20px; font-weight:300;">';
|
|
|
- tag+=' <span style="font-weight:500">'+item.strTitle1+'</span>';
|
|
|
- tag+=' </div>';
|
|
|
- tag+=' </a>';
|
|
|
- tag+='</div>';
|
|
|
- }
|
|
|
|
|
|
- $('#divTopbanner').html(tag);
|
|
|
+ if(bannerYn=="Y"){
|
|
|
+ $('#divTopbanner').html(tag);
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
}
|