Could you please help with some examples, how to make content in some div block inactive using javascript?
Let's say there is a button with command "Enable / Disable". And there is one div block with some text. When pushing button "Enable / Disable", is it is "Enable", you can work with content inside, but when "Disable", you can't work with content inside div block.
I imagine in order to make inactive content inside div block, we need to put another layer upon that will prevent from editing content on the content div block.
I'm getting confused how to realize this kind of feature. Any help will be appreciated.
if you want to hide a whole div from the view in another screen size. You can follow bellow code as an example.
Without using an overlay, you can use
pointer-events: none
on thediv
in CSS, but this does not work in IE or Opera.Reference
Using jquery you might do something like this:
Here's a jsFiddle example: http://jsfiddle.net/monknomo/gLukqygq/
You could also select the target div's children and add a "disabled" css class to them with different visual properties as a callout.
Here's a jsFiddle with the as an example: https://jsfiddle.net/monknomo/g8zt9t3m/