Do more and more coding.Less and less talking.

Talking will not feed you. Coding and experience will.

I will be really happy if you ask me technical questions.

I tried your code, your style sucks, your explanation is not
 adequate, this is wrong, you can add this etc.

But I think LUG will become like that when I am 80 years old.

We will now look at how to do a simple counter using jQuery.

Counting can be done in many many ways.

I am illustrating one such.

Code:

var cnt = 0;
function counting() {
        cnt++;
        if(cnt == 10000) {
                cnt = 0;
        }
        $('p').text(cnt);
}

$(function() {
        $('h1').fadeOut(6000);
        tmr = setInterval("counting()", 200);
        $('#stop').click(function() {
                clearInterval(tmr);
                $('p').text('stopped');
        });
        $('#start').click(function() {
                tmr = setInterval("counting()", 200);
        });
        $('#reset').click(function() {
                cnt = 0;
        });
})

Data:

 <h1> Hi there this will vanish </h1>

        <p> </p>
        <input id='stop' type="button" value="Stop counting" />
        <input id='start'  type="button" value="Start counting" />
        <input id='reset'  type="button" value="Reset counter" />

Result?

http://awrdev.g3tech.in/

-- 
Gayatri Hitech
http://gayatri-hitech.com
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
ILUGC Mailing List Guidelines:
http://ilugc.in/mailinglist-guidelines

Reply via email to