Bandwidth Kalkulator

Demo :




Cara membuatnya

Dari Dashboard >> Design >> Edit HTML.


Penempatannya
dibawah <body>
........
diatas </body>

<form name="bandwidth">
  <p><input type="text" name="original" size="20" value="1024" /> <select size="1" name="units">
    <option value="Bytes">Bytes</option>
    <option value="Kb">Kb</option>
    <option value="Mb">Mb</option>
    <option value="Gb">Gb</option>
  </select> <input type="button" value="Calculate" name="B1" onClick="calculate()" /></p>
</form>
<p>
<script type='text/javascript'>
//<![CDATA[

/*
Bandwidth kalkulator (http://www.javascriptkit.com/script/script2/bandwidthcal.shtml)
*/

var bytevalue=0
function calculate(){
var invalue=document.bandwidth.original.value
var selectunit=document.bandwidth.units.options[document.bandwidth.units.selectedIndex].value
if (selectunit=="Bytes")
bytevalue=invalue
else if (selectunit=="Kb")
bytevalue=invalue*1024
else if (selectunit=="Mb")
bytevalue=invalue*1024*1024
else if (selectunit=="Gb")
bytevalue=invalue*1024*1024*1024

alert (invalue+" "+selectunit+" is equal to:\n\n- "+bytevalue+" Bytes\n- "+Math.round(bytevalue/1024)+" Kb\n- "+Math.round(bytevalue/1024/1024)+" Mb\n- "+Math.round(bytevalue/1024/1024/1024)+" Gb\n")
}

//]]>
</script>
</p>



Credit : JavaScript Kit

Alhamdulillah

2 comments:


  1. Mas, saya terapkan di template baru oq ndak bisa yaa mas? terimakasih.

  2. Tadi saya coba, bisa bro... coba di cek lagi kode-kodenya, apakah sudah di copy semua dan penempatannya.

Posting Komentar


Creative Commons License
Bandwidth Kalkulator by Nano Yulianto is licensed under a Creative Commons Attribution 3.0 Unported License.
Based on a work at http://nanoyulianto.blogspot.com/2011/01/bandwidth-kalkulator.html.
Permissions beyond the scope of this license may be available at http://nanoyulianto.blogspot.com/.