phillipw1994 Posted August 20, 2011 Share Posted August 20, 2011 I was given this code for a Download Countdown timer, similar to Rapidshares and Megaupload //implements Implements: [Options,Events], //options options: { element: 'countdown', start: 10, finish: 0, startFont: '36px', finishFont: '12px', onComplete: $empty, duration: 1000 }, //initialization initialize: function(options) { //set options this.setOptions(options); }, //get things started start: function() { this.anim(); }, //animate! anim: function() { this.options.element.set('text',this.options.start--); var fx = new Fx.Tween(this.options.element,{ duration: this.options.duration, link: 'ignore', onComplete: function() { if(this.options.start >= this.options.finish) { this.anim(); } else { this.fireEvent('complete'); } }.bind(this) }).start('font-size',this.options.startFont,this.options.finishFont); } }); /* usage */ window.addEvent('domready',function() { var cd = new CountDown({ element: $('countdown'), start: 12, finish: 0, onComplete: function() { this.options.element.set('text','Done! Your special code is: <!--?php echo rand(1000,5000); ?-->').setStyle('color','#090'); } }).start(); }); but i haven't the faintest idea on what to do with it. Does it go into PHP, Html or Javascript. I know a lot about HTML a little PHP. but i don't have a clue when it comes to Javascript codes and adding them to pages. Please Help Quote Link to comment https://forums.phpfreaks.com/topic/245271-implementing-download-coundown-code/ Share on other sites More sharing options...
gizmola Posted August 20, 2011 Share Posted August 20, 2011 It's javascript. Quote Link to comment https://forums.phpfreaks.com/topic/245271-implementing-download-coundown-code/#findComment-1259747 Share on other sites More sharing options...
phillipw1994 Posted August 21, 2011 Author Share Posted August 21, 2011 How would i make this display on a HTMl Page or PHP page. Quote Link to comment https://forums.phpfreaks.com/topic/245271-implementing-download-coundown-code/#findComment-1260012 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.