کد برگهای پاییزی در سایت یا وبلاگ
کد برگهای پاییزی در سایت یا وبلاگ :
کد:
<script language="JavaScript1.2">
//Pre-load your image below!
grphcs=new Array(6)
Image0=new Image();
Image0.src=grphcs[0]="http://home.ripway.com/2004-5/117697/1.gif";
Image1=new Image();
Image1.src=grphcs[1]="http://home.ripway.com/2004-5/117697/2.gif"
Image2=new Image();
Image2.src=grphcs[2]="http://home.ripway.com/2004-5/117697/3.gif"
Image3=new Image();
Image3.src=grphcs[3]="http://home.ripway.com/2004-5/117697/4.gif"
Image4=new Image();
Image4.src=grphcs[4]="http://home.ripway.com/2004-5/117697/5.gif"
Image5=new Image();
Image5.src=grphcs[5]="http://home.ripway.com/2004-5/117697/6.gif"
Amount=8; //Smoothness depends on image file size, the smaller the size the more you can use!
Ypos=new Array();
Xpos=new Array();
Speed=new Array();
Step=new Array();
Cstep=new Array();
ns=(document.layers)?1:0;
ns6=(document.getElementById&&!document.all)?1:0;
if (ns){
for (i = 0; i < Amount; i++){
var P=Math.floor(Math.random()*grphcs.length);
rndPic=grphcs[P];
document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0><img src="+rndPic+"></LAYER>");
}
}
else{
document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i = 0; i < Amount; i++){
var P=Math.floor(Math.random()*grphcs.length);
rndPic=grphcs[P];
document.write('<img id="si'+i+'" src="'+rndPic+'" style="position:absolute;top:0px;left:0px">');
}
document.write('</div></div>');
}
WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;
WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;
for (i=0; i < Amount; i++){
Ypos[i] = Math.round(Math.random()*WinHeight);
Xpos[i] = Math.round(Math.random()*WinWidth);
Speed[i]= Math.random()*5+3;
Cstep[i]=0;
Step[i]=Math.random()*0.1+0.05;
}
function fall(){
var WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;
var WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;
var hscrll=(ns||ns6)?window.pageYOffset:document.body.scrollTop;
var wscrll=(ns||ns6)?window.pageXOffset:document.body.scrollLeft;
for (i=0; i < Amount; i++){
sy = Speed[i]*Math.sin(90*Math.PI/180);
sx = Speed[i]*Math.cos(Cstep[i]);
Ypos[i]+=sy;
Xpos[i]+=sx;
if (Ypos[i] > WinHeight){
Ypos[i]=-60;
Xpos[i]=Math.round(Math.random()*WinWidth);
Speed[i]=Math.random()*5+3;
}
if (ns){
document.layers['sn'+i].left=Xpos[i];
document.layers['sn'+i].top=Ypos[i]+hscrll;
}
else if (ns6){
document.getElementById("si"+i).style.left=Math.min(WinWidth,Xpos[i]);
document.getElementById("si"+i).style.top=Ypos[i]+hscrll;
}
else{
eval("document.all.si"+i).style.left=Xpos[i];
eval("document.all.si"+i).style.top=Ypos[i]+hscrll;
}
Cstep[i]+=Step[i];
}
setTimeout('fall()',20);
}
window.onload=fall
//-->
</script>
کد راست کلیک قفل کردن که دو بار کلیک کند کارش تمومه
کد راست کلیک قفل کردن که دو بار کلیک کند کارش تمومه :
کد:
</style>
<SCRIPT language=JavaScript>
document.onmousedown=click
var times=0
var times2=10
function click() {
if ((event.button==2) || (event.button==3)) {
if (times>=1) { bye() }
alert("No right clicking!!!!!! don't do it again..");
times++ } }
function bye() {
alert("I said NO right clicking! click ok to exit LMAO!");
bye() }
</SCRIPT>
تغییر رنگ پس زمینه با قرار گرفتن نشانگر موس بر روی لینکهای مختلف
تغییر رنگ پس زمینه با قرار گرفتن نشانگر موس بر روی لینکهای مختلف :
کد:
<BODY>
<!-- This script and many more are available online free at dlisland.com -->
<! >
<A HREF="" ONMOUSEOVER ="document.bgColor='silver'">T</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='lightslategray'">r</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='azure'">y</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='lightgreen'">m</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='lightblue'">o</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='white'">v</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='lightslategray'">i</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='azure'">n</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='lightgreen'">g</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='lightblue'">y</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='white'">o</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='silver'">u</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='lightslategray'">r</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='azure'">c</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='lightgreen'">u</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='lightblue'">r</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='white'">s</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='lightslategray'">e</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='azure'">r</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='lightgreen'">a</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='lightblue'">r</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='white'">o</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='silver'">u</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='lightslategray'">n</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='azure'">d</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='lightgreen'">o</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='lightblue'">n</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='white'">t</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='lightslategray'">h</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='azure'">i</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='lightgreen'">s</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='lightblue'">t</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='white'">e</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='silver'">x</a>
<A HREF="" ONMOUSEOVER ="document.bgColor='lightslategray'">t</a>
فرستادن اطلاعات مخاطب از طریق ایمیل برای شما
با اين اسكريپت كاربر در يك صفحه اطلاعات خود را وارد ميكند و اين اطلاعات براي شما از طریق ایمیل فرستاده ميشود :
کد:
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function resetform() {
document.forms[0].elements[1]=="";
}
function submitForms() {
if (isEmail() && isFname() && isLname() && isAddress() && isCity() && isState() && isZip())
if (confirm("\n You are about to e-mail your submission. \n\nYES to submit. NO to abort."))
{
alert("\nYour submission will now be sent. \n\n Use the Return Button once the submission is complete to return to my home page.\n\n\n Thank you for joining our mailing list!");
return true;
}
else
{
alert("\n You have chosen to abort the submission.");
return false
}
else
return false;
}
function isEmail() {
if (document.forms[0].elements[1].value == "") {
alert ("\n The E-Mail field is blank. \n\n Please enter your E-Mail address.")
document.forms[0].elements[1].focus();
return false;
}
if (document.forms[0].elements[1].value.indexOf ('@',0) == -1 ||
document.forms[0].elements[1].value.indexOf ('.',0) == -1) {
alert ("\n The E-Mail field requires a \"@\" and a \".\"be used. \n\nPlease re-enter your E-Mail address.")
document.forms[0].elements[1].select();
document.forms[0].elements[1].focus();
return false;
}
return true;
}
function isFname() {
if (document.forms[0].elements[2].value == "")
{
alert ("\n The First Name field is blank. \n\n Please enter your first name.")
document.forms[0].elements[2].focus();
return false;
}
return true;
}
function isLname() {
if (document.forms[0].elements[3].value == "") {
alert ("\n The Last Name field is blank. \n\nPlease enter your last name.")
document.forms[0].elements[3].focus();
return false;
}
return true;
}
function isAddress() {
if (document.forms[0].elements[4].value == "") {
alert ("\n The Address field is blank. \n\nPlease enter your address.")
document.forms[0].elements[4].focus();
return false;
}
return true;
}
function isCity()
{
if (document.forms[0].elements[5].value == "")
{
alert ("\n The City field is blank. \n\nPlease enter your city.")
document.forms[0].elements[5].focus();
return false;
}
return true;
}
function isState() {
if (document.forms[0].elements[6].value == "") {
alert ("\n The state field is blank.\n\nPlease enter your state.")
document.forms[0].elements[6].focus();
return false;
}
return true;
}
function isZip() {
if (document.forms[0].elements[7].value == "") {
alert ("\n The Zip code field is blank. \n\nPlease enter your Zip code.")
document.forms[0].elements[7].focus();
return false;
}
return true;
}
// End -->
</SCRIPT>
<!-- CONTINUE -->
<BODY>
<CENTER>
<FORM enctype="text/plain" name="addform" method='get'
action='mailto:antispammer@earthling.net?subject=TJS - Mailing List' onSubmit="return submitForms()">
<TABLE border=3 width=430 cellpadding=10><TD align="center">
<strong>
<font face="arial" size=+2>Join the Mailing List!</font>
</strong>
</TABLE>
<input type="hidden" name="Form" value="Submit Sub">
<TABLE border=3 cellspacing=0 cellpadding=2 bgcolor="#C0C0C0">
<tr valign=baseline>
<TD>
<font face="arial">Email Address:</font>
</TD>
<TD>
<input type=text name="Email Address" size=35,1 maxlength=80>
</TD>
</tr>
<tr>
<TD>
<font face="arial">First Name:</font>
</TD>
<TD>
<input type=text name="First Name" size=35,1 maxlength=80>
</TD></tr>
<tr>
<TD>
<font face="arial">Last Name:</font>
</TD>
<TD>
<input type=text name="Last Name" size=35,1 maxlength=80>
</TD></tr>
<tr>
<TD>
<font face="arial">Address:</font>
</TD>
<TD>
<input type=text name="Address" size=35,1 maxlength=80>
</TD></tr>
<tr>
<TD>
<font face="arial">City:</font>
</TD>
<TD>
<input type=text name="City" size=35,1 maxlength=80>
</TD></tr>
<tr>
<TD>
<font face="arial">State:</font>
</TD>
<TD>
<input type=text name="State" size=10,1 maxlength=25>
</TD></tr>
<tr>
<TD>
<font face="arial">Zip Code:</font>
</TD>
<TD>
<input type=text name="Zip" size=20,1 maxlength=35>
</TD></tr></TABLE>
<br>
<center>
<input type="submit" value=" Submit ">
<input type="button" value=" Return " onclick="window.location='your-page.html'">
<input type="reset" value="Reset Form" onclick=resetform()>
</FORM>
</CENTER>
تنظیم یک فیلد بر اساس فیلد دیگر
تنظیم یک فیلد بر اساس فیلد دیگر :
کد:
<html>
<head>
<script language="javascript" type="text/javascript">
function SubmitIt(carForm) {
doorOption = -1
if (carForm.DoorCt[doorOption].value == "fourDoor" && carForm.sunroof.checked) {
alert("The sunroof is only available on the two door model")
return false
}
return true
}
function doorSet(sunroofField) {
if (sunroofField.checked) {
for (i=0; i<document.myForm.DoorCt.length; i++) {
if (document.myForm.DoorCt[i].value == "twoDoor") {
document.myForm.DoorCt[i].checked = true
}
}
}
}
</script>
</head>
<body>
<h2>
Car Picker<p>
<form onSubmit="return SubmitIt(this)" action="ok.asp" name="myForm">
Doors:
<br>
<input type="CHECKBOX" name="sunroof" value="YES" onClick="doorSet(this)">Sunroof(two door only)
<br><br>
<input type="radio" value="twoDoor" name="DoorCt">two
<input type="radio" value="fourDoor" name="DoorCt">Four
<br>
<input type="Submit" value="Submit">
</form></h2>
</body>
</html>