重新激活视图时避免重新渲染Flash对象 [英] Avoiding re-rendering of a flash object from scratch when view is reactivated

查看:141
本文介绍了重新激活视图时避免重新渲染Flash对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在渲染一个非常繁重的Flash应用程序作为视图的一部分,我想切换之间的意见,但不一定要重新加载Flash应用程序从头开始。我希望它是隐藏。

是否有这样做的方式在烬
目前我正在实现这个使用 https://github.com/ghempton/ember-routemanager ,其中一个Flash应用程序停留在/#媒体和其他在/#发布
所以当用户去/#媒体media.swf获取加载和/#发布publishing.swf被加载到容器div。这些路由中的每一个都有一个相应的视图类,与它们相关联,呈现Flash对象标记。



过去,我用jquery来隐藏容器div但我正在寻找一个更干净的解决方案。

解决方案

听起来像你想要的功能是能够重用查看实例,它是各州的DOM。我有一些想法,可以做到这一点,不幸的是现在不可能没有一些讨厌的黑客。



另外,不幸的是与Flash对象,他们似乎得到重新渲染你在DOM中移动它们,或者如果你改变它们的可见性。从我所知道的,为了隐藏一个flash对象而不会导致重新渲染,你只能通过CSS将它移出屏幕。



更新:



下面是一个可用的jsFiddle示例: http:// jsfiddle.net/EE3B8/1



不幸的是,这种技术不适用于Flash对象,因为在DOM中移动它们将导致它们被重新加载。这将是消除昂贵的DOM创建/视图实例化的好方法。


I have a question about div caching in ember js for views.

I am rendering a really heavy flash application as a part of a view and i want to switch between views but not necessarily have to reload the flash app from scratch. I would preferably want it to be "hidden".

Is there a way of doing this in ember Currently i am implementing this using https://github.com/ghempton/ember-routemanager and one of the flash apps stay on /#media and the other on /#publishing So when user goes to /#media the media.swf gets loaded and /#publishing the publishing.swf gets loaded into the container div. Each of these routes have a corresponding view class associated to them that renders the flash object tag to be rendered.

In the past, I have used jquery to hide the container div but i am searching for a cleaner solution.

解决方案

It sounds like the feature you'd like is to be able to reuse a view instance and it's DOM across states. I have some ideas for how that could be done, unfortunately it's not possible right now without some nasty hacks.

Also, unfortunately with flash objects, they seem to get rerendered if you move them in the DOM or if you change their visibility. From what I can tell, to "hide" a flash object without causing a rerender, you can only move it off screen using CSS.

Update:

Here's a working jsFiddle example: http://jsfiddle.net/EE3B8/1

Unfortunately, that technique won't work for Flash objects, since moving them in the DOM will cause them to be reloaded. This would be a good way of eliminating expensive DOM creation/view instantiation.

这篇关于重新激活视图时避免重新渲染Flash对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆