توجه : بعضی از کدها را نمی تونید با هم استفاده کنید . مثلا از کدهای "تغيير رنگ درون باکس" و "پرسيدن رنگ زمينه و نوشته ها" و "تغییر رنگ بک گراند" رو نمی تونید با هم استفاده کنید و باید یکی رو انتخاب کنید وگرنه هیچ کدوم کار نمی کنه .
نکته ی خیلی مهم
کدهایی را که می خواهید استفاده کنید بین تگ بادی کپی کنید
آموزش ساده استفاده از کدهای جاوا اسکریپت :
بین همین 2 تگ بادی کد مورد نظر را کپی کنید
برای امتحان کردن کدها یه راه ساده وجود داره :
1 وارد Notepad شوید .
2 در صفحه Notepad کدهای زیر را وارد کنید .
3 بین دو تگ و هر کدوم از کدهای گفته شده را که خواستید وارد کنید .
4 صفحه را با پسوند html ( مثلا example.html ) ذخیره کنید . قبل از ذخیره کردن مطمئن شوید که save as type روی حالت All Files باشد .
5 رو فایلی که درست کردید دبل کلیک کنید و نتیجه رو ببینید .
با این کد میتونید همراه با باز شدن وبلاگتون صفحه دیگه ای هم باز کنید در جایی که نوشته شده your title باید عنوان سایت یا وبلاگتون رو بذارید و در جایی که نوشته your site آدرس سایتتون یا وبلاگتون رو وارد کنید و در قسمت your text جمله خودتون رو و در قسمت your mail ایمیلتون رو و در قسمت http://your site.com آدرس وبلاگ یا سایتتون رو و درست جلوش در قسمت your name site اسم سایتتون رو بنویسید.
<SCRIPT LANGUAGE="JavaScript">
<!--
coffeeWin=window.open("","coffeeWin","toolbar=no,width=500,height=500,directories=no,men ubar=no,SCROLLBARS=yes");
coffeeWin.document.write("<HTML>");
coffeeWin.document.write("<HEAD>");
coffeeWin.document.write("<title>your title</title>");
coffeeWin.document.write("</HEAD>");
coffeeWin.document.write("<BODY BGCOLOR=#8080FF TEXT=#FFFFDD>")
coffeeWin.document.write("<CENTER>")
coffeeWin.document.write("<FONT FACE=Times New Roman SIZE=5>");
coffeeWin.document.write("<B>");
coffeeWin.document.write("<FONT SIZE=5>your site</FONT>");
coffeeWin.document.write("<BR><HR WIDTH=180><BR><P>");
coffeeWin.document.write("<P>");
coffeeWin.document.write("your text");
coffeeWin.document.write("<P>");
coffeeWin.document.write("<BR><HR WIDTH=180><BR><P>");
coffeeWin.document.write("<FONT FACE=Times New Roman SIZE=3>");
coffeeWin.document.write("E-mail:<br>");
coffeeWin.document.write("your mail");
coffeeWin.document.write("<BR><HR WIDTH=180><BR><P>");
coffeeWin.document.write("<A HREF=http://your site.com TARGET=MAIN>your name site</A>");
coffeeWin.document.write("</B>");
coffeeWin.document.write("</FONT>");
coffeeWin.document.write("</BODY>");
coffeeWin.document.write("</HTML>");
//-->
</SCRIPT></body>
</html>
کد زیر هم خیلی قشنگه چند جرقه رو بوجود میاره که وقتی ماوس حرکت میکنه روشن میشن
<STYLE TYPE="text/css">
<!--
BODY{
overflow:scroll;
overflow-x:hidden;
}
.s1
{
position : absolute;
font-size : 10pt;
color : blue;
visibility: hidden;
}
.s2
{
position : absolute;
font-size : 18pt;
color : red;
visibility : hidden;
}
.s3
{
position : absolute;
font-size : 14pt;
color : gold;
visibility : hidden;
}
.s4
{
position : absolute;
font-size : 12pt;
color : lime;
visibility : hidden;
}
//-->
</STYLE>
<DIV ID="div1" CLASS="s1">*</DIV>
<DIV ID="div2" CLASS="s2">*</DIV>
<DIV ID="div3" CLASS="s3">*</DIV>
<DIV ID="div4" CLASS="s4">*</DIV>
<p align="center">
<font face="arial, helvetica" size="-2"><a
Kit</a></font></p>
<SCRIPT LANGUAGE="javascript" TYPE="text/javascript">
var nav = (document.layers);
var tmr = null;
var spd = 50;
var x = 0;
var x_offset = 5;
var y = 0;
var y_offset = 15;
if(nav) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = get_mouse;
function get_mouse(e)
{
x = (nav) ? e.pageX : event.clientX+document.body.scrollLeft;
y = (nav) ? e.pageY : event.clientY+document.body.scrollTop;
x += x_offset;
y += y_offset;
beam(1);
}
function beam(n)
{
if(n<5)
{
if(nav)
{
eval("document.div"+n+".top="+y);
eval("document.div"+n+".left="+x);
eval("document.div"+n+".visibility='visible'");
}
else
{
eval("div"+n+".style.top="+y);
eval("div"+n+".style.left="+x);
eval("div"+n+".style.visibility='visible'");
}
n++;
tmr=setTimeout("beam("+n+")",spd);
}
else
{
clearTimeout(tmr);
fade(4);
}
}
function fade(n)
{
if(n>0)
{
if(nav)eval("document.div"+n+".visibility='hidden'");
else eval("div"+n+".style.visibility='hidden'");
n--;
tmr=setTimeout("fade("+n+")",spd);
}
else clearTimeout(tmr);
}
// -->
</SCRIPT>
کد زیر باعث میشه که متن انتخابیه شما به دور ماوس بیاد و دورش بچرخه . قسمتی که نوشته well come to my weblog را شما میتونید عوض کنید .
<head>
<meta http-equiv="Content-Language" content="en-us">
</head>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
if (document.all) {
//Things you can alter
yourLogo = "wellcome to my weblog"; //Not less than 2 letters!
logoFont = "Arial";
logoColor = "red";
//Nothing needs altering below!
yourLogo = yourLogo.split('');
L = yourLogo.length;
TrigSplit = 360 / L;
Sz = new Array()
logoWidth = 100;
logoHeight = -30;
ypos = 0;
xpos = 0;
step = 0.03;
currStep = 0;
document.write('<div id="outer" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i = 0; i < L; i++) {
document.write('<div id="ie" style="position:absolute;top:0px;left:0px;'
+'width:10px;height:10px;font-family:'+logoFont+';font-size:12px;'
+'color:'+logoColor+';text-align:center">'+yourLogo[i]+'</div>');
}
document.write('</div></div>');
function Mouse() {
ypos = event.y;
xpos = event.x - 5;
}
document.onmousemove=Mouse;
function animateLogo() {
outer.style.pixelTop = document.body.scrollTop;
for (i = 0; i < L; i++) {
ie[i].style.top = ypos + logoHeight * Math.sin(currStep + i * TrigSplit * Math.PI / 180);
ie[i].style.left = xpos + logoWidth * Math.cos(currStep + i * TrigSplit * Math.PI / 180);
Sz[i] = ie[i].style.pixelTop - ypos;
if (Sz[i] < 5) Sz[i] = 5;
ie[i].style.fontSize = Sz[i] / 1.7;
}
currStep -= step;
setTimeout('animateLogo()', 20);
}
window.onload = animateLogo;
}
// End -->
</script>
</body>
</html>