Home>Article>Web Front-end> What attributes are used in jquery

What attributes are used in jquery

青灯夜游
青灯夜游 Original
2022-05-24 14:04:25 2123browse

There are 7 properties available for jquery: 1. "jquery", which can output the version number of the jQuery library; 2. "jQuery.fx.interval", which can change the animation running rate in milliseconds; 3. "length", counts the number of elements in the jQuery object; 4. "context", etc.

What attributes are used in jquery

The operating environment of this tutorial: windows7 system, jquery3.6.0 version, Dell G3 computer.

Properties available in jquery

##Method Description context jquery Contains the version number of jQuery jQuery.fx .interval Change the animation run rate in milliseconds jQuery.fx.off Globally disable or enable all animations jQuery.support Contains a set of properties representing different browser features or vulnerabilities (mainly for internal use of jQuery) length Contains the number of elements in the jQuery object jQuery.cssNumber An object containing all CSS properties that can be used without units
Deprecated in version 1.10.Contains the original context passed to jQuery

jquery property

The string returned by the jquery property contains the version number of jQuery.

      

What attributes are used in jquery

jQuery.fx.interval property

jQuery.fx.interval property is used to change the animation running rate in milliseconds . Syntax:

jQuery.fx.interval = milliseconds;

Parameter Description Required. Specifies the animation run rate in milliseconds. The default is 13 milliseconds.
milliseconds
This property is often used to modify the number of frames per second that the animation runs. Lowering this value can make the animation run smoother in faster browsers, but doing so will impact performance and CPU.

Note: Since jQuery uses a global interval, in order for this property to take effect, the animation should no longer be running or all animations should be stopped first.

Note: This attribute is not valid in browsers that support the requestAnimationFrame attribute, such as Google Chrome 11.

Example: Run animation of
element in fewer frames

      

“div切换”按钮被按下时,我们在隐藏和显示div之间切换(默认是13毫秒)。每次“减少运行动画帧”按钮被按下,我们添加500毫秒的属性,这将导致以更少的帧运行动画(根据不同的浏览器,这可能导致动画运行流畅度低于期望)。

注意: 由于jQuery使用一个全局间隔,任何更改此属性生效,没有动画运行或者说动画都应该先停止运行(按“切换div”,然后当" div "完成动画时按“运行动画帧更少”。当动画已经停止,再次按“切换div”注意效果)。

What attributes are used in jquery

##jQuery.fx.off property

jQuery.fx.off property is used to globally disable or enable all animations. Syntax:

jQuery.fx.off = true|false;

Parameters true false The default value is false, which allows the animation to run normally. When set to true, all animation methods are disabled, which sets the element to its final state rather than displaying the effect.
Description
Specifies that animation should be disabled.
Default. Specifies that animation should be enabled.

Tip: If you need to simplify the code, you can use $.fx.off instead of jQuery.fx.off.

jQuery.support Properties

The jQuery.support property contains a set of properties that represent different browser features or vulnerabilities.

This attribute is mainly used internally by jQuery.

length property (commonly used)

The length property contains the number of elements in the jQuery object.

$(selector).length

Example:

      
  • Coffee
  • Milk
  • Soda

What attributes are used in jquery

jQuery.cssNumber property

$.cssNumber refers to all You can object without using the unit CSS property.

Tip: Used in .css() to determine if px needs to be appended to a unitless value.

[Recommended learning:

jQuery video tutorial

,web front-end video]

The above is the detailed content of What attributes are used in jquery. 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