


JS determines whether the browser supports a certain CSS3 attribute_html/css_WEB-ITnose
1. Introduction
The emergence of CSS3 has made the performance of browsers more colorful. The one with the greatest impact is animation. When writing animations on a daily basis, it is necessary to determine in advance whether the browser supports it. , especially when writing CSS3 animation libraries. For example, transition animation-play-state is only supported by some browsers.
2. Detection methodThe following method can use a script to determine whether the browser supports a certain CSS3 attribute:
Js code
- /**
- * Determine whether the browser supports a certain CSS3 attribute
- * @param {String} attribute name
- * @return {Boolean} true/false
- * @version 1.0
- * @author ydr.me
- * April 4, 2014 14:47:19
- */
- function supportCss3(style) {
- var prefix = ['webkit', 'Moz', 'ms', 'o'],
- i,
- humpString = [],
- htmlStyle = document.documentElement.style,
- _toHumb = function (string) {
- return string.replace(/-(w)/g, function ($0, $1) {
- return $1.toUpperCase();
- });
- };
- for (i in prefix) humpString.push(_toHumb(prefix[i] '-' style));
- humpString.push(_toHumb(style));
- ] in htmlStyle) return true;
- return false;
- Js code
- alert(supportCss3('animation-play-state'));
- 4 , Reference materials
- http://note.rpsh.net/posts/2011/05/20/css

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Face detection and recognition technology is already a relatively mature and widely used technology. Currently, the most widely used Internet application language is JS. Implementing face detection and recognition on the Web front-end has advantages and disadvantages compared to back-end face recognition. Advantages include reducing network interaction and real-time recognition, which greatly shortens user waiting time and improves user experience; disadvantages include: being limited by model size, the accuracy is also limited. How to use js to implement face detection on the web? In order to implement face recognition on the Web, you need to be familiar with related programming languages and technologies, such as JavaScript, HTML, CSS, WebRTC, etc. At the same time, you also need to master relevant computer vision and artificial intelligence technologies. It is worth noting that due to the design of the Web side

When using Windows Shello, a supported camera cannot be found. The common reasons are that the camera used does not support face recognition and the camera driver is not installed correctly. So let's take a look at how to set it up. Windowshello cannot find a supported camera tutorial: Reason 1: The camera driver is not installed correctly 1. Generally speaking, the Win10 system can automatically install drivers for most cameras, as follows, there will be a notification after plugging in the camera; 2. At this time, we open the device Check the manager to see if the camera driver is installed. If not, you need to do it manually. WIN+X, then select Device Manager; 3. In the Device Manager window, expand the camera option, and the camera driver model will be displayed.

Does PyCharm Community Edition support enough plugins? Need specific code examples As the Python language becomes more and more widely used in the field of software development, PyCharm, as a professional Python integrated development environment (IDE), is favored by developers. PyCharm is divided into two versions: professional version and community version. The community version is provided for free, but its plug-in support is limited compared to the professional version. So the question is, does PyCharm Community Edition support enough plug-ins? This article will use specific code examples to

Pros and cons of open source software: Understanding the pros and cons of open source projects requires specific code examples In today’s digital age, open source software is getting more and more attention and respect. As a software development model based on the spirit of cooperation and sharing, open source software is widely used in different fields. However, despite the many advantages of open source software, there are also some challenges and limitations. This article will delve into the pros and cons of open source software and demonstrate the pros and cons of open source projects through specific code examples. 1. Advantages of open source software 1.1 Openness and transparency Open source software

Question: How to determine whether the date is the previous day in Go language? In daily development, we often encounter situations where we need to determine whether the date is the previous day. In the Go language, we can implement this function through time calculation. The following will be combined with specific code examples to demonstrate how to determine whether the date is the previous day in Go language. First, we need to import the time package in the Go language. The code is as follows: import("time") Then, we define a function IsYest

The relationship between js and vue: 1. JS as the cornerstone of Web development; 2. The rise of Vue.js as a front-end framework; 3. The complementary relationship between JS and Vue; 4. The practical application of JS and Vue.

jQuery is a JavaScript library widely used in web development. It provides many simple and convenient methods to operate web page elements and handle events. In actual development, we often encounter situations where we need to determine whether a variable is empty. This article will introduce several common methods of using jQuery to determine whether a variable is empty, and attach specific code examples. Method 1: Use the if statement to determine varstr="";if(str){co

As we all know, to install the win11 system, you need to ensure that the computer supports TPM2.0 and turns on secure boot. If your computer fails to install win11, it may be because secure boot is not turned on. The following are tutorials for enabling secure boot on some brands of computers. I hope it will be helpful to you. What should I do if I get a message that secure boot must be supported when upgrading to win11? 1. ASUS motherboard 1. First, we switch to Chinese, and then press F7 on the keyboard to open the advanced settings according to the prompts. 3. Then select Key Management. 2. Lenovo computers 1. For Lenovo computer models before 2020, you need to use F2 to enter the bios settings, and then select security above. 2. In the security tab, drop secureboot and change it to E
