第149天 怎样把整个页面中的内容设置成只读,不可编辑的状态?
readonly
1.将所有dom设置为disabled
2.搞个透明,全屏的最上层的div元素
3.想编辑,先过了我input, onfocus等事件再说
加个遮罩层,
突然想到个骚方法,绑定 input 在 focus 时立马触发 blur,嘿嘿
body {
pointer-events: none !important;
}
body { pointer-events: none !important; }
太骚了,看到的时候我都愣了,但实际上还有tab键可以切换焦点达到选中的效果
感觉要用js来操作,css打开f12把属性关掉就好啦
Most helpful comment