검색을 해보시면 원하는 답을 찾을수도 있답니다.
팁관련 답변은 누구나 하실 수 있습니다.
0
조회 수 : 1397 신고 : 0
현재 제로보드 XE 를 이용한 페이지를 제작하여 사용하고있습니다.
팝업창이 뜨는 메인페이지는 외부페이지로 등록하여 사용하고 있는관계로
JS 파일을 따로두어 스크립트를 구현하고 있습니다.
문제가되는 부분은 체크박스를 누르면 일정시간동안 팝업이 열리지 않는 팝업창을 구현하고자 하는데
다시보지않기 체크박스에 체크를 하고 팝업을 닫아도 계속 팝업이 뜨고 있습니다.
원도메인 http://enbcorp.cafe24.com 을 www.vocal.co.kr 로 포워딩해서 사용하고 있습니다.
포워딩 사용시 저와 비슷한 문제를 겪고있는 분들이 꽤 계시던데 찾아봐도 마땅히 해결책을 찾지 못하겠습니다.ㅠ
아무래도 쿠키문제인것 같은데 초보인 저로써는 해결할 방법이 보이지 않네요 ;;
코딩한것 같이 얹어봅니다. 고수님들의 조언 부탁드립니다 .
1. JS 파일 내 스크립트
function getCookie(name) {
var Found = false
var start, end
var i = 0
while(i <= document.cookie.length) {
start = i
end = start + name.length
if(document.cookie.substring(start, end) == name) {
Found = true
break
}
i++
}
if(Found == true) {
start = end + 1
end = document.cookie.indexOf(";", start)
if(end < start)
end = document.cookie.length
return document.cookie.substring(start, end)
}
return ""
}
function openPopup()
{
var noticeCookie=getCookie("CookieName1");
if (noticeCookie != "no")
window.open('http://enbcorp.cafe24.com/popup/enb_pop1.html','_blank','window','width=400,height=680,top=50,left=150,scrollbars=no');//
}
openPopup();
function openPopup()
{
var noticeCookie=getCookie("CookieName2");
if (noticeCookie != "no")
window.open('http://enbcorp.cafe24.com/popup/enb_pop2.html','_blank','window','width=400,height=400,top=50,left=669,scrollbars=no');//
}
openPopup();
2. 팝업창 내 코딩
<html>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.style2 {
font-family: "돋움";
font-size: xx-small;
}
-->
</style>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script language="JavaScript">
function setCookie( name, value, expiredays )
{
var todayDate = new Date();
todayDate.setDate( todayDate.getDate() + expiredays );
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
function closeWin() {
{
if ( document.cnjform.notice.checked )
setCookie("CookieName1", "no" , 1);
}
top.close();
}
</script>
</head>
<body>
<table cellspacing="0" cellpadding="0" height= "100%" width="400">
<tr>
<td align="center"><div align="left"><img src="http://enbcorp.cafe24.com/popup/images/enbpop-1.jpg" border="0"></div></td>
</tr>
<tr>
<td align="left" valign="bottom" height=""><div valign="top">
<form name="cnjform" valign="top">
<font color=0156C2><b>
<input type="checkbox" name="notice" onClick="closeWin()">
<span class="style2">오늘 하루 이 창을 띄우지 않습니다.</span></b></font>
</form>
</div></td>
</tr>
</table>
</body>
</html>
(메인페이지 코딩은 외부JS파일을 임포트하는 부분말고는 특별한 점이 없어 기재하지 않습니다.)
추천수 10단위당 메달이 1개씩 노출되고, 추천수에 따라 배경색이 변하며, 일정수의 추천수를 받을시 아이콘이 붙게됩니다.
- 추천수 50개이상
- 추천수 30개이상
- 추천수 20개이상
- 추천수 10개이상
- 추천수 3개이상