Reputation: 33998
I have a content editor webpart in sharepoint with the following code, However the countdown is not working. What I noticed is that this site is using an old version of jquery 1.6.3, I wonder if that might be the cause or not.
<script src="/Style%20Library/countdown/jquery.countdown.js" type="text/javascript">
<link rel="stylesheet" type="text/css" href="/Style%20Library/countdown/jquery.countdown.css" />
<script class="ms-rteForeColor-3" type="text/javascript">
$(function () {
var austDay = new Date(2013, 7 - 1, 27);
$('#countdown').countdown({until: austDay});
});
</script>
<div id="countdownBox">
<h3 class="ms-rteElement-H3 ms-rteForeColor-3">Countdown to go-live</h3>
<span class="countdown" id="countdown"></span>
</div>
Update 1
Error in firefox console. the error is flooded too many times on the console
Timestamp: 10/07/2013 08:13:21
Warning: Error in parsing value for 'filter'. Declaration dropped.
Source File: https://xx/Communities/xx/Pages/project-xx.aspx
Line: 0
Source Code:
alpha(opacity=99.00000000000007)
this is the generated html, I wonder if the css has to be in the head?
<DIV id=WebPartWPQ7 class="ms-WPBody noindex" allowDelete="false" width="100%" HasPers="false" WebPartID="c1b5cf92-534f-4d23-8cd0-8c0fbe8f541b">
<SCRIPT type=text/javascript src="/Style%20Library/countdown/jquery.countdown.js">
<link rel="stylesheet" type="text/css" href="/Style%20Library/countdown/jquery.countdown.css" />
<script type="text/javascript">
$(document).ready(function() {
var austDay = new Date(2013, 7 - 1, 27);
$('#countdown').countdown({until: austDay});
});</SCRIPT>
<DIV id=countdownBox>
<H3 class="ms-rteElement-H3 ms-rteForeColor-3">Countdown to go-live</H3><SPAN id=countdown class=countdown></SPAN></DIV></DIV>
Upvotes: 0
Views: 183
Reputation: 38140
The jsFiddle works fine: http://jsfiddle.net/Fnsgk/3
However you should add a closing script tag:
<script src="/Style%20Library/countdown/jquery.countdown.js" type="text/javascript">
</script>
Upvotes: 1