Firefox 中的脚本效果.slideup 生涩
我有一个简单的 Effect.SlideUp("div_name") 在 Rails 应用程序中使用 scriptaculous。
正如这个人提到的(http://goingspare.wordpress.com/2007/08/03/fix-jerky-scriptaculous-scriptaculous-animation-effects/),我在这个 div 中放置了一个 div,一切都很好......铬合金。
然而,在 Firefox 中,div 是不稳定的并且看起来很丑。关于如何解决这个问题有什么建议吗?我应该寻找 JQuery 吗?
代码如下:
New thread | New comment New comment
<div id="create_thread" style="display:none">
<div id="new_thread_or_comment_inner">
New thread <br />
<% remote_form_for :commentthread, :url => { :action => 'createthread' } do |f| %>
<textarea name="commentthread[text]" id="commentthread_text" >
</textarea>
<a href="javascript:cancelThread()" class="button">Cancel</a>
<input type="submit" value="Submit" id="submit" />
<% end %>
</div>
</div>
create_thread div 使用 Effect.SlideDown('create_thread', { period: 0.3 }); 向下滚动但是“新话题|新评论新评论”行到处跳动,也许我需要一些缓冲?我已经清空了 div 但仍然没有运气。
干杯,
懒惰型
I have a simple Effect.SlideUp("div_name") using scriptaculous in a rails app.
I placed a div within this div as mentioned by this guy (http://goingspare.wordpress.com/2007/08/03/fix-jerky-scriptaculous-scriptaculous-animation-effects/) and everything works great ... in Chrome.
However, in Firefox the div is jerky and looks ugly-assed. Any suggestions on how to solve this? Should I be looking to JQuery?
Here is the code:
New thread | New comment New comment
<div id="create_thread" style="display:none">
<div id="new_thread_or_comment_inner">
New thread <br />
<% remote_form_for :commentthread, :url => { :action => 'createthread' } do |f| %>
<textarea name="commentthread[text]" id="commentthread_text" >
</textarea>
<a href="javascript:cancelThread()" class="button">Cancel</a>
<input type="submit" value="Submit" id="submit" />
<% end %>
</div>
</div>
The create_thread div scrolls down with Effect.SlideDown('create_thread', { duration: 0.3 }); but the "New thread | New comment New comment " line bounces all over the place, maybe I need some buffer? I have emptied the div but still no luck.
Cheers,
Slothistype
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在 Firefox 和所有浏览器中使用 Jquery 成功制作了幻灯片。它运作得很好。 http://api.jquery.com/slideUp/。除非你需要脚本中的某些东西,否则我会尝试使用 Jquery。
http://www.ruby-forum.com/topic/116173 看起来像其他人也遇到了这样的问题,你是不是在那个div里加载了很多东西?我在 jquery 中也没有遇到过大型幻灯片动画的任何问题。
I have had success with slides with Jquery in Firefox and all browsers. It works very well. http://api.jquery.com/slideUp/. Unless you need certain things in scriptaculous, id give Jquery a go.
http://www.ruby-forum.com/topic/116173 seems like someone else had a problem like this too, are you loading a lot of things in that div? I have not had any problems with large slide animations either in jquery.
我通过将帧速率降低到 15
, fps:15 来解决这个问题}
I fixed this by decreasing the framerate to 15
, fps:15 }