amir_red
Member
سلام دوستان.
در اين مبحث كه اولين پست من در اين فروم هست مي خوام كد قرار دادن زمان سنج دانلود رو براتون بزارم. اين كد به نوبه ي خودش يكي از بهترين كد ها در رابطه با نمايش زمان دانلود هست:
كد :
اميدوارم مورد استفاده قرار گيرد ...
موفق باشيد.
در اين مبحث كه اولين پست من در اين فروم هست مي خوام كد قرار دادن زمان سنج دانلود رو براتون بزارم. اين كد به نوبه ي خودش يكي از بهترين كد ها در رابطه با نمايش زمان دانلود هست:
كد :
<head>
<style type="text/css">
<!--
.style48 {
font-size: x-small
}
.style49 {
font-family: Tahoma
}
-->
</style>
</head>
<form method="POST" action dir="rtl">
<span lang="fa"><div>
<div>
<P class=MsoNormal dir=rtl style="text-align:center; margin-left:0cm; margin-right:0cm; margin-top:0cm; margin-bottom:0pt">
<!-- Test = OK -->
<SCRIPT LANGUAGE="JavaScript">
<!--Total Java Scripts 99 - Next Step Software-->
<!-- Begin
function MakeArray(n) {
this.length = n;
for (var i = 1; i <= n; i++) {
this = 0 }
return this
}
speedVar = new MakeArray(11);
speedVar[1] = "1.1719"
speedVar[2] = "1.7578"
speedVar[3] = "3.5156"
speedVar[4] = "6.8359"
speedVar[5] = "7.8125"
speedVar[6] = "16.6250"
speedVar[7] = "187.9883"
speedVar[8] = "1220.7031"
speedVar[9] = "3295.8984"
speedVar[10] = "5493.1641"
speedVar[11] = "18920.8984"
function compute(form, mult){
for (i=1; i < 12; i++){
if (form.size.value==null||form.size.value.length==0){
form.size.value=0;}
if (form[i+"hour"].value==null||form[i+"hour"].value.length==0){
form[i+"hour"].value=0;}
if (form[i+"minute"].value==null||form[i+"minute"].value.length==0){
form[i+"minute"].value=0;}
if (form[i+"second"].value==null||form[i+"second"].value.length==0){
form[i+"second"].value=0;}
if (mult != 0 && form.size.value != 0){
with (Math){
var speed = speedVar;
var TotalTime = ((form.size.value*mult)/speed);
var TotalHours = floor((TotalTime/3600));
var TotalHoursMod = (TotalTime%3600);
var TotalMin = floor(TotalHoursMod/60);
var TotalMinMod = (TotalHoursMod%60);
var TotalSec = floor(TotalMinMod);
form[i+"hour"].value=TotalHours;
form[i+"minute"].value=TotalMin;
form[i+"second"].value=TotalSec;
}
}
}
return;
}
// End -->
</SCRIPT>
<INPUT TYPE="HIDDEN" NAME="7second" SIZE="6"><INPUT TYPE="HIDDEN" NAME="7minute" SIZE="6"> <INPUT TYPE="HIDDEN" NAME="7hour" SIZE="6">
<CENTER>
<TABLE BORDER="1" bordercolor="#000080" style="border-width:0; border-collapse: collapse" cellpadding="0" cellspacing="0" width="360" height="164">
<TR>
<TD width="150" height="19" style="border-left: medium none #000080; border-right-style: none; border-right-width: medium; border-top: medium none #000080; border-bottom-style: none; border-bottom-width: medium">
<span lang="fa">
<font face="Tahoma" style="font-size: 8pt">
<span lang="en-us">
<font color="#000000"> </font></span><font color="#000000"> زمان مورد نياز براي
دانلود :</font></font></TD>
<TD colspan=3 width="210" height="19" style="border-left-style: none; border-left-width: medium; border-right: medium none #000080; border-top: medium none #000080; border-bottom-style: none; border-bottom-width: medium"><center>
<span lang="fa">
<p align="center" style="margin-top: 0; margin-bottom: 0"><font face="Tahoma">
<span style="font-size: 8pt">حجم فايل<b>
<INPUT NAME="size" SIZE="10" style="color: #000080; border: 1px dotted #0000FF; background-color: #F4F4FF;font-family: Tahoma">
<INPUT TYPE="button" OnClick="compute(this.form, 1)" VALUE="KB" style="font-family: tahoma; font-size: 10; color: #800000; border: 1px dotted #FF0000; background-color: #FFECEC">
<INPUT TYPE="button" OnClick="compute(this.form, 1024)" VALUE="MB" style="color: #800000; font-family: Tahoma; font-size: 10; border: 1px dotted #FF0000; background-color: #FFECEC"><span lang="en-us">
</span> </b></span></font></p>
</CENTER>
</TD>
</TR>
<TR>
<TH width="150" height="14" style="border-left: medium none #000080; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">
<p> </p>
<p><font face="Tahoma" style="font-size: 8pt; font-weight: 400">بر اساس سرعت </font>
</p>
</TH>
<TH width="76" height="14" style="border-style: none; border-width: medium">
<p> </p>
<p><font face="Tahoma" style="font-size: 8pt; font-weight: 400">ساعت </font>
</p>
</TH>
<TH width="60" height="14" style="border-style: none; border-width: medium">
<p> </p>
<p><font face="Tahoma" style="font-size: 8pt; font-weight: 400">دقيقه </font>
</p>
</TH>
<TH width="74" height="14" style="border-style: none; border-width: medium">
<p> </p>
<p><font face="Tahoma" style="font-size: 8pt; font-weight: 400">ثانيه</font></p>
</TH>
</TR>
<TR>
<TD width="150" height="20" style="border-style: none; border-width: medium">
<font face="Tahoma" style="font-size: 8pt">9.6 Kb </span>
<span lang="en-us"> </span><span lang="fa">
----------------</span><span lang="en-us">></span></font></TD>
<TD width="76" height="20" style="border-style: none; border-width: medium">
<p align="center"><font face="Tahoma"><span style="font-size: 8pt"><b>
<INPUT NAME="1hour" SIZE="6" style="border: 1 dotted #808080;font-family: Tahoma" class="style48">
</b></span></font> </TD>
<TD width="60" height="20" style="border-style: none; border-width: medium">
<p align="center"><font face="Tahoma"><span style="font-size: 8pt"><b>
<span class="style48">
<INPUT NAME="1minute" SIZE="6" style="border: 1 dotted #808080;font-family: Tahoma"></span>
</b></span></font> </TD>
<TD width="74" height="20" style="border-style: none; border-width: medium">
<p align="center"><font face="Tahoma" style="font-size: 8pt; font-weight: 700">
<span class="style48">
<INPUT NAME="1second" SIZE="6" style="border: 1 dotted #808080;font-family: Tahoma"></span></font></TD>
</TR>
<TR>
<TD width="150" height="21" style="border-style: none; border-width: medium">
<font face="Tahoma" style="font-size: 8pt">14.4 Kb<span lang="en-us">
</span><span lang="fa">
----------------</span><span lang="en-us">></span></font></TD>
<TD width="76" height="21" style="border-style: none; border-width: medium">
<p align="center"><font face="Tahoma"><span style="font-size: 8pt"><b>
<span class="style48"><span class="style49">
<INPUT NAME="2hour" SIZE="6" style="border: 1 dotted #808080;font-family: Tahoma" class="botton"></span></span>
</b></span></font> </TD>
<TD width="60" height="21" style="border-style: none; border-width: medium">
<p align="center"><font face="Tahoma"><span style="font-size: 8pt"><b>
<span class="style48">
<INPUT NAME="2minute" SIZE="6" style="border: 1 dotted #808080;font-family: Tahoma"></span>
</b></span></font> </TD>
<TD width="74" height="21" style="border-style: none; border-width: medium">
<p align="center"><font face="Tahoma" style="font-size: 8pt; font-weight: 700">
<span class="style48">
<INPUT NAME="2second" SIZE="6" style="border: 1 dotted #808080;font-family: Tahoma"></span></font></TD>
</TR>
<TR>
<TD width="150" height="21" style="border-style: none; border-width: medium">
<font face="Tahoma" style="font-size: 8pt">28.8 Kb<span lang="en-us">
</span><span lang="fa">
----------------</span><span lang="en-us">></span></font></TD>
<TD width="76" height="21" style="border-style: none; border-width: medium">
<p align="center"><font face="Tahoma"><span style="font-size: 8pt"><b>
<span class="style48">
<INPUT NAME="3hour" SIZE="6" style="border: 1px dotted #808080;font-family: Tahoma"></span>
</b></span></font> </TD>
<TD width="60" height="21" style="border-style: none; border-width: medium">
<p align="center"><font face="Tahoma"><span style="font-size: 8pt"><b>
<span class="style48">
<INPUT NAME="3minute" SIZE="6" style="border: 1 dotted #808080;font-family: Tahoma"></span>
</b></span></font> </TD>
<TD width="74" height="21" style="border-style: none; border-width: medium">
<p align="center"><font face="Tahoma" style="font-size: 8pt; font-weight: 700">
<span class="style48">
<INPUT NAME="3second" SIZE="6" style="border: 1 dotted #808080;font-family: Tahoma"></span></font></TD>
</TR>
<TR>
<TD width="150" height="21" style="border-style: none; border-width: medium">
<font face="Tahoma" style="font-size: 8pt">56 Kb<span lang="en-us">
</span><span lang="fa">
----------------</span><span lang="en-us">></span></font></TD>
<TD width="76" height="21" style="border-style: none; border-width: medium">
<p align="center"><font face="Tahoma"><span style="font-size: 8pt"><b>
<span class="style48">
<INPUT NAME="4hour" SIZE="6" style="border: 1 dotted #808080;font-family: Tahoma"></span>
</b></span></font> </TD>
<TD width="60" height="21" style="border-style: none; border-width: medium">
<p align="center"><font face="Tahoma"><span style="font-size: 8pt"><b>
<span class="style48">
<INPUT NAME="4minute" SIZE="6" style="border: 1 dotted #808080;font-family: Tahoma"></span>
</b></span></font> </TD>
<TD width="74" height="21" style="border-style: none; border-width: medium">
<p align="center"><font face="Tahoma" style="font-size: 8pt; font-weight: 700">
<span class="style48">
<INPUT NAME="4second" SIZE="6" style="border: 1 dotted #808080;font-family: Tahoma"></span></font></TD>
</TR>
<TR>
<TD width="150" height="21" style="border-style: none; border-width: medium">
<font face="Tahoma" style="font-size: 8pt">ISDN (64 Kb)<span lang="en-us">
</span></font><span lang="fa">
<font face="Tahoma" style="font-size: 8pt">----------------</font></span><font face="Tahoma" style="font-size: 8pt"><span lang="en-us">></span></font></TD>
<TD width="76" height="21" style="border-style: none; border-width: medium">
<p align="center"><font face="Tahoma"><span style="font-size: 8pt"><b>
<span class="style48">
<INPUT NAME="5hour" SIZE="6" style="border: 1 dotted #808080;font-family: Tahoma"></span>
</b></span></font> </TD>
<TD width="60" height="21" style="border-style: none; border-width: medium">
<p align="center"><font face="Tahoma"><span style="font-size: 8pt"><b>
<span class="style48">
<INPUT NAME="5minute" SIZE="6" style="border: 1px dotted #808080;font-family: Tahoma"></span>
</b></span></font> </TD>
<TD width="74" height="21" style="border-style: none; border-width: medium">
<p align="center"><font face="Tahoma" style="font-size: 8pt; font-weight: 700">
<span class="style48">
<INPUT NAME="5second" SIZE="6" style="border: 1 dotted #808080;font-family: Tahoma"></span></font></TD>
</TR>
<TR>
<TD width="150" height="19" style="border-style: none; border-width: medium">
<font face="Tahoma" style="font-size: 8pt">ISDN (128 Kb<span lang="en-us">
</span><span lang="fa">
----------------</span><span lang="en-us">></span></font></TD>
<TD width="76" height="19" style="border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom: 1px none #000080">
<p align="center"><font face="Tahoma"><span style="font-size: 8pt"><b>
<span class="style48">
<INPUT NAME="6hour" SIZE="6" style="border: 1 dotted #808080;font-family: Tahoma"></span>
</b></span></font> </TD>
<TD width="60" height="19" style="border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom: 1px none #000080">
<p align="center"><font face="Tahoma"><span style="font-size: 8pt"><b>
<span class="style48">
<INPUT NAME="6minute" SIZE="6" style="border: 1 dotted #808080;font-family: Tahoma"></span>
</b></span></font> </TD>
<TD width="74" height="19" style="border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom: 1px none #000080">
<p align="center"><font face="Tahoma" style="font-size: 8pt; font-weight: 700">
<span class="style48">
<INPUT NAME="6second" SIZE="6" style="border: 1 dotted #808080;font-family: Tahoma"></span></font></TD>
</TR>
<b>
<INPUT TYPE="HIDDEN" NAME="8hour" SIZE="6">
<INPUT TYPE="HIDDEN" NAME="8minute" SIZE="6">
<INPUT TYPE="HIDDEN" NAME="8second" SIZE="6">
<INPUT TYPE="HIDDEN" NAME="9hour" SIZE="6">
<INPUT TYPE="HIDDEN" NAME="9minute" SIZE="6">
<INPUT TYPE="HIDDEN" NAME="9second" SIZE="6">
<INPUT TYPE="HIDDEN" NAME="10hour" SIZE="6">
<INPUT TYPE="HIDDEN" NAME="10minute" SIZE="6">
<INPUT TYPE="HIDDEN" NAME="10second" SIZE="6">
<INPUT TYPE="HIDDEN" NAME="11hour" SIZE="6">
<INPUT TYPE="HIDDEN" NAME="11minute" SIZE="6">
<INPUT TYPE="HIDDEN" NAME="11second" SIZE="6">
</b>
</TABLE>
</span>
</form>
اميدوارم مورد استفاده قرار گيرد ...
موفق باشيد.
آخرین ویرایش: