Allowing click on one only element

Hi there, another simple (I hope) task.

The thing is to allow clicking only once and only on one of the rectangles. That is, after clicking on one (any of the) rectangle, no more of them should be available for clicking. I guess it could be done somehow substituting <article> tags for <input> fields, in the example, and disabling all rest <input> fields after clicking on one of them. Here is the example:

http://www.sportmediamanager.com/test-rasca-gana/

Is there a simple way to get that provided the markup as it is right now?

Thanks very much in advance guys,

Whitecreek.

Hi whitecreek,

Just unbind the click event:

$(".caja-padre > div > article").on("click", function(){
  $(this).fadeOut(100);
  $(".caja-padre > div > article").off("click");
});

Hi Pullo,

Thanks for the quick answer. I tried, after a short research:

$(".caja-padre > div > article").bind("click", function(event){
  			$(this).fadeOut(100);
  			$(".caja-padre > div > article").unbind(event);
		        });

without success, which got me a bit disoriented. Now I realise I wasn’t specifing ‘click’ at all in the second argument of the function… My wrong.

Anyway, your solution is working just fine. Neat and simple. Thanks again mate.

Best regards,

Whitecreek.

Glad you got it working.
Thanks for taking the time to report back :slight_smile:

Wasn’t quite as busy this time, hehe :wink:
Cheers!!