هذا الكود لإضافة صورة ثابتة في الخلفية لا تتحرك
<script language="JavaScript1.2">
if (document.all)
document.body.style.cssText="background:white url(question.gif) no-repeat fixed center center"
</script>
هذا الكود لجعل الصفحة تتحرك اتوماتيكيا من الاعلى الى الأسفل
<script language="JavaScript1.2">
//change 1 to another integer to alter the scroll speed. Greater is faster
var speed=1
var currentpos=0,alt=1,curpos1=0,curpos2=-1
function initialize(){
startit()
}
function scrollwindow(){
if (document.all)
temp=document.body.scrollTop
else
temp=window.pageYOffset
if (alt==0)
alt=1
else
alt=0
if (alt==0)
curpos1=temp
else
curpos2=temp
if (curpos1!=curpos2){
if (document.all)
currentpos=document.body.scrollTop+speed
else
currentpos=window.pageYOffset+speed
window.scroll(0,currentpos)
}
else{
currentpos=0
window.scroll(0,currentpos)
}
}
function startit(){
setInterval("scrollwindow()",10)
}
window.onload=initialize
</script>
هذا الكود لإضافة آلة حاسبة
<!-- ONE STEP TO INSTALL ADVANCED CALCULATOR:
1. Paste the coding into the BODY of your HTML document -->
<!-- STEP ONE: Copy this code into the BODY of your HTML document -->
<BODY>
<CENTER>
<FORM name="Keypad" action="">
<!-- Original:
http://www.dummyproof.com/javascripts -->
<!--Total Java Scripts 99 - Next Step Software-->
<TABLE>
<B>
<TABLE border=2 width=50 height=60 cellpadding=1 cellspacing=5>
<TR>
<TD colspan=3 align=middle>
<input name="ReadOut" type="Text" size=24 value="0" width=100%>
</TD>
<TD
</TD>
<TD>
<input name="btnClear" type="Button" value=" C " onclick="Clear()">
</TD>
<TD><input name="btnClearEntry" type="Button" value=" CE " onclick="ClearEntry()">
</TD>
</TR>
<TR>
<TD>
<input name="btnSeven" type="Button" value=" 7 " onclick="NumPressed(7)">
</TD>
<TD>
<input name="btnEight" type="Button" value=" 8 " onclick="NumPressed(
">
</TD>
<TD>
<input name="btnNine" type="Button" value=" 9 " onclick="NumPressed(9)">
</TD>
<TD>
</TD>
<TD>
<input name="btnNeg" type="Button" value=" +/- " onclick="Neg()">
</TD>
<TD>
<input name="btnPercent" type="Button" value=" % " onclick="Percent()">
</TD>
</TR>
<TR>
<TD>
<input name="btnFour" type="Button" value=" 4 " onclick="NumPressed(4)">
</TD>
<TD>
<input name="btnFive" type="Button" value=" 5 " onclick="NumPressed(5)">
</TD>
<TD>
<input name="btnSix" type="Button" value=" 6 " onclick="NumPressed(6)">
</TD>
<TD>
</TD>
<TD align=middle><input name="btnPlus" type="Button" value=" + " onclick="Operation('+')">
</TD>
<TD align=middle><input name="btnMinus" type="Button" value=" - " onclick="Operation('-')">
</TD>
</TR>
<TR>
<TD>
<input name="btnOne" type="Button" value=" 1 " onclick="NumPressed(1)">
</TD>
<TD>
<input name="btnTwo" type="Button" value=" 2 " onclick="NumPressed(2)">
</TD>
<TD>
<input name="btnThree" type="Button" value=" 3 " onclick="NumPressed(3)">
</TD>
<TD>
</TD>
<TD align=middle><input name="btnMultiply" type="Button" value=" * " onclick="Operation('*')">
</TD>
<TD align=middle><input name="btnDivide" type="Button" value=" / " onclick="Operation('/')">
</TD>
</TR>
<TR>
<TD>
<input name="btnZero" type="Button" value=" 0 " onclick="NumPressed(0)">
</TD>
<TD>
<input name="btnDecimal" type="Button" value=" . " onclick="Decimal()">
</TD>
<TD colspan=3>
</TD>
<TD>
<input name="btnEquals" type="Button" value=" = " onclick="Operation('=')">
</TD>
</TR>
</TABLE>
</TABLE>
</B>
</FORM>
</CENTER>
<font face="Verdana, Arial, Helvetica" size=2>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var FKeyPad = document.Keypad;
var Accum = 0;
var FlagNewNum = false;
var PendingOp = "";
function NumPressed (Num) {
if (FlagNewNum) {
FKeyPad.ReadOut.value = Num;
FlagNewNum = false;
}
else {
if (FKeyPad.ReadOut.value == "0")
FKeyPad.ReadOut.value = Num;
else
FKeyPad.ReadOut.value += Num;
}
}
function Operation (Op) {
var Readout = FKeyPad.ReadOut.value;
if (FlagNewNum && PendingOp != "=");
else
{
FlagNewNum = true;
if ( '+' == PendingOp )
Accum += parseFloat(Readout);
else if ( '-' == PendingOp )
Accum -= parseFloat(Readout);
else if ( '/' == PendingOp )
Accum /= parseFloat(Readout);
else if ( '*' == PendingOp )
Accum *= parseFloat(Readout);
else
Accum = parseFloat(Readout);
FKeyPad.ReadOut.value = Accum;
PendingOp = Op;
}
}
function Decimal () {
var curReadOut = FKeyPad.ReadOut.value;
if (FlagNewNum) {
curReadOut = "0.";
FlagNewNum = false;
}
else
{
if (curReadOut.indexOf(".") == -1)
curReadOut += ".";
}
FKeyPad.ReadOut.value = curReadOut;
}
function ClearEntry () {
FKeyPad.ReadOut.value = "0";
FlagNewNum = true;
}
function Clear () {
Accum = 0;
PendingOp = "";
ClearEntry();
}
function Neg () {
FKeyPad.ReadOut.value = parseFloat(FKeyPad.ReadOut.value) * -1;
}
function Percent () {
FKeyPad.ReadOut.value = (parseFloat(FKeyPad.ReadOut.value) / 100) * parseFloat(Accum);
}
// End -->
</SCRIPT>
<!-- Script Size: 4.05 KB -->
هذا الكود لإضافة لون للرابط فهي طريقة جميلة لتزيين الرابط
<style>
<!--
A:link {text-decoration: none; color: لون الوصلة;}
A:visited {text-decoration: none; color: الوصلة المزارة;}
A:active {text-decoration: none; color:الوصلة عند الضغط عليها; }
A:hover {text-decoration: underline; color: الوصلة عند مرور الفأرة عليها;background-color:لون الخلفية ;}
//-->
</style>
هذا الكود لعرض شرح في الجزء السفلي في المتصفح
<script language="JavaScript">
<!--
var currentmsg = 0
var MsgTime = 2000
var MsgEndTime = 4000
function initArray(n) {
this.length = n;
for (var i =1; i <= n; i++) {
this[i] = ' '
}
}
msg = new initArray(4)
msg[0]="مرحبا بكم في "
msg[1]="صفحتي الشخصية"
msg[2]="اتمنى ان تنال على اعجابكم"
msg[3]="و شكرا على الزياره"
function msgrotator() {
window.status = msg[currentmsg]
if (currentmsg > msg.length - 1) {
currentmsg = 0
setTimeout("msgrotator()", MsgEndTime)
}
else {
currentmsg = currentmsg + 1
setTimeout("msgrotator()", MsgTime)
}
}
msgrotator();
//-->
</script>
هذا الكود لإضافة ساعة
<div id=Clock align=center style="font-family: tahoma; font-size: 14; color:لون الساعة"> </div>
<script>
function tick() {
var hours, minutes, seconds, ap;
var intHours, intMinutes, intSeconds;
var today;
today = new Date();
intHours = today.getHours();
intMinutes = today.getMinutes();
intSeconds = today.getSeconds();
if (intHours == 0) {
hours = "12:";
ap = "بعد متصف الليل";
} else if (intHours < 12) {
hours = intHours+":";
ap = "صباحا";
} else if (intHours == 12) {
hours = "12:";
ap = "ظهرا";
} else {
intHours = intHours - 12
hours = intHours + ":";
ap = "مساءا";
}
if (intMinutes < 10) {
minutes = "0"+intMinutes+":";
} else {
minutes = intMinutes+":";
}
if (intSeconds < 10) {
seconds = "0"+intSeconds+" ";
} else {
seconds = intSeconds+" ";
}
timeString = hours+minutes+seconds+ap;
Clock.innerHTML = timeString;
window.setTimeout("tick();", 100);
}
window.onload = tick;
</script>
هذا الكود لمنع الزوار من استخدام زر الفأرة الأيمن هههههه
<script
language="JavaScript"><!--
function click() {
if (event.button==2) {
alert('يا مرحبا مليون واكثر ');
}
}
document.onmousedown=click
// -->
// --></script><!--
http://khayma.com/hamed -->