Zaloguj | Zarejestruj | FAQ
Anonymous

Countdown event code

+ Odpowiedz

Posty: 3 Strona 1 z 1


Countdown event code

przez suzalex » Śr lut 05, 2014 11:17 pm

I don't know anything about codes and need help with a code. This is what I want the code to look like: october 11, 2014 • 248 days to go!
and this is what I'm getting: october 11, 2014 248 days to go! I don't get the little dot that's in between the year and the 248. I would also like to change the color of the font.

This is the code I copied:
</h1>
<div id="text_date">
<div id="ctl00_ctl00_ctl00_cphUWGlobal_PageContent_pnlDateAndCountdownContainer">

<span class="date">

<span id="ctl00_ctl00_ctl00_cphUWGlobal_PageContent_EventDate_lblEventDateHeader">October 11, 2014</span>

</span>
<img src="http://www.xoedge.com/uw/spacer.gif" class="divider" alt="" />
<span class="divider-partner" style="display:none">&#8226;</span>
<span class="countdown">

<span id="ctl00_ctl00_ctl00_cphUWGlobal_PageContent_EventCountdown_lblEventCountdownHeader">248 days to go!</span>

</span>
Avatar użytkownika

suzalex

  • Posty: 1
  • Dołączył(a): Śr lut 05, 2014 11:07 pm

Re: Countdown event code

przez XainPro » Cz lut 06, 2014 6:19 pm

You can try this but it's static example means it will not change according to date by it's own
Kod: Zaznacz cały
<span style="color:red; font-weight:bold; font-size:16px;">
October 11, 2014 &#8226; 248 days to go!
</span>


if you need dynamic example let me know ;)
Avatar użytkownika

XainPro

  • Posty: 3933
  • Dołączył(a): Pt lut 17, 2012 8:10 pm

Re: Countdown event code

przez XainPro » Cz lut 06, 2014 6:26 pm

ok here is dynamic 1 keep it as bonus :)

Kod: Zaznacz cały
<span style="color:red; font-weight:bold; font-size:16px;">
<script type="text/javascript">
today = new Date();
BigDay = new Date("October 11, 2014");
msPerDay = 24 * 60 * 60 * 1000 ;
timeLeft = (BigDay.getTime() - today.getTime());
e_daysLeft = timeLeft / msPerDay;
daysLeft = Math.floor(e_daysLeft);
document.write("October 11, 2014 &#8226; " + daysLeft + " days to go!");
</script>
</span>
Avatar użytkownika

XainPro

  • Posty: 3933
  • Dołączył(a): Pt lut 17, 2012 8:10 pm


+ Odpowiedz

Strona 1 z 1