Friday, October 17, 2014

Timer concept javascript asp.net

In this example we have shown SetInveral   JavaScript function how to use. The following example is give below


  <span id="sptimeLeft" style="font-weight: bold; color: red"></span>

<script type="text/javascript">

             var tm = null;
                function TimerDisplay(n) {

                    tm = setInterval(countDown, 1000);

                    function countDown() {
                        n--;
                        if (n == 0) {
                            clearInterval(tm);
                        }
                        $("#sptimeLeft").html(n + " seconds Left");
                    }
                }

        $(function () {

            $(".red").on('click'function () {
               
                    TimerDisplay40);
               
                else {
                    clearInterval(tm);
                    $("#sptimeLeft").html("");
                }

            }
            );

        });
    </script>



No comments:

Post a Comment

http://blogsiteslist.com