YesYo.com MintState Forums
뒤로    YesYo.com MintState BBS > Tech > Javascript
검색
멤버이름    오토
비밀번호 
 

레이어 공지사항(오늘 하루 그만 보기)

페이지 정보

작성자 MintState 댓글 0건 조회 8,647회 작성일 08-11-10 11:55

본문

레이어 공지사항(오늘 하루 그만 보기)

<SCRIPT language=javascript>
var banner_count = 1;
var cur_banner = 1;
var timeout_id;

function all_banner_clear() {
	var banner_id = "";
	for( var i=1; i<= banner_count; i++) {
		banner_id = 'all_banner_'+ i;
		document.all[banner_id].style.visibility='hidden';
	}
	clearTimeout(timeout_id);
}

function all_banner_change() {
	var next_banner = cur_banner+1;
	var banner_id = "";
	if( next_banner > banner_count ) {
		next_banner = 1;
	}
	banner_id = 'all_banner_'+ cur_banner;
	document.all[banner_id].style.visibility='hidden';
	banner_id = 'all_banner_'+ next_banner;
	document.all[banner_id].style.visibility='visible';
	
	cur_banner = next_banner;
	timeout_id = window.setTimeout("all_banner_change()",4000);
}

function all_banner_open() {
	if (screen.width==800) {
		var w_left = 0;
	} else {
		var w_left = (screen.width)?(screen.width-600)/2:100;
	}
	var banner_id = "";
	for(var i = 1; i<= banner_count; i++ ) {
		banner_id = 'all_banner_' + i;
		document.all[banner_id].style.left=w_left;
	}
	if (getCookie("all_banner_img") == null) {
		document.all['all_banner_1'].style.visibility='visible';
		selectbox_hidden(all_banner_1);
		//timeout_id = window.setTimeout("all_banner_change()",4000);
	} else {
		document.all['all_banner_1'].style.visibility='hidden';
		selectbox_visible();
	}
}

function all_banner_cookie() {
	if (document.all.cookie_check.checked == true) {
		setCookie("all_banner_img", "true", 1);
	}
	document.all['all_banner_1'].style.visibility = "hidden";
	clearTimeout(timeout_id);
}

function getCookie(Name) { 
	var search = Name + "=" 
	if (document.cookie.length > 0) { 
		offset = document.cookie.indexOf(search) 
		if (offset != -1) { 
			offset += search.length 
			End = document.cookie.indexOf(";", offset) 
			if (End == -1) 
			End = document.cookie.length 
			return unescape(document.cookie.substring(offset, End)) 
		} 
	} 
} 

function setCookie(name, value, expiredays) {
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function selectbox_hidden(layer_id) { 
	var ly = eval(layer_id); 

	// 레이어 좌표 
	var ly_left = ly.offsetLeft; 
	var ly_top = ly.offsetTop; 
	var ly_right = ly.offsetLeft + ly.offsetWidth; 
	var ly_bottom = ly.offsetTop + ly.offsetHeight; 

	// 셀렉트박스의 좌표 
	var el; 

	for (i=0; i<document.forms.length; i++) { 
		for (k=0; k<document.forms[i].length; k++) { 
			el = document.forms[i].elements[k]; 
			if (el.type == "select-one") { 
				var el_left = el_top = 0; 
				var obj = el; 
				if (obj.offsetParent) { 
					while (obj.offsetParent) { 
						el_left += obj.offsetLeft; 
						el_top += obj.offsetTop; 
						obj = obj.offsetParent; 
					} 
				} 
				el_left += el.clientLeft; 
				el_top += el.clientTop; 
				el_right = el_left + el.clientWidth; 
				el_bottom = el_top + el.clientHeight; 

				// 좌표를 따져 레이어가 셀렉트 박스를 침범했으면 셀렉트 박스를 hidden 시킴
				if ((ly_right >= el_left && ly_left <= el_right) && (ly_bottom >= el_top && ly_top <= el_bottom)) 
				el.style.visibility = 'hidden'; 
			} 
		} 
	} 
} 

// 감추어진 셀렉트 박스를 모두 보이게 함 
function selectbox_visible() { 
	for (i=0; i<document.forms.length; i++) { 
		for (k=0; k<document.forms[i].length; k++) { 
			el = document.forms[i].elements[k]; 
			if (el.type == "select-one" && el.style.visibility == 'hidden') 
			el.style.visibility = 'visible'; 
		} 
	} 
} 
</SCRIPT>


<DIV id=all_banner_1 style="Z-INDEX: 8; LEFT: 400px; VISIBILITY: hidden; POSITION: absolute; TOP: 278px">
<IFRAME style="Z-INDEX: -1; ; LEFT: expression(this.nextSibling.offsetLeft); ; 
	WIDTH: expression(this.nextSibling.offsetWidth); POSITION: absolute; ; 
	TOP: expression(this.nextSibling.offsetTop); ; HEIGHT: expression(this.nextSibling.offsetHeight)" 
	src="about:blank" frameBorder=0></IFRAME>

<TABLE cellSpacing=0 cellPadding=0 width=400 bgColor=#ffffff border=0>
	<TR>
		<TD align=middle height=10></TD>
	</TR>
	<TR>
		<TD height=5></TD>
	</TR>
	<TR>
		<TD style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px" height=15>
			<TABLE cellSpacing=1 cellPadding=0 width="100%" bgColor=#d0d0d0 border=0>
				<TR>
					<TD>
						<TABLE cellSpacing=5 cellPadding=0 width="100%" bgColor=#e7e7e7 border=0>
							<TR>
								<TD bgColor=#ffffff>
									<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
										<TR>
											<TD height=10></TD>
										</TR>
										<TR>
											<TD align=middle height=10>
												<TABLE cellSpacing=0 cellPadding=0 width="95%" border=0>
													<TR>
														<TD width=10>>></TD>
														<TD style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; FONT-SIZE: 14px; PADDING-BOTTOM: 0px; PADDING-TOP: 2px; LETTER-SPACING: -0.1em">알려드립니다.!!!</TD>
													</TR>
												</TABLE>
											</TD>
										</TR>
										<TR>
											<TD style="PADDING-RIGHT: 15px; PADDING-LEFT: 15px; PADDING-BOTTOM: 0px; PADDING-TOP: 15px" height=10>
												공지사항입니다.공지사항입니다.공지사항입니다.<br />
												공지사항입니다.<br />
												공지사항입니다.<br />
												공지사항입니다.<br />
												공지사항입니다.<br />
												공지사항입니다.<br />
												공지사항입니다.<br />
												공지사항입니다.<br />
												공지사항입니다.<br />
												공지사항입니다.<br />
												공지사항입니다.<br />
												공지사항입니다.<br />
												공지사항입니다.<br />
												공지사항입니다.<br />
												공지사항입니다.<br />
												공지사항입니다.
											</TD>
										</TR>
										<TR>
											<TD height=5></TD>
										</TR>
									</TABLE>
									<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
										<TR>
											<TD width="3%" bgColor=#f7f7f7 height=30></TD>
											<TD width="6%" bgColor=#f7f7f7><INPUT type=checkbox name=cookie_check></TD>
											<TD width="36%" bgColor=#f7f7f7>오늘 하루 그만 보기 </TD>
											<TD style="PADDING-RIGHT: 5px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px" align=right width="55%" bgColor=#f7f7f7>
												<A onfocus=this.blur(); href="javascript:all_banner_cookie();">:: 닫기 ::</A>
											</TD>
										</TR>
									</TABLE>
								</TD>
							</TR>
						</TABLE>
					</TD>
				</TR>
			</TABLE>
		</TD>
	</TR>
	<TR>
		<TD align=middle height=10></TD>
	</TR>
</TABLE>
</DIV>
<SCRIPT>
	all_banner_open();
</SCRIPT>

댓글목록

등록된 댓글이 없습니다.

Total 178건 7 페이지
게시물 검색
모바일 버전으로 보기
CopyRight ©2004 - 2021, YesYo.com MintState. ™