بهترین کدهای جاوا اسکریپت در این پست برای شما عزیزان گذاشتم تا حال کنید و از آن در وبلاگ خود استفاده کنید
the best free java code for you
کد پرش به بالای صفحه
<a href="http://www.afi.parsiblog.com" target="_blank" ><img src="http://www.parsiblog.com/PhotoAlbum/afi/Thumb_77591.jpg" alt="بزرگترین سایت جاوا اسکریپت ایران " width="100" height="40" border="0"> <!-- START OF Watermark Jump to Top Link DHTML --> <!-- SUMMARY BRIEF This DHTML will put a small watermark link in the bottom right corner of your page that will stay there even when the page scrolls. This link will always take the user back to the top of the page. --> <!-- Put this portion of the inside of your <HEAD> tag --> <> <!-- // Change this text to the text that you want to be displayed as the link on your page. var displayed="<nobr><font size=2 face=Arial><b>[Top]</b></font></nobr>" // === DO NOT EDIT ANYTHING BELOW THIS LINE!!! === // var logolink="java:window.scrollTo(0,0)" var ns4=document.layers var ie4=document.all var ns6=document.getElementById&&!document.all function regenerate(){ window.location.reload() } function regenerate2(){ if (ns4) setTimeout("window.onresize=regenerate",400) } if (ie4||ns6) document.write("<span id="logo" style="position:absolute;top:-300;z-index:100">"+displayed+"</span>") function createtext(){ //function for NS4 staticimage=new Layer(5) staticimage.left=-300 staticimage.document.write("<a href=""+logolink+"">"+displayed+"</a>") staticimage.document.close() staticimage.visibility="show" regenerate2() staticitns() } function staticit(){ //function for IE4/ NS6 var w2=ns6? pageXOffset+w : document.body.scrollLeft+w var h2=ns6? pageYOffset+h : document.body.scrollTop+h crosslogo.style.left=w2 crosslogo.style.top=h2 } function staticit2(){ //function for NS4 staticimage.left=pageXOffset+window.innerWidth-staticimage.document.width-28 staticimage.top=pageYOffset+window.innerHeight-staticimage.document.height-10 } function inserttext(){ //function for IE4/ NS6 if (ie4) crosslogo=document.all.logo else if (ns6) crosslogo=document.getElementById("logo") crosslogo.innerHTML="<a href=""+logolink+"">"+displayed+"</a>" w=ns6? window.innerWidth-crosslogo.offsetWidth-20 : document.body.clientWidth-crosslogo.offsetWidth-10 h=ns6? window.innerHeight-crosslogo.offsetHeight-15 : document.body.clientHeight-crosslogo.offsetHeight-10 crosslogo.style.left=w crosslogo.style.top=h if (ie4) window.onscroll=staticit else if (ns6) startstatic=setInterval("staticit()",100) } if (ie4||ns6){ window.onload=inserttext window.onresize=new Function("window.location.reload()") } else if (ns4) window.onload=createtext function staticitns(){ //function for NS4 startstatic=setInterval("staticit2()",90) } //--> </> <!-- END OF Watermark Jump to Top Link DHTML -->
کد آمدن پیغام مورد نظر شما هنگام ورود افراد به سایت شما
<a href="http://www.afi.parsiblog.com" target="_blank" ><img src="http://www.parsiblog.com/PhotoAlbum/afi/Thumb_77591.jpg" alt="بزرگترین سایت جاوا اسکریپت ایران " width="100" height="40" border="0"><html> <head> < language="java" type="text/java"> alert("Welcome to my site") </> </head> <body> <h1> <!-- hide from old browsers --> <!--this is on example of a long Java comment--> < language="java" type="text/java"> document.write("KKR") //end hiding from old browsers --> </> </h1> </body> </html>
کد ساعت عقربه دار
<a href="http://www.afi.parsiblog.com" target="_blank" ><img src="http://www.parsiblog.com/PhotoAlbum/afi/Thumb_77591.jpg" alt="بهترین و زیباترین کدهای جاوا اسکریپت به همراه آزمایش آن کد" width="100" height="40" border="0"> </> < language=Java> fCol="444444"; //face colour. sCol="FF0000"; //seconds colour. mCol="444444"; //minutes colour. hCol="444444"; //hours colour. Ybase=30; //Clock height. Xbase=30; //Clock width. H="..."; H=H.split(""); M="...."; M=M.split(""); S="....."; S=S.split(""); NS4=(document.layers); NS6=(document.getElementById&&!document.all); IE4=(document.all); Ypos=0; Xpos=0; dots=12; Split=360/dots; if (NS6){ for (i=1; i < dots+1; i++){ document.write("<div id="n6Digits"+i+"" style="position:absolute;top:0px;left:0px;width:30px;height:30px;font-family:Arial;font-size:10px;color:#"+fCol+";text-align:center;padding-top:10px">"+i+"</div>"); } for (i=0; i < M.length; i++){ document.write("<div id="Ny"+i+"" style="position:absolute;top:0px;left:0px;width:2px;height:2px;font-size:2px;background:#"+mCol+""></div>"); } for (i=0; i < H.length; i++){ document.write("<div id="Nz"+i+"" style="position:absolute;top:0px;left:0px;width:2px;height:2px;font-size:2px;background:#"+hCol+""></div>"); } for (i=0; i < S.length; i++){ document.write("<div id="Nx"+i+"" style="position:absolute;top:0px;left:0px;width:2px;height:2px;font-size:2px;background:#"+sCol+""></div>"); } } if (NS4){ dgts="1 2 3 4 5 6 7 8 9 10 11 12"; dgts=dgts.split(" ") for (i=0; i < dots; i++){ document.write("<layer name=nsDigits"+i+" top=0 left=0 height=30 width=30><center><font face=Arial size=1 color="+fCol+">"+dgts[i]+"</font></center></layer>"); } for (i=0; i < M.length; i++){ document.write("<layer name=ny"+i+" top=0 left=0 bgcolor="+mCol+" clip="0,0,2,2"></layer>"); } for (i=0; i < H.length; i++){ document.write("<layer name=nz"+i+" top=0 left=0 bgcolor="+hCol+" clip="0,0,2,2"></layer>"); } for (i=0; i < S.length; i++){ document.write("<layer name=nx"+i+" top=0 left=0 bgcolor="+sCol+" clip="0,0,2,2"></layer>"); } } if (IE4){ document.write("<div style="position:absolute;top:0px;left:0px"><div style="position:relative">"); for (i=1; i < dots+1; i++){ document.write("<div id="ieDigits" style="position:absolute;top:0px;left:0px;width:30px;height:30px;font-family:Arial;font-size:10px;color:"+fCol+";text-align:center;padding-top:10px">"+i+"</div>"); } document.write("</div></div>") document.write("<div style="position:absolute;top:0px;left:0px"><div style="position:relative">"); for (i=0; i < M.length; i++){ document.write("<div id=y style="position:absolute;width:2px;height:2px;font-size:2px;background:"+mCol+""></div>"); } document.write("</div></div>") document.write("<div style="position:absolute;top:0px;left:0px"><div style="position:relative">"); for (i=0; i < H.length; i++){ document.write("<div id=z style="position:absolute;width:2px;height:2px;font-size:2px;background:"+hCol+""></div>"); } document.write("</div></div>") document.write("<div style="position:absolute;top:0px;left:0px"><div style="position:relative">"); for (i=0; i < S.length; i++){ document.write("<div id=x style="position:absolute;width:2px;height:2px;font-size:2px;background:"+sCol+""></div>"); } document.write("</div></div>") } function clock(){ time = new Date (); secs = time.getSeconds(); sec = -1.57 + Math.PI * secs/30; mins = time.getMinutes(); min = -1.57 + Math.PI * mins/30; hr = time.getHours(); hrs = -1.57 + Math.PI * hr/6 + Math.PI*parseInt(time.getMinutes())/360; if (NS6){ Ypos=window.pageYOffset+window.innerHeight-Ybase-25; Xpos=window.pageXOffset+window.innerWidth-Xbase-30; for (i=1; i < dots+1; i++){ document.getElementById("n6Digits"+i).style.top=Ypos-15+Ybase*Math.sin(-1.56 +i *Split*Math.PI/180) document.getElementById("n6Digits"+i).style.left=Xpos-15+Xbase*Math.cos(-1.56 +i*Split*Math.PI/180) } for (i=0; i < S.length; i++){ document.getElementById("Nx"+i).style.top=Ypos+i*Ybase/4.1*Math.sin(sec); document.getElementById("Nx"+i).style.left=Xpos+i*Xbase/4.1*Math.cos(sec); } for (i=0; i < M.length; i++){ document.getElementById("Ny"+i).style.top=Ypos+i*Ybase/4.1*Math.sin(min); document.getElementById("Ny"+i).style.left=Xpos+i*Xbase/4.1*Math.cos(min); } for (i=0; i < H.length; i++){ document.getElementById("Nz"+i).style.top=Ypos+i*Ybase/4.1*Math.sin(hrs); document.getElementById("Nz"+i).style.left=Xpos+i*Xbase/4.1*Math.cos(hrs); } } if (NS4){ Ypos=window.pageYOffset+window.innerHeight-Ybase-20; Xpos=window.pageXOffset+window.innerWidth-Xbase-30; for (i=0; i < dots; ++i){ document.layers["nsDigits"+i].top=Ypos-5+Ybase*Math.sin(-1.045 +i*Split*Math.PI/180) document.layers["nsDigits"+i].left=Xpos-15+Xbase*Math.cos(-1.045 +i*Split*Math.PI/180) } for (i=0; i < S.length; i++){ document.layers["nx"+i].top=Ypos+i*Ybase/4.1*Math.sin(sec); document.layers["nx"+i].left=Xpos+i*Xbase/4.1*Math.cos(sec); } for (i=0; i < M.length; i++){ document.layers["ny"+i].top=Ypos+i*Ybase/4.1*Math.sin(min); document.layers["ny"+i].left=Xpos+i*Xbase/4.1*Math.cos(min); } for (i=0; i < H.length; i++){ document.layers["nz"+i].top=Ypos+i*Ybase/4.1*Math.sin(hrs); document.layers["nz"+i].left=Xpos+i*Xbase/4.1*Math.cos(hrs); } } if (IE4){ Ypos=document.body.scrollTop+window.document.body.clientHeight-Ybase-20; Xpos=document.body.scrollLeft+window.document.body.clientWidth-Xbase-20; for (i=0; i < dots; ++i){ ieDigits[i].style.pixelTop=Ypos-15+Ybase*Math.sin(-1.045 +i *Split*Math.PI/180) ieDigits[i].style.pixelLeft=Xpos-15+Xbase*Math.cos(-1.045 +i *Split*Math.PI/180) } for (i=0; i < S.length; i++){ x[i].style.pixelTop =Ypos+i*Ybase/4.1*Math.sin(sec); x[i].style.pixelLeft=Xpos+i*Xbase/4.1*Math.cos(sec); } for (i=0; i < M.length; i++){ y[i].style.pixelTop =Ypos+i*Ybase/4.1*Math.sin(min); y[i].style.pixelLeft=Xpos+i*Xbase/4.1*Math.cos(min); } for (i=0; i < H.length; i++){ z[i].style.pixelTop =Ypos+i*Ybase/4.1*Math.sin(hrs); z[i].style.pixelLeft=Xpos+i*Xbase/4.1*Math.cos(hrs); } } setTimeout("clock()",100); } clock(); //--> </> < language=Java> fCol="444444"; //face colour. sCol="FF0000"; //seconds colour. mCol="444444"; //minutes colour. hCol="444444"; //hours colour. Ybase=30; //Clock height. Xbase=30; //Clock width. </body> </html> <p align="center"><a href="http://www.afi.parsiblog.com"> <font face="Tahoma" size="2">webloger site</font></a></p>
کد پروانه در سایت
<a href="http://www.afi.parsiblog.com" target="_blank" ><img src="http://www.parsiblog.com/PhotoAlbum/afi/Thumb_77591.jpg" alt="بزرگترین سایت جاوا اسکریپت ایران " width="100" height="40" border="0"> <> <!-- Begin var no = 2; // snow number var speed = 6; // smaller number moves the snow faster var snowflake = "http://www.forever-memories.net/Animated%20gifs/bfa.gif"; var ns4up = (document.layers) ? 1 : 0; // browser sniffer var ie4up = (document.all) ? 1 : 0; var dx, xp, yp; // coordinate and position variables var am, stx, sty; // amplitude and step variables var i, doc_width = 800, doc_height = 600; if (ns4up) { doc_width = self.innerWidth; doc_height = self.innerHeight; } else if (ie4up) { doc_width = document.body.clientWidth; doc_height = document.body.clientHeight; } dx = new Array(); xp = new Array(); yp = new Array(); am = new Array(); stx = new Array(); sty = new Array(); for (i = 0; i < no; ++ i) { dx[i] = 0; // set coordinate variables xp[i] = Math.random()*(doc_width-50); // set position variables yp[i] = Math.random()*doc_height; am[i] = Math.random()*20; // set amplitude variables stx[i] = 0.02 + Math.random()/10; // set step variables sty[i] = 0.7 + Math.random(); // set step variables if (ns4up) { // set layers if (i == 0) { document.write("<layer name=\"dot"+ i +"\" left=\"15\" "); document.write("top=\"15\" visibility=\"show\"><img src=\""); document.write(snowflake + "\" border=\"0\"></layer>"); } else { document.write("<layer name=\"dot"+ i +"\" left=\"15\" "); document.write("top=\"15\" visibility=\"show\"><img src=\""); document.write(snowflake + "\" border=\"0\"></layer>"); } } else if (ie4up) { if (i == 0) { document.write("<div id=\"dot"+ i +"\" style=\"POSITION: "); document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: "); document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\""); document.write(snowflake + "\" border=\"0\"></div>"); } else { document.write("<div id=\"dot"+ i +"\" style=\"POSITION: "); document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: "); document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\""); document.write(snowflake + "\" border=\"0\"></div>"); } } } function snowNS() { // Netscape main animation function for (i = 0; i < no; ++ i) { // iterate for every dot yp[i] += sty[i]; if (yp[i] > doc_height-50) { xp[i] = Math.random()*(doc_width-am[i]-30); yp[i] = 0; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); doc_width = self.innerWidth; doc_height = self.innerHeight; } dx[i] += stx[i]; document.layers["dot"+i].top = yp[i]; document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]); } setTimeout("snowNS()", speed); } function snowIE() { // IE main animation function for (i = 0; i < no; ++ i) { // iterate for every dot yp[i] += sty[i]; if (yp[i] > doc_height-50) { xp[i] = Math.random()*(doc_width-am[i]-30); yp[i] = 0; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); doc_width = document.body.clientWidth; doc_height = document.body.clientHeight; } dx[i] += stx[i]; document.all["dot"+i].style.pixelTop = yp[i]; document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]); } setTimeout("snowIE()", speed); } if (ns4up) { snowNS(); } else if (ie4up) { snowIE(); } // End --> </>