본문 바로가기

javascript

웹상에서 조절하는 다양한 스크립트 효과

// 스크립트

<script language="Javascript">
<!--Hide
// **************************************************************
// *  All Of The Script (Time Function Help From Daniel  *
// *  Moon) Was Made By Jacob Myers. You May Freely *
// *  Use And Modify This As Long As This Box Of Info  *
// *                        Stays The Same!                          *
// *                Creators Home Page Address:                *
// * Http://www.geocities.com/timessquare/alley/5538 *
// *************************************************************
// Please Input Your Name Into The Field Below Labled User Name
var username="Your Name Here"
// This Just Changes The Text If You Do Not Change The username Value From "Your Name Here"
if (username=="Your Name Here") {username="My"} else {username=username+"'s"}
// This Turns Off The Scroller In The Browser Bar If It Equals 0
// This Turns On The Scroller In The Browser Bar If It Equals 1
// This Turns On The Bouncing Text When It Equals 2
// This Turns On The Default Message When It Equale 3
// This Turns On The Bouncing Text + 2 Of Your Own Extra Pieces Of Text When It Equals 4
// This Turns Off The Date And Time If It Equals 5
var windowbarscroll=4
// These Is For Setting Of 4 Above
var extratxt="Jacob's Home Page Is @ Http://www.geocities.com/timessquare/alley/5538/index.html"
var extratxt2="Pretty Neat Huh?"
// This Turns Off The Scroller In The Form If It Equals 0
// This Turns On The Scroller In The Form If It Equals 1
// This Turns Off The Date And Time If It Equals 2
var formscroll=1
// This Is The Form Scroller Text
var usertextforform="Welcome To My Web Page. This Is Only A Test Scroller To See If It Works!"
//This Is The Window Scroller Text
var usertextforwindow="Welcome To My Web Page. This Is Only A Test Scroller To See If It Works!"
// THIS IS A IMPORTANT ONE... This Is The Size Of The Form Box
var size=30
// This is the speed in miliseconds it scrolls at
var speed=50
var id
var setspaces=0
var txtloc=0
var txtloc2=0
var text=""
var text2=""
var loc=0
var loc2=0
var timeshere=1
var direction=1
var txttouse=""
var space=""
var numspaces=0
var txt=""
var spaces=""
while (numspaces<size) {
numspaces=numspaces+1
spaces=spaces+" "
}
txt=spaces+usertextforform
var txt2="                                                                                                                        "+usertextforwindow
function scroller() {
var today=new Date()
var timedate=new Date()
var hour=timedate.getHours()
var minute=timedate.getMinutes()
var second=timedate.getSeconds()
var month=timedate.getMonth()
var day=timedate.getDate()
var year=timedate.getYear()
var monthname
var dayname
if (year<10) {year="0"+year}
year="19"+year
month=month+1
if (month<10) {month="0"+month}
if (day<10) {day="0"+day}
aop=" A.M."
if (hour>=12) {aop=" P.M."}
if (hour==24) {aop=" A.M."}
if (hour==0) {hour=12}
if (hour>12) {hour=hour-12}
if (hour<10) {hour="0"+hour}
if (minute<10) {minute="0"+minute}
if (second<10) {second="0"+second}
if (month==01) {monthname="January"}
if (month==02) {monthname="Febuary"}
if (month==03) {monthname="March"}
if (month==04) {monthname="April"}
if (month==05) {monthname="May"}
if (month==06) {monthname="June"}
if (month==07) {monthname="July"}
if (month==08) {monthname="August"}
if (month==09) {monthname="September"}
if (month==10) {monthname="October"}
if (month==11) {monthname="November"}
if (month==12) {monthname="December"}
theday=timedate.getDay()+1
if (theday==1) {dayname="Sunday"}
if (theday==2) {dayname="Monday"}
if (theday==3) {dayname="Tuesday"}
if (theday==4) {dayname="Wednesday"}
if (theday==5) {dayname="Thursday"}
if (theday==6) {dayname="Friday"}
if (theday==7) {dayname="Saturday"}
var currentdateandtime=spaces+"The Current Time Is: "+hour+":"+minute+":"+second+aop+" The Current Date Is: "+dayname+", "+monthname+" "+day+", "+year+" ("+month+"/"+day+"/"+year+")"
var currentdateandtime2=" The Current Time Is: "+hour+":"+minute+":"+second+aop+" The Current Date Is: "+dayname+", "+monthname+" "+day+", "+year+" ("+month+"/"+day+"/"+year+")"
text=""
text2=""
text=txt+currentdateandtime
text2=txt2+currentdateandtime2
if (formscroll==2) {text=txt}
if (windowbarscroll==5) {text2=txt2}
if (formscroll==0) {
} else {
document.scrollform.scrollfield.value=text.substring(txtloc,txtloc+30)
if (txtloc++==text.length) {txtloc=0}
}
if (windowbarscroll==3) {defaultStatus="Welcome To "+username+" Web Page!"}
if (windowbarscroll==1) {
defaultStatus=text2.substring(txtloc2,txtloc2+120)
if (txtloc2++==text2.length) {txtloc2=0}
}
if (windowbarscroll==5) {
defaultStatus=text2.substring(txtloc2,txtloc2+120)
if (txtloc2++==text2.length) {txtloc2=0}
}
if (windowbarscroll==2)  {
if (direction==1) {
if (timeshere==1) {txttouse="Welcome To "+username+" Web Page"}
if (timeshere==2) {txttouse="The Time Is: "+hour+":"+minute+":"+second+" "+aop}
if (timeshere==3) {txttouse="The Date Is: "+dayname+", "+monthname+" "+day+", "+year}
if (timeshere==4) {txttouse="All This Script Was Made By Jacob Myers"}
if (timeshere==5) {txttouse="Help For Time Routine Was From Daniel Moon"}
space=space+" "
loc=loc+1
defaultStatus=space+txttouse
if (loc==120-txttouse.length) {
direction=0
timeshere=timeshere+1
if (timeshere==6) {timeshere=1}
}
} else {
if (timeshere==1) {txttouse="Welcome To "+username+" Web Page"}
if (timeshere==2) {txttouse="The Time Is: "+hour+":"+minute+":"+second+" "+aop}
if (timeshere==3) {txttouse="The Date Is: "+dayname+", "+monthname+" "+day+", "+year+"("+month+"/"+day+"/"+year+")"}
if (timeshere==4) {txttouse="All This Script Was Made By Jacob Myers"}
if (timeshere==5) {txttouse="Help For Time Routine Was From Daniel Moon"}
space=""
loc=loc-1
loc2=0
while (loc2<loc) {
loc2=loc2+1
space=" "+space
}
defaultStatus=space+txttouse
if (loc==0) {
direction=1
timeshere=timeshere+1
if (timeshere==6) {timeshere=1}
}
}
}
if (windowbarscroll==4)  {
if (direction==1) {
if (timeshere==1) {txttouse="Welcome To "+username+" Web Page"}
if (timeshere==2) {txttouse="The Time Is: "+hour+":"+minute+":"+second+" "+aop}
if (timeshere==3) {txttouse="The Date Is: "+dayname+", "+monthname+" "+day+", "+year}
if (timeshere==4) {txttouse="All This Script Was Made By Jacob Myers"}
if (timeshere==5) {txttouse="Help For Time Routine Was From Daniel Moon"}
if (timeshere==6) {txttouse=extratxt}
if (timeshere==7) {txttouse=extratxt2}
space=space+" "
loc=loc+1
defaultStatus=space+txttouse
if (loc==120-txttouse.length) {
direction=0
timeshere=timeshere+1
if (timeshere==8) {timeshere=1}
}
} else {
if (timeshere==1) {txttouse="Welcome To "+username+" Web Page"}
if (timeshere==2) {txttouse="The Time Is: "+hour+":"+minute+":"+second+" "+aop}
if (timeshere==3) {txttouse="The Date Is: "+dayname+", "+monthname+" "+day+", "+year+"("+month+"/"+day+"/"+year+")"}
if (timeshere==4) {txttouse="All This Script Was Made By Jacob Myers"}
if (timeshere==5) {txttouse="Help For Time Routine Was From Daniel Moon"}
if (timeshere==6) {txttouse=extratxt}
if (timeshere==7) {txttouse=extratxt2}
space=""
loc=loc-1
loc2=0
while (loc2<loc) {
loc2=loc2+1
space=" "+space
}
defaultStatus=space+txttouse
if (loc==0) {
direction=1
timeshere=timeshere+1
if (timeshere==8) {timeshere=1}
}
}
}
id=setTimeout("scroller()",speed)
}
function changestuff() {
usernamechk=document.change.usernm.value
formscrollchk=document.change.number.value
windowbarscrollchk=document.change.number2.value
usertextforformchk=document.change.text.value
usertextforwindowchk=document.change.text2.value
extratxtchk=document.change.text3.value
extratxt2chk=document.change.text4.value
speedchk=document.change.speed.value
var bad=0
if (formscrollchk<0) {
alert("Form Number Is Set To Low. Valid Values Are 0,1, Or 2!")
var bad=1
}
if (formscrollchk>2) {
alert("Form Number Is Set To High. Valid Values Are 0,1, Or 2!")
var bad=1
}
if (windowbarscrollchk<0) {
alert("Window Status Bar Number Is Set To Low. Valid Values Are 0,1,2,3,4, Or 5!")
var bad=1
}
if (windowbarscrollchk>5) {
alert("Window Status Bar Number Is Set To High. Valid Values Are 0,1,2,3,4, Or 5!")
var bad=1
}
if (usertextforformchk=="") {
alert("Text For Form Scroller Must Equal Something!")
var bad=1
}
if (usertextforwindowchk=="") {
alert("Text For Window Status Bar Scroller Must Equal Something!")
var bad=1
}
if (extratxtchk=="") {
alert("Extra Text 1 For Window Status Bar Scroller Must Equal Something!")
var bad=1
}
if (extratxt2chk=="") {
alert("Extra Text 2 For Window Status Bar Scroller Must Equal Something!")
var bad=1
}
if (speedchk<0) {
alert("Speed Can't Be Lower Than 0!")
var bad=1
}
if (usernamechk=="") {
alert("User Name Must Equal Something!")
var bad=1
}
if (bad<1) {
username=document.change.usernm.value
if (username=="Your Name Here") {username="My"} else {username=username+"'s"}
formscroll=document.change.number.value
windowbarscroll=document.change.number2.value
if (formscroll==0) {document.scrollform.scrollfield.value=""}
if (windowbarscroll==0) {defaultStatus=""}
usertextforform=document.change.text.value
usertextforwindow=document.change.text2.value
extratxt=document.change.text3.value
extratxt2=document.change.text4.value
speed=document.change.speed.value
txt=""
txt2=""
spaces=""
numspaces=0
while (numspaces<size) {
numspaces=numspaces+1
spaces=spaces+" "
}
txt=spaces+usertextforform
var txt2="                                                                                                                        "+usertextforwindow
} else {
var bad=0
}
}
//Stop Hideing-->
</script>
</head>
<body onload="scroller()" bgcolor=black text=white>
<center>
<form name="scrollform">
<table border=10><tr align=center><td align=center><input type="text" name="scrollfield" size=30></td></tr></table>
</form>
<form name="change">
<table border=10>
<tr align=center><td align=center>
Change This Number To Affect The Form Scroller:
</td><td align=center>
<input type="text" name="number" value="1">
</td><td align=center>
A 0 turns it off. <br>
A 1 turns it on with your message and the date and time. <br>
A 2 turns it on with your message.
</tr></td>
<tr align=center><td align=center>
This Changes The Text In The Form Scroller:
</td><td align=center>
<input type="text" name="text" value="Welcome To My Web Page. This Is Only A Test Scroller To See If It Works!">
</tr></td>
<tr align=center><td align=center>
Change This Number To Affect The Window Ststus Bar Scroller:
</td><td align=center>
<input type="text" name="number2" value="4">
</td><td align=center>
A 0 turns it off. <br>
A 1 turns it on with your message and the date and time. <br>
A 2 turns it on with just a default bouncer. <br>
A 3 turns on just a Default Message. <br>
A 4 turns on the default bouncer with two of your own messages. <br>
A 5 turns on the normal scroll with your message.
</td></tr>
<tr align=center><td align=center>
This Changes The Text In The Window (your message):
</td><td align=center>
<input type="text" name="text2" value="Welcome To My Web Page. This Is Only A Test Scroller To See If It Works!">
</td></tr>
<tr align=center><td align=center>
This Changes The Text In The Window (Your First Extra Message For Mode 4):
</td><td align=center>
<input type="text" name="text3" value="Jacob's Home Page Is @ Http://www.geocities.com/timessquare/alley/5538/index.html">
</td></tr>
<tr align=center><td align=center>
This Changes The Text In The Window (Your Second Extra Message For Mode 4):
</td><td align=center>
<input type="text" name="text4" value="Pretty Neat Huh?">
</td></tr>
<tr align=center><td align=center>
This Changes The Speed Of The Scroller:
</td><td align=center>
<input type="text" name="speed" value="50">
</td></tr>
<tr align=center><td align=center>
This Is The Name Of The Owner Of The Web Page (YOU):
</td><td align=center>
<input type="text" name="usernm" value="Your Name Goes Here">
</td></tr>
</table>
<br>
<input type="button" value="Change It!" onClick="changestuff()"> <input type="reset" value="Clear It">
</form>
</center>