مرحبا فى موقع جافا اتصميم المواقع
أكواد متنوعة
تغير لون الصفحة عند دخول الزائر
<script> <!--- function initArray() { this.length = initArray.arguments.length for (var i = 0; i < this.length; i++) this[i+1] = initArray.arguments[i] } var hexChars = "0123456789ABCDEF"; function Dec2Hex (Dec) { var a = Dec % 16; var b = (Dec - a)/16; hex = "" + hexChars.charAt(b) + hexChars.charAt(a); return hex; } function bgChanger (begin, end, steps) { steps = steps -1 ; redA = begin.charAt(0) + begin.charAt(1); red_valA = parseInt(redA,'16'); redB = end.charAt(0) + end.charAt(1); red_valB = parseInt(redB,'16'); red_int = ((red_valB - red_valA) / steps) * -1; grnA = begin.charAt(2) + begin.charAt(3); grn_valA = parseInt(grnA,'16'); grnB = end.charAt(2) + end.charAt(3); grn_valB = parseInt(grnB,'16'); grn_int = ((grn_valB - grn_valA) / steps) * -1; bluA = begin.charAt(4) + begin.charAt(5); blu_valA = parseInt(bluA,'16'); bluB = end.charAt(4) + end.charAt(5); blu_valB = parseInt(bluB,'16'); blu_int = ((blu_valB - blu_valA) / steps) * -1; step = 2; red = red_valA; grn = grn_valA; blu = blu_valA; document.bgColor = begin; while ( steps >= step ) { red -= red_int; red_round = Math.round(red); red_hex = Dec2Hex(red); grn -= grn_int; grn_round = Math.round(grn); grn_hex = Dec2Hex(grn); blu -= blu_int; blu_round = Math.round(blu); blu_hex = Dec2Hex(blu); document.bgColor = red_hex + grn_hex + blu_hex; step++; } document.bgColor = end; } bgChanger("000000","000000",25); bgChanger("000000","FF0000",25); bgChanger("FF0000","000000",25); bgChanger("000000","AA00EE",25); bgChanger("AA00EE","000000",25); bgChanger("000000","0000FF",25); bgChanger("0000FF","000000",25); bgChanger("000000","FFFFFF",25); // --> </script>
رسالة ترحيبية تتحرك اسفل البار
var count = 0; var text = "عبد المنعم يرحب بكم .. .. "; scroll(); function scroll () { window.status = text.substring (count, text.length) + text.substring (0, count) if (count < text.length) count ++; else count = 0; setTimeout ("scroll()", 250); }
لأظهار التاريخ والزمن
<script LANGUAGE="JavaScript"> <!-- This script and many more are available online from --> <!-- The JavaScript Source!! http://javascriptsource.com --> <!-- Begin var day=""; var month=""; var myweekday=""; var year=""; mydate = new Date(); myday = mydate.getDay(); mymonth = mydate.getMonth(); myweekday= mydate.getDate(); weekday= myweekday; myyear= mydate.getYear(); year = myyear if(myday == 0) day = " الأحد, " else if(myday == 1) day = " الأثنين, " else if(myday == 2) day = " الثلاثاء, " else if(myday == 3) day = " الاربعاء, " else if(myday == 4) day = " الخميس, " else if(myday == 5) day = " الجمعة, " else if(myday == 6) day = " السبت, " if(mymonth == 0) { month = "يناير "} else if(mymonth ==1) month = "فبراير " else if(mymonth ==2) month = "مارس " else if(mymonth ==3) month = "ابريل " else if(mymonth ==4) month = "مايو " else if(mymonth ==5) month = "يونيو " else if(mymonth ==6) month = "يوليو " else if(mymonth ==7) month = "اغسطس " else if(mymonth ==8) month = "سبتمبر " else if(mymonth ==9) month = "اكتوبر " else if(mymonth ==10) month = "نوفمبر " else if(mymonth ==11) month = "ديسمبر " // End --> </script> <!-- الخطوة الثانية--> <script> document.write("<b><font face=Tahoma size=1>" + day +myweekday ); document.write(month + ", " + year + "</font></b>"); </script>
كود لتحريك الصفحة من الأسفل للأعلى مع امكانية تغيير سرعة التمرير
/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=30 window.scroll(0,currentpos) } } function startit(){ setInterval("scrollwindow()",30) } window.onload=initialize
جميع الحقوق محفوظة لعبد المنعم@ .copyright © 2000 Abd elmoneim. All rights reserved