visual_effect
- 1.0.0 (0)
- v1.1.0
- v1.1.1
- v1.1.2
- v1.1.3
- v1.1.4
- v1.1.5
- v1.1.6
- v1.2.0
- v1.2.1
- v1.2.2
- v1.2.3
- v1.2.4
- v1.2.5
- v1.2.6
- v2.0.0
- v2.0.1
- v2.0.2
- v2.0.3
- v2.1.0
- v2.2.1
- v2.3.2
- v2.3.4
- What's this?
visual_effect(name, element_id = false, js_options = {})
public
Returns a JavaScript snippet to be used on the AJAX callbacks for starting visual effects.
This method requires the inclusion of the script.aculo.us JavaScript library.
Example:
<%= link_to_remote "Reload", :update => "posts", :url => { :action => "reload" }, :complete => visual_effect(:highlight, "posts", :duration => 0.5 )
If no element_id is given, it assumes "element" which should be a local variable in the generated JavaScript execution context. This can be used for example with drop_receiving_element:
<%= drop_receving_element (...), :loading => visual_effect(:fade) %>
This would fade the element that was dropped on the drop receiving element.
You can change the behaviour with various options, see http://script.aculo.us for more documentation.

