배경 (backGround)
[List][Prev][Next]
이름 물어보고 배경에 깔아주는 자스 [ Preview ]

로딩시 이름 물어보고 배경에 깔아주는 자스

<body onLoad="setValues()">

<script language="javascript">
<!--
/////////////////////////////////////////////
// :*: Happyscript :*: //
// 소스 : http://www.happyscript.net //
// 편집 and 소스 설명 : Magic //
// E-mail : flyingmagic@hanmail.net //
/////////////////////////////////////////////
var your_message="HELLO" // 이름앞에 나타날 문자
var textfont="Verdana" // 글자체
var textsize=36 // 글자크기
var textcolor="0000FF" // 글자색
var textboldness=5
var tempo=40
var stepx=18
var stepy=18
// 물어보는 내용 적는곳
your_message=your_message+" "+prompt("What's your name?", "your name")
var msg=new Array()
var msg=your_message
var message=msg.split("")
var numberofletters=msg.length-1
var x,y
var marginbottom
var marginleft=0
var margintop=0
var marginright
textboldness=textboldness*100
var timer
var xpos=new Array()
var ypos=new Array()

var spancontent=new Array()


for (i=0;i<=numberofletters;i++) {
spancontent[i]="<span style='position:relative;font-family:"+textfont+";font-size:"+textsize+"pt;color:"+textcolor+";font-weight:"+textboldness+"'>"+message[i]+"</span>"
}


function setValues() {
if (document.all) {
marginbottom = document.body.clientHeight-5
marginright = document.body.clientWidth-5
for (i=0;i<=numberofletters;i++) {
xpos[i]=marginright-3
ypos[i]=marginbottom-3
var thisspan = eval("document.all.span"+i)
thisspan.innerHTML=spancontent[i]
var thisspan = eval("document.all.span"+(i)+".style")
thisspan.posLeft=marginright-3
thisspan.posTop=marginbottom-3
thisspan.visibility="visible"
}
moveball()
}

if (document.layers) {
marginbottom = window.innerHeight-10
marginright = window.innerWidth-10
for (i=0;i<=numberofletters;i++) {
xpos[i]=marginright-3
ypos[i]=marginbottom-3
var thisspan=eval("document.span"+i+".document")
thisspan.write(spancontent[i])
thisspan.close()
var thisspan=eval("document.span"+i)
thisspan.left=marginright-3
thisspan.top=marginbottom-3
thisspan.visibility="visible"
}
moveball()
}
}

function randommaker(range) {
rand=Math.floor(range*Math.random())
return rand
}

function moveball() {
if (document.all) {
checkposition()
makesnake()
document.all.span0.style.posTop+=stepy
timer=setTimeout("moveball()",tempo)
}
if (document.layers) {
checkposition()
makesnake()
document.span0.top+=stepy
timer=setTimeout("moveball()",tempo)
}
}

function makesnake() {
for (i=numberofletters; i>=1; i--) {
xpos[i]=xpos[i-1]
ypos[i]=ypos[i-1]
}
if (document.all) {
xpos[0]=document.all.span0.style.posLeft+stepx
ypos[0]=document.all.span0.style.posTop+stepy
for (i=0;i<=numberofletters;i++) {
var thisspan=eval("document.all.span"+(i)+".style")
thisspan.posLeft=xpos[i]
thisspan.posTop=ypos[i]

}
}
if (document.layers) {
xpos[0]=document.span0.left+stepx
ypos[0]=document.span0.top+stepy
for (i=0;i<=numberofletters;i++) {
var thisspan = eval("document.span"+i)
thisspan.left=xpos[i]
thisspan.top=ypos[i]
}
}
}

function checkposition() {
if (document.all) {
if (document.all.span0.style.posLeft>marginright) {
stepx=(stepx+randommaker(2))*-1
document.all.span0.style.posLeft-=1
}
if (document.all.span0.style.posLeft<marginleft) {
stepx=(stepx+randommaker(2))*-1
document.all.span0.style.posLeft+=1
}
if (document.all.span0.style.posTop>marginbottom) {
stepy=(stepy+randommaker(2))*-1
document.all.span0.style.posTop-=1
}
if (document.all.span0.style.posTop<margintop) {
stepy=(stepy+randommaker(2))*-1
document.all.span0.style.posTop+=1
}
}
if (document.layers) {
if (document.span0.left>=marginright) {
stepx=(stepx+randommaker(2))*-1
document.span0.left-=10
}
if (document.span0.left<=marginleft) {
stepx=(stepx+randommaker(2))*-1
document.span0.left+=10
}
if (document.span0.top>=marginbottom) {
stepy=(stepy+randommaker(2))*-1
document.span0.top-=10
}
if (document.span0.top<=margintop) {
stepy=(stepy+randommaker(2))*-1
document.span0.top+=10
}
}
}

//-->
</script>

<script language="javascript">
<!--
// :*: Happyscript :*:
for (i=0;i<=numberofletters;i++) {
document.write("<span id='span"+i+"' style='position:absolute;;visibility:hidden'></span>")
document.close()
}
//-->
</script>
<%//# DataBinder.Eval(Container.DataItem, "album_title") %>
<%//# DataBinder.Eval(Container.DataItem, "contenttype") + " views" %>
link list for hairwigbeautyshop.com ::
Javascript Source List :