Скрипт таймера в САФАРИ
Проблемма ...
есть скрипт таймера function setTimer() { var ids=["d","h","m",'s','ds','hs','ms','ss']; var maxDays = 2; var time = "00:00:00"; var now = new Date(); var date=now.getDate(); var year=now.getFullYear(); var month; switch(now.getMonth()) { case 0:month="January"; case 1:month="February"; case 2:month="March"; case 3:month="April"; case 4:month="May"; case 5:month="June"; case 6:month="July"; case 7:month="August"; case 8:month="September"; case 9:month="October"; case 10:month="November"; case 11:month="December"; } var daysReal=date%maxDays; var FullDate=year+","+month+","+date+"," var endOfTimer = new Date(FullDate+time);//05:00:00"); "Jun,12,2013,"+ var ms = (endOfTimer.getTime()-now.getTime()); if (ms>1) { var sec=(parseInt(ms/1000)); var days=(parseInt(sec/(24*60*60))); var secInLastDay=sec-days*24*3600; var hours=(parseInt(secInLastDay/3600)); var secInLastHour=secInLastDay-hours*3600; var minutes=(parseInt(secInLastHour/60)); var lastSec=secInLastHour-minutes*60; document.getElementById(ids[0]).innerHTML = "0 " + daysReal; document.getElementById(ids[1]).innerHTML = ((hours<10)?(hours="0 "+hours): Math.floor(hours/10)+" "+ (hours%10)); document.getElementById(ids[2]).innerHTML = ((minutes<10)?(minutes="0 "+minutes): Math.floor(minutes/10)+" "+ (minutes%10)); document.getElementById(ids[3]).innerHTML = ((lastSec<10)?(lastSec="0 "+lastSec): Math.floor(lastSec/10)+" "+ (lastSec%10)); var daysStr = "дня"; days=daysReal; if(days==0 || days >= 5) daysStr = "дней"; else if(days==1)daysStr="день"; var hourStr = "часов"; if((hours>=2 && hours<=4) || hours>=22) hourStr="часа"; else if(hours==1 || hours==21) hourStr='час'; var minStr="минут"; if(minutes%10==1 && Math.floor(minutes/10)!=1) minStr="минута"; else if ((minutes%10>=2 && minutes%10<=4) && Math.floor(minutes/10)!=1) minStr="минуты"; var secStr ="секунд"; if(lastSec%10==1 && Math.floor(lastSec/10)!=1) secStr="секунда"; else if ((lastSec%10>=2 && lastSec%10<=4) && Math.floor(lastSec/10)!=1) secStr="секунды"; document.getElementById(ids[4]).innerHTML = daysStr; document.getElementById(ids[5]).innerHTML = hourStr; document.getElementById(ids[6]).innerHTML = minStr; document.getElementById(ids[7]).innerHTML = secStr; setTimeout("setTimer()",1000); } } window.onload=setTimer; вот html <div id="timer"> <table width="336" border="0" class="center_me"> <tr> <td id="d" width="63" height="45" class="blueDigit">00</td> <td id="h" width="63" class="blueDigit">00</td> <td id="m" width="63" class="blueDigit">00</td> <td id="s" width="63" class="redDigit">00</td> </tr> <tr class="timeWords"> <td id="ds">дня</td> <td id="hs">часов</td> <td id="ms">минут</td> <td id="ss">секунд</td> </tr> </table> <p class="center_me"></p> </div> работает везде кроме САФАРИ, не пойму что не так ? Помогите профессора.... |
iskander83,
строка 26 -- месяц - день - год var FullDate= month+","+date+","+year+"," |
Рони премного благодарен
|
Часовой пояс GMT +3, время: 23:20. |