SWFUpload - DOM 操作中断
有人找到解决这个问题的方法了吗?我有一个项目,客户希望 Flash 按钮中嵌入一个进度条。到目前为止,我通过隐藏 CSS 的 Div 来做到这一点,然后在文件开始上传后显示。
然后按钮被隐藏,但是当按钮被隐藏时,事件停止触发。即使我只修改 CSS 以在屏幕上移动它,这也是一样的。
Has anyone found a way around this yet? I have a project where the client wants the Flash button to have a progress bar embedded within it. So far i'm doing this by having a Div with CSS hidden and then displayed after the file has started uploading.
The Button is then hidden however when the button is hidden the event's stop firing. This is the same even I only modify the CSS to move it around the screen.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
上传时,将
helper-hidden
类添加到按钮并在完成后将其删除。您甚至可以将此类应用于您希望从视口“隐藏”的任何元素,而不影响其可见性。when you are uploading, add the
helper-hidden
class to the button and remove it when you're done. You can even apply this class to any element you wish to 'hide' from the viewport without affecting it's visibility.解决这个问题的最佳方法是对 SWFUpload div 使用 Visibility:hidden,这可以让 Flash 仍然运行并且不会中断 Flash/浏览器连接。
Best way to fix it was to use Visibility:hidden for a SWFUpload div, this lets the flash still run and doesn't break the Flash / Browser connection.
老问题又带回来了。
当我发布这篇文章时,这个问题仍然出现在 SWFUpload 2 中。
定位引起的问题。基本上,SWFUpload 将 Flash 文件放置在 SWFUpload 使用的链接之上。它初始化 onLoad 函数以来的位置。操作 DOM 后,您可能更改了位于 SWFUpload 上方的一些 dom。
测试用例:
我有一个将页面分割为 2 的 div。左侧包含 SWFUpload,右侧不包含。
两侧都包含一个按钮,用于在 SWFUpload 上方的位置添加 dom,
当用户单击“button1”时,将显示 dom1。按钮 2 相同。
当用户开始加载页面时。 SWFUPload 工作正常。然后我单击 Button1 以显示 DOM 1,然后 SWFUpload 不再工作。
再次使用按钮 2,SWFUpload 仍然有效。
另外根据我的情况 SWFUpload 也不适用于表格。
我会将此作为错误报告给 SWFUpload
Old question brought back.
This problem still appear SWFUpload 2 by the time I post this.
The problem cause by positioning. Basically the SWFUpload position a flash file on top of a Link that use by SWFUpload. It initialize the position since onLoad function. After manipulate your DOM, probably you have change some of the dom that positioned on upper of SWFUpload.
Test case:
I have a div that split page to 2. Left side contain SWFUpload, Right side does not.
Both side contain a button to add a dom on the position that upper to SWFUpload
When user click the button1, it will show dom1. Same for the Button 2.
When user start loading the page. SWFUPload works fine. I then click Button1 to show the DOM 1, then SWFUpload does not work anymore.
Again with button 2, SWFUpload still works.
Also base on my case SWFUpload also does not works on table.
I will report this as a bug to SWFUpload