开发者

Posting moving elements to the clipboard with zeroclipboard

开发者 https://www.devze.com 2023-02-25 03:30 出处:网络
Alright zeroclipboard experts, I need so开发者_StackOverflow社区me help.I have a popup context menu and I press a button on that menu to copy some text.This works fine the first time.However, when I o

Alright zeroclipboard experts, I need so开发者_StackOverflow社区me help. I have a popup context menu and I press a button on that menu to copy some text. This works fine the first time. However, when I open the menu in another place, the flash file no longer copies the text to the clipboard.

The flash movie is appearing in the correct position and disappearing correctly when the menu is closed, but it is not copying the text to the clipboard. In fact, it is copying '' to the clipboard.

Any help with how to fix this/why this is happening would be appreciated.


Alright, I found the problem. It turns out that because I was destroying the context menu, zeroclipboard was confused, even though it still acted as though it was glued to the new button with the same id.

What you need to do is destroy() the old zeroclipboard and set it equal to a new ZeroClipboard.Client(), re-glue() the clipboard, and re-create the event listeners.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号