메뉴 건너뛰기

전국분동대여

일반 자료실

컴퓨터/IT 눈 내리는 뉴스 박스

GACHIMOA 2020.07.23 16:15 조회 수 : 274

눈 내리는 뉴스 박스

 

<!--3. BODY 부분에 아래의 스크립트를 복사해 넣으세요-->

<STYLE>
body{
overflow-x:hidden;
overflow-y:scroll;
}
</STYLE>
<SCRIPT>
// 메세지를 계속 추가할 수 있습니다
var message=new Array()
message[0]="메리 크리스마스"
message[1]="좀 일찍 하죠?"
message[2]="하지만 뭐.. 올 크리스마스를 위하여"
// 메세지별 하이퍼링크
var messageurl=new Array()
messageurl[0]="http://www.bizs.wo.ro"
messageurl[1]="http://www.bizs.wo.ro"
messageurl[2]="http://www.bizs.wo.ro"
// 링크 타겟
var messagetarget=new Array()
messagetarget[0]="_blank"
messagetarget[1]="_blank"
messagetarget[2]="_blank"
// 메세지 글자 색
var textcolor="orange"
// 메세지 그림자 색
var textshadowcolor="blue"
// speed 1: lower means faster
var pause=20
// speed 2: higher means faster
var step=2
// 글자의 크기
var fntsize=14
// 글자모양
var fntfamily="굴림"
// 글자위 두께 1= 두껍게, 0=보통
var fntweight=0
// 배경색
var backgroundcolor="000000"
// 테두리 두께
var borderwidth=2
// 스크롤러의 윗쪽 여백
var topdistance=220
//**********************************************************************************
var snowani=new Array("snowani0.gif", "snowani1.gif", "snowani2.gif")
var snowani0=new Image()
snowani0.src="snowani0.gif"
var snowani1=new Image()
snowani1.src="snowani1.gif"
var snowani2=new Image()
snowani2.src="snowani2.gif"
var cellpad=10
var scrollerwidth=220
var scrollerheight=30
var shadowsize=1
var scrollerleft
var scrollertop
var screenwidth
var clipleft,clipright,cliptop,clipbottom
var i_message=0
var i_snowani=0
var timer
var textwidth
var textcontent=""
var textshadowcontent=""
var bgcontent=""
if (fntweight==1) {fntweight="bold"}
else {fntweight="normald"}
topdistance=topdistance+cellpad
function doanimation() {
        if (i_snowani>=3) {i_snowani=0}
        if (document.all) {
                bgcontent="<img src="+snowani[i_snowani]+'>"
                bgscroller.innerHTML=bgcontent
        }
        if (document.layers) {
                document.bgscroller.document.snowpic.src="snowani[i_snowani]
        }
        i_snowani++
        var animation_timer=setTimeout("doanimation()",200)
}
function init() {
        doanimation()
        gettextcontent()
        if (document.all) {gettextshadowcontent()}
    if (document.all) {
                screenwidth=document.body.clientWidth
                scrollertop=document.body.scrollTop
                scrollerleft=screenwidth/2-scrollerwidth/2
                text.innerHTML=textcontent
                textshadow.innerHTML=textshadowcontent
                textwidth=text.offsetWidth
                document.all.bgscroller.style.posTop=scrollertop-cellpad+topdistance
        document.all.bgscroller.style.posLeft=scrollerleft-cellpad
                document.all.text.style.posTop=scrollertop+topdistance
        document.all.text.style.posLeft=scrollerleft+scrollerwidth
                document.all.textshadow.style.posTop=scrollertop+shadowsize+topdistance
        document.all.textshadow.style.posLeft=scrollerleft+scrollerwidth+shadowsize
                clipleft=0
                clipright=0
                cliptop=0
                clipbottom=scrollerheight
                document.all.text.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
                document.all.textshadow.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
        scrolltext()
    }
        if (document.layers) {
                screenwidth=window.innerWidth
                scrollertop=pageYOffset
                scrollerleft=screenwidth/2-scrollerwidth/2
                document.text.document.write(textcontent)
                document.text.document.close()
                textwidth=document.text.document.width
                
                document.bgscroller.top=scrollertop-cellpad+topdistance
        document.bgscroller.left=scrollerleft-cellpad
                document.text.top=scrollertop+topdistance
                document.text.left=scrollerleft+scrollerwidth
                
                document.text.clip.left=0
                document.text.clip.right=0
                document.text.clip.top=0
                document.text.clip.bottom=scrollerheight
        scrolltext()
    }
}
function scrolltext() {
    if (document.all) {
                if (document.all.text.style.posLeft>=scrollerleft-textwidth) {
                        document.all.text.style.posLeft-=step
                        document.all.textshadow.style.posLeft=document.all.text.style.posLeft+shadowsize
                        clipright+=step
                        if (clipright>scrollerwidth) {
                                clipleft+=step
                        }
                        scrollertop=document.body.scrollTop
                        document.all.text.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
                        document.all.textshadow.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
                        document.all.bgscroller.style.posTop=scrollertop-cellpad+topdistance
                        document.all.text.style.posTop=scrollertop+topdistance
                        document.all.textshadow.style.posTop=scrollertop+shadowsize+topdistance
                        var timer=setTimeout("scrolltext()",pause)
                }
                else {
                        changetext()
                }
        }
   if (document.layers) {
                if (document.text.left>=scrollerleft-textwidth) {
                        document.text.left-=step
                        document.text.clip.right+=step
                        if (document.text.clip.right>scrollerwidth) {
                                document.text.clip.left+=step
                        }
                        scrollertop=pageYOffset
                        document.bgscroller.top=scrollertop-cellpad+topdistance
                        document.text.top=scrollertop+topdistance
                        var timer=setTimeout("scrolltext()",pause)
                }
                else {
                        changetext()
                }
        }
}
function changetext() {
    i_message++
        if (i_message>message.length-1) {i_message=0}
        gettextcontent()
        if (document.all) {gettextshadowcontent()}
        if (document.all) {
                text.innerHTML=textcontent
                textshadow.innerHTML=textshadowcontent
                textwidth=text.offsetWidth
                
        document.all.text.style.posLeft=scrollerleft+scrollerwidth
                document.all.textshadow.style.posLeft=scrollerleft+scrollerwidth+shadowsize
                clipleft=0
                clipright=0
                document.all.text.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
document.all.textshadow.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
                
        scrolltext()
        }
        if (document.layers) {
                   document.text.document.write(textcontent)
                document.text.document.close()
                textwidth=document.text.document.width
                document.text.left=scrollerleft+scrollerwidth
                document.text.clip.left=0
                document.text.clip.right=0
                
        scrolltext()
        }
}
function gettextcontent() {
        textcontent="<span style='position:relative;font-size:"+fntsize+"pt;font-family:"+fntfamily+";font-weight:"+fntweight+"'>"
        textcontent+="<a href="+messageurl[i_message]+" target="+messagetarget[i_message]+">"
        textcontent+="<nobr><font color="+textcolor+">"+message[i_message]+"</font></nobr></a></span>"
        
}
function gettextshadowcontent() {
        textshadowcontent="<span style='position:relative;font-size:"+fntsize+"pt;font-family:"+fntfamily+";font-weight:"+fntweight+"'>"
        textshadowcontent+="<a href="+messageurl[i_message]+" target="+messagetarget[i_message]+">"
        textshadowcontent+="<nobr><font color="+textshadowcolor+">"+message[i_message]+"</font></nobr></a></span>"
}

window.onresize=init;
window.onload=init;
</script>
<DIV ID="bgscroller" style="position:absolute;"><img name="snowpic" src="snowani0.gif"></DIV>
<DIV ID="textshadow" style="position:absolute;"></DIV>
<DIV ID="text" style="position:absolute;"></DIV>
 

번호 제목 글쓴이
3421 심장 건강에 좋은 습관 8가지 [1] 뉴퐁
3420 잠잘 때 왼쪽으로 자면 생기는 신체 변화 7가지 [2] 뉴퐁
3419 스트레스를 줄이는 놀라운 방법 6가지 [2] 싹쓰리
3418 여성이 팬티에 대해 알아야 할 7가지 [3] 싹쓰리
3417 끓였던 물을 또 끓이면 안 되는 이유 [1] 싹쓰리
3416 "치주염 환자, 코로나 감염 땐 사이토카인 폭풍 가능성 높아" [1] 쌍둥이맘
3415 스마트스토어 상위 노출 꿀팁. 경쟁률 낮은 세부키워드 뽑는 방법 [2] 나혼자번다
3414 열감지 안면인식 출입관리솔루션 400만원짜리를 40만원에(정부지원사업) [1] file 나혼자번다
3413 전자렌지요리 만능 레시피 대공개!! [3] 나혼자번다
3412 식초로 집안을 반짝반짝하게!! 식초 청소법 [4] 쌍둥이맘
3411 마시고 남은 김빠진 맥주 활용법 [2] 쌍둥이맘
3410 계란을 먹은 후 절대 바로 먹으면 안되는 것들 쌍둥이맘
3409 아주 유용한 커피상식 쌍둥이맘
3408 간 건강과 지방간 완화에 아주 효과적인 채소는? [2] 싹쓰리
3407 골다공증 예방과 뼈에 아주 좋은 음식 8가지 싹쓰리
3406 체했을 때, 감기 걸렸을 때, 관절염 통증에는 이것이 최고!! 싹쓰리
3405 장을 편안하게 하면서 소화를 돕는 식품 5가지 [1] 싹쓰리
3404 초보운전자가 반드시 알아야 하는 고속도로 운전매너 5 [1] 싹쓰리
3403 머리카락이나 두피를 상하게 하는 사소한 습관 5 라이믹스
3402 어둡고 칙칙한 피부를 환하게 해주는 필수적인 습관 5 라이믹스
위로