كدهاي ناياب جاوا اسكريپت

MJ Rayaneh

Well-Known Member
سلام.:lol:
به زودي در ايجا بهترين و ناياب ترين كدهاي جاوا اسكريپت رو براتون مي ذارم.
الان هم مي تونيد به سايتم به آدرس زير بريد.

http://www.mjrayaneh.tk
باي!:cool:
 

MJ Rayaneh

Well-Known Member
بازم سلام.
بچه ها!
هر كدي كه خواستين بگين تا براتون بذارم.
باي!
 

MJ Rayaneh

Well-Known Member
اينم يه كد براي پخش شدن ستاره هاي رنگي در صفحه
<!-- Start fireworks -->
<!----Free script by http://www.mjrayaneh.blogfa.com----->
<script LANGUAGE="JavaScript1.2">
<!--
//set Interval between each firework display,
var intervals=2000
var sparksOn = true;
var speed = 25;
var power = 1;

//Dont change these values-------
var documentWidth=documentHeight=randomx=randomy=leftcorner=topcorner=0
var ns=(document.layers);
var ie=(document.all);
var sparksAflyin = false;
var allDivs = new Array(10);
var totalSparks = 0;
//-------------------------------

function initAll(){
if(!ns && !ie){
sparksOn = false;
return;
}
setInterval("firework()",intervals)

if (ns)
document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE);
for(dNum=0; dNum<7; ++dNum){
if(ie)
allDivs[dNum]=eval ('document.all.sDiv'+dNum+'.style');
else
allDivs[dNum]=eval('document.layers ["sDiv'+dNum+'"]');
}
}

function firework(){
//below code detects the browser dimenions
if (ie){
documentWidth=document.body.clientWidth
documentHeight=document.body.clientHeight
leftcorner=document.body.scrollLeft
topcorner=document.body.scrollTop
}
else if (ns){
documentWidth=window.innerWidth
documentHeight=window.innerHeight
leftcorner=pageXOffset
topcorner=pageYOffset

}
//below code randomly generates a set of coordinates that fall within the dimension
randomx=leftcorner+Math.floor(Math.random()*documentWidth)
randomy=topcorner+Math.floor(Math.random()*documentHeight)


if(sparksOn){
if(!sparksAflyin){
sparksAflyin=true;
totalSparks=0;
for(var spark=0;spark<=6;spark++){
dx=Math.round(Math.random()*50);
dy=Math.round(Math.random()*50);
moveTo(spark,randomx,randomy,dx,dy);
}
}
}
}

function moveTo(i,tempx,tempy,dx,dy){
if(ie){
if(tempy+80> (document.body.offsetHeight+document.body.scrollTop))
tempy=document.body.offsetHeight+document.body.scrollTop-80;
if(tempx+80> (document.body.offsetWidth+document.body.scrollLeft))
tempx=document.body.offsetWidth+document.body.scrollLeft-80;
}
if(tempx>-50&&tempy>-50){
tempx+=dx;tempy+=dy;
allDivs.left=tempx;
allDivs.top=tempy;
dx-=power;dy-=power;
setTimeout("moveTo ("+i+","+tempx+","+tempy+","+dx+","+dy+")",speed)
}
else
++totalSparks
if(totalSparks==7){
sparksAflyin=false;
totalSparks=0;
}
}
window.onload=initAll
//End-->
</script>
<style>
#sDiv0 {position:absolute; height:1; width:1; font-family:arial black; font- size:25px; color:Aqua;}
#sDiv1 {position:absolute; height:1; width:1; font-family:arial black; font- size:22px; color:red;}
#sDiv2 {position:absolute; height:1; width:1; font-family:arial black; font- size:20px; color:blue;}
#sDiv3 {position:absolute; height:1; width:1; font-family:arial black; font- size:15px; color:eek:range;}
#sDiv4 {position:absolute; height:1; width:1; font-family:arial black; font- size:25px; color:yellow;}
#sDiv5 {position:absolute; height:1; width:1; font-family:arial black; font- size:25px; color:lightgreen;}
#sDiv6 {position:absolute; height:1; width:1; font-family:arial black; font- size:20px; color:silver;}
</style>
<p></p>
<div id="sDiv0">
*</div>
<div id="sDiv1">
*</div>
<div id="sDiv2">
*</div>
<div id="sDiv3">
*</div>
<div id="sDiv4">
*</div>
<div id="sDiv5">
*</div>
<div id="sDiv6">
*</div>
<!-- /fireworks -->
 

YTERROR

Active Member
کدها رو به این صورت بزار در دو تگ
نمونه

<!-- Start fireworks -->
<!----Free script by http://www.mjrayaneh.blogfa.com----->
<script LANGUAGE="JavaScript1.2">
<!--
//set Interval between each firework display,
var intervals=2000
var sparksOn = true;
var speed = 25;
var power = 1;

//Dont change these values-------
var documentWidth=documentHeight=randomx=randomy=leftc orner=topcorner=0
var ns=(document.layers);
var ie=(document.all);
var sparksAflyin = false;
var allDivs = new Array(10);
var totalSparks = 0;
//-------------------------------

function initAll(){
if(!ns && !ie){
sparksOn = false;
return;
}
setInterval("firework()",intervals)

if (ns)
document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE);
for(dNum=0; dNum<7; ++dNum){
if(ie)
allDivs[dNum]=eval ('document.all.sDiv'+dNum+'.style');
else
allDivs[dNum]=eval('document.layers ["sDiv'+dNum+'"]');
}
}

function firework(){
//below code detects the browser dimenions
if (ie){
documentWidth=document.body.clientWidth
documentHeight=document.body.clientHeight
leftcorner=document.body.scrollLeft
topcorner=document.body.scrollTop
}
else if (ns){
documentWidth=window.innerWidth
documentHeight=window.innerHeight
leftcorner=pageXOffset
topcorner=pageYOffset

}
//below code randomly generates a set of coordinates that fall within the dimension
randomx=leftcorner+Math.floor(Math.random()*docume ntWidth)
randomy=topcorner+Math.floor(Math.random()*documen tHeight)


if(sparksOn){
if(!sparksAflyin){
sparksAflyin=true;
totalSparks=0;
for(var spark=0;spark<=6;spark++){
dx=Math.round(Math.random()*50);
dy=Math.round(Math.random()*50);
moveTo(spark,randomx,randomy,dx,dy);
}
}
}
}

function moveTo(i,tempx,tempy,dx,dy){
if(ie){
if(tempy+80> (document.body.offsetHeight+document.body.scrollTo p))
tempy=document.body.offsetHeight+document.body.scr ollTop-80;
if(tempx+80> (document.body.offsetWidth+document.body.scrollLef t))
tempx=document.body.offsetWidth+document.body.scro llLeft-80;
}
if(tempx>-50&&tempy>-50){
tempx+=dx;tempy+=dy;
allDivs.left=tempx;
allDivs.top=tempy;
dx-=power;dy-=power;
setTimeout("moveTo ("+i+","+tempx+","+tempy+","+dx+","+dy+")",spee d)
}
else
++totalSparks
if(totalSparks==7){
sparksAflyin=false;
totalSparks=0;
}
}
window.onload=initAll
//End-->
</script>
<style>
#sDiv0 {position:absolute; height:1; width:1; font-family:arial black; font- size:25px; color:Aqua;}
#sDiv1 {position:absolute; height:1; width:1; font-family:arial black; font- size:22px; color:red;}
#sDiv2 {position:absolute; height:1; width:1; font-family:arial black; font- size:20px; color:blue;}
#sDiv3 {position:absolute; height:1; width:1; font-family:arial black; font- size:15px; color:eek:range;}
#sDiv4 {position:absolute; height:1; width:1; font-family:arial black; font- size:25px; color:yellow;}
#sDiv5 {position:absolute; height:1; width:1; font-family:arial black; font- size:25px; color:lightgreen;}
#sDiv6 {position:absolute; height:1; width:1; font-family:arial black; font- size:20px; color:silver;}
</style>
<p></p>
<div id="sDiv0">
*</div>
<div id="sDiv1">
*</div>
<div id="sDiv2">
*</div>
<div id="sDiv3">
*</div>
<div id="sDiv4">
*</div>
<div id="sDiv5">
*</div>
<div id="sDiv6">
*</div>
<!-- /fireworks -->
 

MJ Rayaneh

Well-Known Member
سلام بچه ها!
باز هم براتون يه كد توپ آوردم.
اين هم كد درج تاريخ شمسي:
<!--Set Farsi date--->
<!----Free script by http://www.mjrayaneh.blogfa.com----->
<SCRIPT LANGUAGE=JAVASCRIPT>
function showdate() {
week= new Array("يكشنبه","دوشنبه","سه شنبه","چهارشنبه","پنج شنبه","جمعه","شنبه")
months = new Array("فروردين","ارديبهشت","خرداد","تير","مرداد","شهريور","مهر","آبان"," آذر","دي","بهمن","اسفند");
a = new Date();
d= a.getDay();
day= a.getDate();
month = a.getMonth()+1;
year= a.getYear();
if (year== 0){year=2000;}
if (year<100){year +=1900;}
y=1;
for(i=0;i<3000;i+=4) {
if (year==i) {y=2;}
}
for(i=1;i<3000;i+=4) {
if (year==i) {y=3;}
}
if (y==1) {
year -= ( (month < 3) || ((month == 3) && (day < 21)) )? 622:621;

switch (month) {
case 1: (day<21)? (month=10, day+=10):(month=11, day-=20); break;
case 2: (day<20)? (month=11, day+=11):(month=12, day-=19); break;
case 3: (day<21)? (month=12, day+=9):(month=1, day-=20); break;
case 4: (day<21)? (month=1, day+=11):(month=2, day-=20); break;
case 5:
case 6: (day<22)? (month-=3, day+=10):(month-=2, day-=21); break;
case 7:
case 8:
case 9: (day<23)? (month-=3, day+=9):(month-=2, day-=22); break;
case 10:(day<23)? (month=7, day+=8):(month=8, day-=22); break;
case 11:
case 12:(day<22)? (month-=3, day+=9):(month-=2, day-=21); break;
default: break;
}
}
if (y==2) {
year -= ( (month < 3) || ((month == 3) && (day < 20)) )? 622:621;

switch (month) {
case 1: (day<21)? (month=10, day+=10):(month=11, day-=20); break;
case 2: (day<20)? (month=11, day+=11):(month=12, day-=19); break;
case 3: (day<20)? (month=12, day+=10):(month=1, day-=19); break;
case 4: (day<20)? (month=1, day+=12):(month=2, day-=19); break;
case 5: (day<21)? (month=2, day+=11):(month=3, day-=20); break;
case 6: (day<21)? (month=3, day+=11):(month=4, day-=20); break;
case 7: (day<22)? (month=4, day+=10):(month=5, day-=21); break;
case 8: (day<22)? (month=5, day+=10):(month=6, day-=21); break;
case 9: (day<22)? (month=6, day+=10):(month=7, day-=21); break;
case 10:(day<22)? (month=7, day+=9):(month=8, day-=21); break;
case 11:(day<21)? (month=8, day+=10):(month=9, day-=20); break;
case 12:(day<21)? (month=9, day+=10):(month=10, day-=20); break;
default: break;
}
}
if (y==3) {
year -= ( (month < 3) || ((month == 3) && (day < 21)) )? 622:621;

switch (month) {
case 1: (day<20)? (month=10, day+=11):(month=11, day-=19); break;
case 2: (day<19)? (month=11, day+=12):(month=12, day-=18); break;
case 3: (day<21)? (month=12, day+=10):(month=1, day-=20); break;
case 4: (day<21)? (month=1, day+=11):(month=2, day-=20); break;
case 5:
case 6: (day<22)? (month-=3, day+=10):(month-=2, day-=21); break;
case 7:
case 8:
case 9: (day<23)? (month-=3, day+=9):(month-=2, day-=22); break;
case 10:(day<23)? (month=7, day+=8):(month=8, day-=22); break;
case 11:
case 12:(day<22)? (month-=3, day+=9):(month-=2, day-=21); break;
default: break;
}
}
document.write(week[d]+" "+day+" "+months[month-1]+" "+ year);
}
</SCRIPT>

<TABLE align="center"><TR><TD>
<FONT face=tahoma size="2" color="#000000">
<SCRIPT>showdate()</SCRIPT>
</FONT>
</TD></TR></TABLE>
<p align=center><a title="«اسكريپتهاي رايگان جاوا در«ام جي رايانه" href="http://www.mjrayaneh.blogfa.com" target="_blank"><Font face=tahoma size=2 color=blue><b>Free Java Script</b></font></a></p>
<!--/Set Farsi date--->


تا پست بعدي باي!
 

MJ Rayaneh

Well-Known Member
بازم سلام.
اينم كد ايجاد لينك براي ذخيره كردن صفحه:
<!--Set Save--->
<!----Free script by http://www.mjrayaneh.blogfa.com----->
<script>
function mo_save () {window.document.execCommand('SaveAs')}</script>
<a href="javascript:mo_save()" class="mainlevel">ذخيره كردن صفحه</a>
<!--/save--->

باي!
 

rezsat

Member
اقا سلام.اگه شما جاوا كار هستيد يه سري به اينجا بزنيد و ببينيد مشكل منو ميتونيد حل كنيد و يا اينكه يه تقويم ماهيانه شمسي پيدا كنيد لطفا. در همين تاپيك( تقويم ماهيانه شمسي با جاوا )
 

masuod

New Member
یافتن IP Local با جاوا اسکریپت

سلام
من دنبال یک اسکریپت می گردم که آی پی کلاینت رو بهش نشون بده یه چیزی شبیه خروجی دستور Ipconfig توی کامند ویندوز !
فوری فوری !
ممنون .
 

جدیدترین ارسال ها

بالا