움직이는 공지창 .
<html>
<head>
<STYLE>
<!--
#floater {position: absolute;
border-style: ridge;
border-width: 4px;
border-color: #4696C8;
background-color: #DEDEDE;
width: 200px;
height: 75px;
text-align: center;
z-index: 1; }
table.pressed {border-style: inset;
border-width: 1px;
background-color: #EFEFEF;
width: 160px;
height: 45px;
margin-top: 8pt; }
td.mnuMsg {text-align: center;
font-family: Verdana, Arial, Helvetica, Tahoma, MS Sans Serif;
font-weight: bold;
font-size: 8pt;
color: #006699; }
-->
</STYLE>
</head>
<body>
내용을 적어주세요
<SCRIPT LANGUAGE="JavaScript">
// Break any frames not on this page.
if (window != top)
top.location.href = location.href;
var Xpos = 0;
var Ypos = 0;
var Ygravity = 0.9;
var scrollPos = 0;
var oldScrollPos = 0;
function FloatMenu() {
docWidth = document.body.clientWidth; // Update document width
docHeight = document.body.clientHeight; // Update document height
oldScrollPos = scrollPos;
scrollPos = document.body.scrollTop; // Update scrollbar position
Xpos = (docWidth - floater.offsetWidth) - 10;
Yboundary = ((scrollPos + docHeight) - floater.offsetHeight) - 10;
if (floater.offsetTop < Yboundary - 10) // Object is behind boundary
Ypos += 3;
if (floater.offsetTop > Yboundary + 10) // Object is past boundary
Ypos -= 3;
Ypos *= Ygravity; // Slow object down
floater.style.pixelLeft = Xpos;
floater.style.pixelTop += Ypos; // Make object bounce
}
window.setInterval("FloatMenu()", 40);
</SCRIPT>
<div ID="floater">
<TABLE CLASS="pressed">
<TD CLASS="mnuMsg">
움직이는 공지창 <a HREF="htpp://mall4you.co.kr">이동하기</a>
</TD>
</tr>
</TABLE>
</div>
</body>
</html>
----------------------------------------------------------------------
출처: 셀클럽 - http://sellclub.co.kr
다른곳에서 이용할시에는 꼭 출처를 같이 복사이용 바랍니다.
'컴퓨터-유용한팁 > HTML' 카테고리의 다른 글
클릭하면 닫히는 공지창[html] . (0) | 2015.09.05 |
---|---|
체크하면 오늘은 더이상 팝업 윈도우를 띄우지 않기 . (0) | 2015.09.05 |
서서히 새겨지는 글자[Html] . (0) | 2015.09.05 |
문자열 내의 HTML태그를 모두 없애는 방법. (0) | 2015.09.05 |
글자가 바뀌는 버튼. (0) | 2015.09.05 |