<!-- 여러줄의 내용을 한줄만 보여주며 자동스크롤 되는 스크립트 -->
<html>
<head>
<script language="JavaScript1.2">
var message= new Array()
// 메뉴를 설정 하세요 [제목|설명|링크주소]
message[0]="Wips|특허|http://search.wips.co.kr"
message[1]="다음|다음|http://www.daum.net"
message[2]="야후|야후|http://kr.yahoo.com"
// 스크롤상자의 높이
var scrollerheight=20
// 제목칸의 넓이
var titlezonewidth=120
// 설명칸의 넓이
var copyzonewidth=440
// 위쪽 여백
var scrollertop=20
// 좌측 여백
var scrollerleft=20
// 테두리 두께
var scrollerborder=0
// 제목칸의 배경색
var titlezonebg="orange"
// 설명 칸의 배경
var copyzonebg="green"
// 스크롤러의 배경색
var scrollbg="f5f5f5"
// 하이퍼링크의 타겟
var targetlink="_blank"
// 제목글자 속성
var font_titleface="굴림"
var font_titlecolor="FFFFFF"
var font_titlesize=2
// 설명문 글자 색
var font_copyface="굴림"
var font_copycolor="FFFFFF"
var font_copysize=2
// 굵은 제목글씨는 1, 보통은 0
var titlebold=1
// 굵은 설명글씨는 1, 보통은 0
var copybold=1
// 제목의 좌우정렬
var titlealign="right"
// 설명문의 좌우정렬
var copyalign="left"
// 메세지간의 시간 간격
var standstill=4000
// 요기까징
var pre_titlebold
var after_titlebold
var pre_copybold
var after_copybold
var cliptop=0
var clipbottom=0
var clipleft=0
var clipright=titlezonewidth+copyzonewidth
var i_message=0
var mes_joined
var mes_split
var contenttext
var contentbg=""
var step=1
var pause=20
if (titlebold==1) {
pre_titlebold="<b>"
after_titlebold="</b>"
}
else if (titlebold==0) {
pre_titlebold=""
after_titlebold=""
}
if (copybold==1) {
pre_copybold="<b>"
after_copybold="</b>"
}
else if (copybold==0) {
pre_copybold=""
after_copybold=""
}
function initiate() {
mes_joined=message[i_message]
mes_split=mes_joined.split("|")
contenttext="<table cellpadding=4 cellspacing=0 border=0>"
contenttext+="<tr valign='top'>"
contenttext+="<td align="+titlealign+" width="+titlezonewidth+" height='"+scrollerheight+"' bgcolor='"+titlezonebg+"'>"
contenttext+="<a href='"+mes_split[2]+"' target='"+targetlink+"'>"
contenttext+="<font face='"+font_titleface+"' color='"+font_titlecolor+"' size='"+font_titlesize+"'>"
contenttext+=pre_titlebold
contenttext+=mes_split[0]
contenttext+=after_titlebold
contenttext+="</font></a></td>"
contenttext+="<td align="+copyalign+" width="+copyzonewidth+" height='"+scrollerheight+"' bgcolor='"+copyzonebg+"'>"
contenttext+="<font face='"+font_copyface+"' color='"+font_copycolor+"' size='"+font_copysize+"'>"
contenttext+=pre_copybold
contenttext+=mes_split[1]
contenttext+=after_copybold
contenttext+="</font></td></tr>"
contenttext+="</table>"
var bg_width=titlezonewidth+copyzonewidth+2*scrollerborder
var bg_height=scrollerheight+2*scrollerborder
contentbg="<table width="+bg_width+" height='"+bg_height+"' cellpadding=0 cellspacing=0 border='"+scrollerborder+"'><tr><td bgcolor='"+scrollbg+"'> </td></tr></table>"
if (document.all) {
scrollertext.innerHTML=contenttext
scrollerbg.innerHTML=contentbg
document.all.scrollertext.style.posTop=scrollertop+scrollerheight
document.all.scrollertext.style.posLeft=scrollerleft
document.all.scrollerbg.style.posTop=scrollertop-scrollerborder
document.all.scrollerbg.style.posLeft=scrollerleft-scrollerborder
document.all.scrollertext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
scrollin()
}
if (document.layers) {
document.scrollertext.document.write(contenttext)
document.scrollertext.document.close()
document.scrollerbg.document.write(contentbg)
document.scrollerbg.document.close()
document.scrollertext.top=scrollertop+scrollerheight
document.scrollertext.left=scrollerleft
document.scrollerbg.top=scrollertop-scrollerborder
document.scrollerbg.left=scrollerleft-scrollerborder
document.scrollertext.clip.left=clipleft
document.scrollertext.clip.right=clipright
document.scrollertext.clip.top=cliptop
document.scrollertext.clip.bottom=clipbottom
scrollin()
}
}
function scrollin(){
if (document.all){
if (document.all.scrollertext.style.posTop>scrollertop) {
clipbottom+=step
document.all.scrollertext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
document.all.scrollertext.style.posTop-=step
var timer=setTimeout("scrollin()",pause)
}
else {
clearTimeout(timer)
var timer=setTimeout("scrollout()",standstill)
}
}
if (document.layers){
if (document.scrollertext.top>scrollertop) {
clipbottom+=step
document.scrollertext.clip.left=clipleft
document.scrollertext.clip.right=clipright
document.scrollertext.clip.top=cliptop
document.scrollertext.clip.bottom=clipbottom
document.scrollertext.top-=step
var timer=setTimeout("scrollin()",pause)
}
else {
clearTimeout(timer)
var timer=setTimeout("scrollout()",standstill)
}
}
}
function scrollout(){
if (document.all){
if (document.all.scrollertext.style.posTop>(scrollertop-scrollerheight)) {
cliptop+=step
document.all.scrollertext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
document.all.scrollertext.style.posTop-=step
var timer=setTimeout("scrollout()",pause)
}
else {
clearTimeout(timer)
changemessage()
}
}
if (document.layers){
if (document.scrollertext.top>(scrollertop-scrollerheight)) {
cliptop+=step
document.scrollertext.clip.left=clipleft
document.scrollertext.clip.right=clipright
document.scrollertext.clip.top=cliptop
document.scrollertext.clip.bottom=clipbottom
document.scrollertext.top-=step
var timer=setTimeout("scrollout()",pause)
}
else {
clearTimeout(timer)
changemessage()
}
}
}
function changemessage(){
i_message++
if (i_message>message.length-1) {i_message=0}
mes_joined=message[i_message]
mes_split=mes_joined.split("|")
cliptop=0
clipbottom=0
contenttext="<table cellpadding=4 cellspacing=0 border=0>"
contenttext+="<tr valign='top'>"
contenttext+="<td align="+titlealign+" width="+titlezonewidth+" height='"+scrollerheight+"' bgcolor='"+titlezonebg+"'>"
contenttext+="<a href='"+mes_split[2]+"' target='"+targetlink+"'>"
contenttext+="<font face='"+font_titleface+"' color='"+font_titlecolor+"' size='"+font_titlesize+"'>"
contenttext+=pre_titlebold
contenttext+=mes_split[0]
contenttext+=after_titlebold
contenttext+="</font></a></td>"
contenttext+="<td align="+copyalign+" width="+copyzonewidth+" height='"+scrollerheight+"' bgcolor='"+copyzonebg+"'>"
contenttext+="<font face='"+font_copyface+"' color='"+font_copycolor+"' size='"+font_copysize+"'>"
contenttext+=pre_copybold
contenttext+=mes_split[1]
contenttext+=after_copybold
contenttext+="</font></td></tr>"
contenttext+="</table>"
if (document.all) {
scrollertext.innerHTML=contenttext
document.all.scrollertext.style.posTop=scrollertop+scrollerheight
document.all.scrollertext.style.posLeft=scrollerleft
document.all.scrollertext.style.clip="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
scrollin()
}
if (document.layers) {
document.scrollertext.document.write(contenttext)
document.scrollertext.document.close()
document.scrollertext.top=scrollertop+scrollerheight
document.scrollertext.left=scrollerleft
document.scrollertext.clip.left=clipleft
document.scrollertext.clip.right=clipright
document.scrollertext.clip.top=cliptop
document.scrollertext.clip.bottom=clipbottom
scrollin()
}
}
</script>
<style>
A {
color:AA0000;
}
A:Hover {
color:FF0000;
}
</style>
<meta name="generator" content="Namo WebEditor">
</head>
<body onLoad="initiate();">
<div id="scrollerbg" style="position:absolute; top:-1000px; z-index:1;"> </div>
<div id="scrollertext" style="position:absolute; top:-1000px; z-index:1;"> </div>
</body>
</html>
'컴퓨터 > 언어,프로그래밍' 카테고리의 다른 글
서버간 데이터 교환 XML-RPC(MetaWeblog) (0) | 2008.10.23 |
---|---|
상태표시줄에 링크표시 감추는 스크립트 (0) | 2008.07.25 |
자바스크립트로 클립보드에 내용저장하기 (0) | 2008.06.21 |
이미지만 저장하는 것 막기 (0) | 2008.06.18 |
레이어 팝업 (0) | 2008.06.18 |