我有一个正在由periodically_call_remote更新的div。
当这个div更新时,我希望它淡入。我知道prototype可以处理这个问题,但我不确定如何处理。
例如:
periodically_call_remote(:url =>‘=>’,:periodically_call_remote => '5',:update => 'ticker')
When this content is updated I want it to fade in and fade out so the transitions looks smooth.发布于 2009-12-29 18:56:26
使用回调来调用一些处理淡入淡出的javascript。
periodically_call_remote(:url => 'update', :frequency => '5',
:update => 'ticker',
:before => "fadeOut();", :complete => "fadeIn();")..。或者类似的东西
请参阅documentation:
CALLBACKS = Set.new([ :create, :uninitialized, :loading, :loaded, :interactive, :complete, :failure, :success ] + (100..599).to_a)
AJAX_OPTIONS = Set.new([ :before, :after, :condition, :url, :asynchronous, :method, :insertion, :position, :form, :with, :update, :script, :type ]).merge(CALLBACKS)要做fadeIn和out,prototype或jQuery将会做得很好。
https://stackoverflow.com/questions/1973906
复制相似问题