H I O X INDIA
FREE Javascript
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Templates 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)
Español Français 中文 Deutsch
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

Java Script Source
List All
Date & Time
Calendar
Stop Watch script
Slide Show
Ad Display
Animated Image Effects
Image Effect
Mouse Effects
Color Picker Tool
Dynamic Color
Random Generator
Select All
Form Validation
Formatting Forms
Textbox Counter
Dynamic Form select
Bookmark
Window / User Info
Pagination
Security / Authenticate
Status Bar
Title Bar
Cursor Position
Country List
Calculators
Delete Repeated Values
Alphanumeric
Free Games




Download Time Calculator Script


About
Download time calculator script will help you to calculate the download time of file, folder or images.It Calculates time required to download large files with different modem speeds.


Features
a) This javascript function will calculate the download time of file, folder or images.
b) You have to pass file size as argument to compute() function.
c) It returns the download time based on the bandwidth.
d) Just copy the code into your page and use it.


Preview

Input File Size
It will take
H
If your modem is Hrs Min Sec


Code
Javascript
<!-- Script by hscripts.com -->
<style> .heading{ font-size:14px; font-family: arial, verdana, san-serif; font-weight: bold; color: black;} .subheading{ font-size:13px; font-family: arial, verdana, san-serif; color: black;} </style> <script language=javascript> var speeds = new Array(new Array("9.6","9.6"),new Array("14.4","14.4"),new Array("19.2","19.2"),new Array("28.8","28.8"),new Array("33.6","33.6"),new Array("56","56"),new Array("Single Channel ISDN(64) ","64"),new Array("Dual Channel ISDN(128)","128"),new Array("ADSL(384)","384"),new Array("S-HDSL(768)","768"),new Array("CDSL(1024)","1024")); function compute(fsize, scale) { var size = parseFloat(fsize.size.value); for (var i = 1; i < 12; i++) { var time = size * scale * 8.192 / speeds[i - 1][1]; var hours = Math.floor(time / 3600); var minutes = Math.floor((time % 3600) / 60); var seconds = Math.floor(time % 60); fsize[i + "hour"].value = hours; fsize[i + "minute"].value = minutes; fsize[i + "second"].value = seconds; } } </script>
<!-- Script by hscripts.com -->


HTML Code
<form>
<table border="4">
<tr bgcolor="#D3D3D3">
<td bgcolor="#D3D3D3">
<table><tr><td class=subheading>
Input File Size
<input type="text" name="size" size="5">
<input type="button" onClick="compute(this.form, 1)" value="KB">
<input type="button" onClick="compute(this.form, 1024)" value="MB">
</td>
<td colspan=2 class=heading><center>It will take</center>
<td align=right><a href="http://www.hscripts.com" style="color:#3D366F;text-decoration:none;font-size:13px;cursor:pointer">H</a></td>
</td>
</tr>
<tr bgcolor="D3D3D3">
<th class=heading>If your modem is</th>
<th class=heading>Hrs </th>
<th class=heading>Min</th>
<th class=heading>Sec</th>
</tr>
<script language=javascript>
for(var j=1 ;j<12;j++)
{
document.write("<tr class=subheading><td bgcolor='#fffffe'>"+speeds[j-1][0]+" Kb</td><td><input type='text' name='"+j+"hour' size='6'> </td><td><input type='text' name='"+j+"minute' size='6'> </td><td><input type='text' name='"+j+"second' size='6'></td></tr>");
}
</script>
</table>
</td></tr>
</table>
</form>

Release Date - 07-04-2008

Get free version without ©copyright link for just 5


Usage
Here we have explained with a form
a) Creating the form
<input type="text" name="size" size="5">
<input type="button" onClick="compute(this.form, 1)" value="KB">
<input type="button" onClick="compute(this.form, 1024)" value="MB">
<script language=javascript>
  for(var j=1 ;j<12;j++){
    document.write("<input type='text' name='"+j+"hour' size='6'>
    <input type='text' name='"+j+"minute' size='6'>
    <input type='text' name='"+j+"second' size='6'>");
   }
</script>
b) Copy the code into your page.
c) When the button 'KB' or 'MB' is clicked, the file size is passed as an argument to the 'compute()' function in download time calculator to calculate the download time.
d) Download time required to download large files with different modem speed is calculated inside 'compute' function and the value is displayed in the table.




License
- This javascript (misspelled as java script)/HTML code is given under GPL License
- i.e. Free use for those who use it as it is.
- Free, if your modification does not remove our copyright information and links.
- Detailed License information can be found here
- You can purchase the script if your requirements does not meet GPL License terms.


privacy policy     license     sitemap
© 2004-2005 HIOX INDIA - hioxindia.com

Others