# jquery\_effect

Source: https://zotonic.com/docs/1570/jquery_effect

URI: https://zotonic.com/id/1570

Language: en



Trigger various jQuery effects on the target element. Mostly, each of these effects have their own action as a shortcut, for example <a href="/id/doc_template_action_action_show" class="doc-reference doc-reference-action"><code>action#show</code></a>, <a href="/id/doc_template_action_action_hide" class="doc-reference doc-reference-action"><code>action#hide</code></a>.

Arguments:

- `target` selects the affected element.
- `type` is one of `show`, `hide`, `remove`, `toggle`, `set_class`, `add_class`, `remove_class`, `toggle_class`, `fade_in`, `fade_out`, `slide_down`, `slide_up`, `slide_toggle`, `slide_fade_out`, `slide_fade_in`, `disable`, `enable`, `effect`, or `animate`.
- `speed` is a duration in milliseconds or a named jQuery duration. Effects and animations default to 350 milliseconds.
- `class` is used by the class-changing types.
- `effect` and `options` configure the `effect` type.
- `options` and `easing` configure the `animate` type.
- `fadeout` makes `remove` fade the element before removing it.

Prefer a dedicated action such as `show`, `hide`, or `slide_toggle` when one is available. For example:

```django
{% button text="Toggle details" action={jquery_effect target="details" type="slide_toggle" speed=200} %}
```

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1570?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1570?language=en>)
