Home  >  Article  >  Web Front-end  >  css operation control to achieve disable effect

css operation control to achieve disable effect

php中世界最好的语言
php中世界最好的语言Original
2018-05-07 17:41:294628browse

This time I will bring you css operationControlTo achieve the disable effect, what are the precautions for css operation control to achieve the disable effect. The following is a practical case, let’s take a look.

Using js events can be used to prevent the default events of input, select, and checkbox , such as

event.preventDefault()
event.stopPropagation()

In fact, it can also be achieved using pure CSS, such as

input {
    pointer-events: none;
}

Then use CSS to make the input gray, and 50% transparency can achieve the disabled effect

input.disabled {
    pointer-events: none;
    opacity: 0.5;
}

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related matters on the php Chinese website article!

Recommended reading:

H5 WebWorkers multi-threaded development and use detailed explanation

H5 canvas convolution kernel image processing steps detailed explanation

The above is the detailed content of css operation control to achieve disable effect. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn