Executes the content of the block after a delay of seconds. Example:
# Generates: # setTimeout(function() { # ; # new Effect.Fade("notice",{}); # }, 20000); page.delay(20) do page.visual_effect :fade, 'notice' end
Source Code
# File action_view/helpers/prototype_helper.rb, line 903 def delay(seconds = 1) record "setTimeout(function() {\n\n" yield record "}, #{(seconds * 1000).to_i})" end
<code/>and<pre/>for code samples.