Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

disable clicking of a divs element

Tags:

jquery

I have div that goes in to an edit mode... the div contains buttons, links++. In edit mode i want to disable all of these, and enable them when i exit edit mode.

Ive tried

$("#container").children().disableSelection();

but it does not work :-(

like image 620
Jason94 Avatar asked Mar 10 '11 11:03

Jason94


People also ask

How do you stop a click event in CSS?

To disable a link using CSS, pointer-events property can be used, which sets whether the element in the page has to respond or not while clicking on elements. The pointer-events property is used to specify whether element show to pointer events and whether not show on the pointer.

How do I stop a click in HTML?

To disable a HTML anchor element with CSS, we can apply the pointer-events: none style. pointer-events: none will disable all click events on the anchor element.

Can we disable a div?

Nope! Divs can't be disabled. Only form and form elems.

How do you make a div disabled using CSS?

To disable div element and everything inside with CSS, we set the pointer-events CSS property of the div to none . to disable pointer events on the div with pointer-events set to none with CSS.


1 Answers

Edit mode enter:

$("#container").children().bind('click', function(){ return false; });

Edit mode exit:

$("#container").children().unbind('click');
like image 147
Furicane Avatar answered Oct 18 '22 23:10

Furicane