Sign in to follow this  
Guest

Please apply this fix to the main page for MSIE 5.2.1 o

Recommended Posts

Since noone responded to my previous post, I decided to fix the code myself. In the main page's source, please modify the countdown script as follows:else if (document.all||document.getElementById)crosscount.innerHTML="" // ADDED, FDj to fix for MSIE 5.2.1 for Mac OS Xcrosscount.innerHTML=opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds left until "+occasion+closetagsThe innerHTML needs to be cleared before setting it anew to work around a bug in this version of MSIE. There are still weird effects with the script, but it's much better than it was.Thanks,Florian

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Thanks, Florian!I did note your original response and sent a couple of dispatches to folks running MacOSX (although with MSIE 5.1.x) and did indeed replicate your issue, although I had thoroughly no idea how to fix it!Many thanks for your patch. I'm applying it right now to the places where that script is used.Regards,--M

Share this post


Link to post
Share on other sites

While we're at it here goes the whole code with the fix mentioned above plus a fix which displays "1 second" instead of "1 seconds". Also fixes for the minutes, hours, and days... ;-):-rotor Dave<script language="JavaScript1.2">function setcountdown(theyear,themonth,theday){yr=theyear;mo=themonth;da=theday}setcountdown(2002,09,13)var occasion="The Flight Simulation 2002 Convention!"var message_on_occasion="See you at the Convention!"var countdownwidth='400px'var countdownheight='30px'var countdownbgcolor='navy'var opentags='

'var closetags='
'var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")var crosscount=''function start_countdown(){if (document.layers)document.countdownnsmain.visibility="show"else if (document.all||document.getElementById)crosscount=document.getElementById&&!document.all?document.getElementById("countdownie") : countdowniecountdown()}if (document.all||document.getElementById)document.write('')window.onload=start_countdownfunction countdown(){var today=new Date()var todayy=today.getYear()if (todayy < 1000)todayy+=1900var todaym=today.getMonth()var todayd=today.getDate()var todayh=today.getHours()var todaymin=today.getMinutes()var todaysec=today.getSeconds()var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysecfuturestring=montharray[mo-1]+" "+da+", "+yrdd=Date.parse(futurestring)-Date.parse(todaystring)dday=Math.floor(dd/(60*60*1000*24)*1)dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)//if on day of occasionif(dday<=0&&dhour<=0&&dmin<=0&&dsec<=1&&todayd==da){if (document.layers){document.countdownnsmain.document.countdownnssub.document.write(opentags+message_on_occasion+closetags)document.countdownnsmain.document.countdownnssub.document.close()}else if (document.all||document.getElementById)crosscount.innerHTML=""crosscount.innerHTML=opentags+message_on_occasion+closetagsreturn}//if passed day of occasionelse if (dday<=-1){if (document.layers){document.countdownnsmain.document.countdownnssub.document.write(opentags+"Occasion already passed! "+closetags)document.countdownnsmain.document.countdownnssub.document.close()}else if (document.all||document.getElementById)crosscount.innerHTML=""crosscount.innerHTML=opentags+"Occasion already passed! "+closetagsreturn}//else, if not yetelse{var s = dday + " day"if (dday != 1) s += "s"s += ", " + dhour + " hour"if (dhour != 1) s += "s"s += ", " + dmin + " minute"if (dmin != 1) s += "s"s += ", " + dsec + " second"if (dsec != 1) s += "s"s += " left until "+occasionif (document.layers) {document.countdownnsmain.document.countdownnssub.document.write(opentags+s+closetags)document.countdownnsmain.document.countdownnssub.document.close()}else if (document.all||document.getElementById)crosscount.innerHTML=""crosscount.innerHTML=opentags+s+closetags}setTimeout("countdown()",1000)}(Spacing has been added where I put in changes, just for clarification.)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this