Result not like I'm expect
var clicks = 0;
$("*").click(function(event){
if(clicks == 0){ // first click
a=parseFloat(event.pageY-pageYOffset);
++clicks;
}else{ // second clik
b=parseFloat(event.pageY-pageYOffset);
$("#lable7").text(b-a); //heppen in first click, why?
clicks=0;
}
} );
I want to count distance between first and second click, and do it many times on page.
I tried some tips but
$('*').one('click',function(){
}).click(function(){
alert("heppen in first click");
});
What I'm doing wrong?