hide( )


Hides the element and sets its hidden property to true, using an effect if specified.

The hide() function hides the element and returns a Promise that is resolved when the effect is complete and the element's hidden property has been set to true.

Note: The hide() function doesn't remove the element from the DOM. To temporarily delete an element from the DOM and prevent it from detection by SEO crawlers, use the delete() function.

To learn about the behavior of a hidden element, see the hidden property.

You can optionally apply an effect when hiding the element by providing an effectName value. You can also customize the effect by providing the optional effectOptions object.

Effects:

  • "arc"
  • "bounce"
  • "fade"
  • "flip"
  • "float"
  • "fly"
  • "fold"
  • "glide"
  • "puff"
  • "roll"
  • "slide"
  • "spin"
  • "turn"
  • "zoom"

You can also hide an element when the page loads by using the Properties and Events panel in the Editor.

Method Declaration
Copy
Method Parameters
effectNamestring

The name of the effect to play when hiding the item.


effectOptionsunion

The effect's options.

Was this helpful?
Yes
No