jquery function not calling

425
December 30, 2016, at 3:31 PM

So I wrote this line of code to be executed upon a button spin2 click

$("#spin2").countdown().show();
$(".wheel").css({"-webkit-transform": "rotate(180deg)"

The code for countdown is not seeming to execute. It looks like this:

time = 3;
$.fn.countdown = function() {
    interval = setInterval(function() {
        time--;
        document.getElementById('Label1').innerHTML = "" + time + " seconds"
        if (time == 0) {
            // stop timer
            clearInterval(interval);
            // click
            document.getElementById('stop2').click();            
        }
    }, 1000)
}

What am I doing wrong? I assume it's something to do with my syntax

EDIT: upon completion the goal is for the code activated by pushing button stop2 to execute. The problem is, there's no execution. Code for the buttons:

<button id="spin2">Spin</button>
<button id="stop2" style="display: none;">Stop</button>
<button id="spin3" style="display: none;">Spin</button>

Another line of code which uses the function written, it's where the stop2 button appears: $("#spin2").click(function(){$("#spin2, .miss").hide();$("#stop2").show();

Rent Charter Buses Company
READ ALSO
What is the best way to implement a sequence of screens?

What is the best way to implement a sequence of screens?

I want to create a sequence of screens whereby a new screen appears on click of the current oneThe screen information will be of different dimensions and should fade in / out on click

276
HTML - retrieve the max possible width of an inline-block

HTML - retrieve the max possible width of an inline-block

I'm looking for a way to retrieve, in javascript, the max possible width of an HTML element with display: inline-blockMy goal is to insert some elements in a page generated by a CMS

375
Default Length for properties of a div tag?

Default Length for properties of a div tag?

What are the default length values for properties (specifically width, height, padding, margin) of a div tag? Is it inherited?

433