I know it sounds stupid but I found the official jQuery website's description of some syntaxes are not very detailed.

For instance, I came across some codes on stackoverflow like this:

animate({width:'toggle'}, 1000)

On https://api.jquery.com/animate/, I don't see any explanation of this kind of usage (in the section of "options", I don't see anything similar to "{width:toggle}"). So is there any other place I can get more detailed descriptions of jQuery syntaxes? Or there is just something I missed on the official page?

有帮助吗?

解决方案

The jQuery documentations is as follows:

.animate( properties [, duration ] [, easing ] [, complete ] )

In your example properties === {width: 'toggle'}, which is just a Plain Object and the duration is 1000 miliseconds. The brackets indicate that the values are optional, and easing and complete are omitted.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top