Note that there are some explanatory texts on larger screens.

plurals
  1. POFix JQuery Countdown Timer in Rails 3 Application
    text
    copied!<p>I need a countdown timer for a rails application I'm working on so I decided to use this.</p> <p><a href="http://keith-wood.name/countdown.html" rel="nofollow">http://keith-wood.name/countdown.html</a></p> <p>In the public/javascripts folder I've added jquery.countdown.js In the public/styleheets folder I've added jquery.countdown.css</p> <p>In app/views/layouts/application.html.erb I add the javascript and css files to the stylesheet and javascript tags.</p> <p>In my view I've added</p> <pre><code>&lt;script&gt; var element = '#countDownTimer'; var year = &lt;%= @deal.end.year %&gt;; var month = &lt;%= @deal.end.month %&gt;; var day = &lt;%= @deal.end.day %&gt;; setCountdownTimer(element, year, month, day); &lt;/script&gt; &lt;div id="countDownTimer"&gt;&lt;/div&gt; </code></pre> <p>which is going to be used to select with jQuery to add the timer.</p> <p>Here is my application.js file</p> <pre><code>// The following function is called once the rest of the document is fully loaded $(document).ready(function() { function setCountdownTimer(element, year, month, day) { var date = new Date(year, month, day); $(element).countdown({until: date}); } // DEALS TABS ON DEALS PAGES $("#tabs &gt; ul").tabs(); // Make the tabs. // FANCYBOX FOR GALLERY IMAGES POPUP $("a.galleryitem").fancybox(); // MEDIA ENCODER FOR PODCASTS $.mb_audioEmbedder.playerPath="/media/player.swf" //the path to audio player $.mb_videoEmbedder.defaults.width=500; $.mb_audioEmbedder.defaults.width=214; $("#media").mb_embedMovies(); $("#media").mb_embedAudio(); }); </code></pre> <p>Can anyone tell me why this doesn't work?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload