Git Product home page Git Product logo

loopcounter's Introduction

loopcounter

This is simple countdown timer using JQuery.

How to add this?

loopcounter has a dependency in JQuery. So you need to first add the JQuery in your HTML and the add the loopcounter.js which is already in js folder and the add the loopcounter('class_selector');

Add this code in HTML file. Here is a date format please follow this date format(yyyy-mm-dd hh:mm:ss)

<div class="first-counter" data-date="2018-06-08 10:20:30"><!-- Date Formate Input yyyy-mm-dd hh:mm:ss -->
	<div><span class="counter-days"></span> Days</div>
	<div><span class="counter-hours"></span> Hours</div>
	<div><span class="counter-minutes"></span> Minutes</div>
	<div><span class="counter-seconds"></span> Seconds</div>
</div>

Include this in footer of the HTML file-

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script src="./js/loopcounter.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		loopcounter('first-counter');
		//loopcounter('second-counter');
	});
</script>

loopcounter's People

Contributors

anik avatar

Stargazers

Elvis Sedic avatar Roman avatar

Watchers

James Cloos avatar  avatar

loopcounter's Issues

Plugin Flicks when loading another page

I have realized that when the page redirect to a new page and the counter is still part of the page it starts blinking and not working in the right way. I have the counter on a section on my page and there are links that load other components on the same page. When the page redirects the counter starts blinking and not working properly.

I have realized that calling the plugin this way:

		<script type="text/javascript">
			window.addEventListener('load', function () {
				loopcounter('counter-class');
			}, false);
		</script>

Make things better but it still renders incorrectly sometimes. Will really appreciate if you check on this because i really like your work here and i think it will improve the plugin. Many thanks.

SL

Service level miss

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.