Visszaszámláló 1. kódja:
<script>
var futuredate var nowdate var resulthoursraw var resulthours var resultminutesraw var resultminutes var resultsecondsraw var resultseconds var content
function setfuturedate() { var futureyear=document.future.ye.options[document.future.ye.selectedIndex].value var futuremonth=document.future.mo.options[document.future.mo.selectedIndex].value var futureday=document.future.da.options[document.future.da.selectedIndex].value futuredate=new Date(futureyear,futuremonth,futureday,0,0,0) docountdown() }
function docountdown() { caclulateresults() formatresults() displayresults() setTimeout("docountdown()",1000) }
function caclulateresults() { nowdate=new Date() resultdaysraw=(Date.parse(futuredate)-Date.parse(nowdate))/1000/60/60/24 resultdays=Math.floor((Date.parse(futuredate)-Date.parse(nowdate))/1000/60/60/24)
resulthoursraw=(resultdaysraw-resultdays)*24 resulthours=Math.floor((resultdaysraw-resultdays)*24)
resultminutesraw=(resulthoursraw-resulthours)*60 resultminutes=Math.floor((resulthoursraw-resulthours)*60)
resultsecondsraw=(resultminutesraw-resultminutes)*60 resultseconds=Math.floor((resultminutesraw-resultminutes)*60) }
function formatresults() { content="Még "+resultdays+" nap "+resulthours+" óra "+resultminutes +" perc "+resultseconds +" másodperc van hátra a kijelőlt időszakig." }
function displayresults() { if (document.all) { document.future.erd.value=content
} if (document.layers) { document.future.erd.value=content } }
</script>
<form name="future"> <select name="ye" style="font-size:8pt"> <option>év</option> <option value="2004">2004</option> <option value="2005">2005</option> <option value="2006">2006</option> <option value="2007">2007</option> <option value="2008">2008</option> <option value="2009">2009</option> <option value="2010">2010</option> <option value="2011">2011</option> <option value="2012">2012</option> <option value="2013">2014</option> <option value="2015">2015</option> <option value="2016">2016</option> </select> <select name="mo" style="font-size:8pt"> <option>hónap</option> <option value="0">Január</option> <option value="1">Február</option> <option value="2">Március</option> <option value="3">Április</option> <option value="4">Május</option> <option value="5">Június</option> <option value="6">Július</option> <option value="7">Augusztus</option> <option value="8">Szeptember</option> <option value="9">Október</option> <option value="10">November</option> <option value="11">December</option> </select> <select name="da" style="font-size:8pt"> <option>nap</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option> <option value="30">30</option> <option value="31">31</option> </select> <input type="button" onClick="setfuturedate()" value="kiszámol" style="font-size:8pt"> <input name="erd" type="text" size="70" maxlength="85"> </form>
Visszaszámláló generátor:
Katt ide!
(Köszönet érte a hitetlen .hu oldalnak :))
|