I have a pop up <div>
element and when it appears, the content behind it changes to opacity: 0.2
to make the <div>
stand out using this line of code:
$(".main").css("opacity", "0.2");
How can I "disable" the content behind the <div>
to prevent it from being clickable using jQuery?
I have these lines of code to prevent buttons from being clickable and preventing the pointer cursor from appearing, but it doesn't fully disable the content as text can still be highlighted and there's probably more:
$("form :input").attr("disabled","disabled");
$(".main .input").css("cursor", "auto");
Is there one line of code which literally disables the page (apart from the div), rather than a different line of code for each thing (e.g stopping text from being highlighted and disabling buttons)?