Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top