mirror of
				https://github.com/dawidolko/Website-Templates.git
				synced 2025-10-27 16:03:10 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			31 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| /*
 | |
| Author: WebThemez
 | |
| Author URL: http://webthemez.com
 | |
| License: Creative Commons Attribution 3.0 Unported
 | |
| License URL: http://creativecommons.org/licenses/by/3.0/
 | |
| */
 | |
| $( function() {
 | |
| // Add background image
 | |
| 	$.backstretch('images/road2.jpg');
 | |
| 	var endDate = "December  27, 2014 15:03:25";
 | |
| 	$('.countdown.simple').countdown({ date: endDate });
 | |
| 	$('.countdown.styled').countdown({
 | |
| 	  date: endDate,
 | |
| 	  render: function(data) {
 | |
| 		$(this.el).html("<div>" + this.leadingZeros(data.days, 3) + " <span>days</span></div><div>" + this.leadingZeros(data.hours, 2) + " <span>hrs</span></div><div>" + this.leadingZeros(data.min, 2) + " <span>min</span></div><div>" + this.leadingZeros(data.sec, 2) + " <span>sec</span></div>");
 | |
| 	  }
 | |
| 	});
 | |
| 	$('.countdown.callback').countdown({
 | |
| 	  date: +(new Date) + 10000,
 | |
| 	  render: function(data) {
 | |
| 		$(this.el).text(this.leadingZeros(data.sec, 2) + " sec");
 | |
| 	  },
 | |
| 	  onEnd: function() {
 | |
| 		$(this.el).addClass('ended');
 | |
| 	  }
 | |
| 	}).on("click", function() {
 | |
| 	  $(this).removeClass('ended').data('countdown').update(+(new Date) + 10000).start();
 | |
| 	});
 | |
| 
 | |
| });
 |