Hello I have a feature that makes me the click function, and so far so good
$('.punta').click(function() {
var value = $(this).val();
$.ajax({
type: "POST",
url: "/clickButton",
data: "value=" + value,
dataType: "html"
});
});
now what I would do is make it available only if certain controls are successful
to give a practical example
$(".punta").hover(
function () {
if(qualcosa){
//MAKE AVAILABLE THE CLICK OF FUNCTION BEFORE
}
},
function () {
blabla
}
);
here is a thing I would do,
I tried to give a name to the function (the first) tip
function provaclick(){
$('.punta').click(function() {
bla bla
and then put the name of the function inside the if statement, but I do not know why clicking ONCE, and as if I click 3 or 4 times (I have seen on firebug)
so I think I should declare the function in another way such
$. function na thing but I just can not fix
someone can give me a hand? thanks
You can change elements css classes for achieving that…