zero clipboard system requirement

97 views Asked by At

I want to use ZeroClipboard.js in my code .In GitHub website there is a sentence : "Due to browser and Flash security restrictions, this clipboard injection can ONLY occur when the user clicks on the invisible Flash movie.A simulated click event from JavaScript will not suffice as this would enable clipboard poisoning." what does it means ? should I install Flash Player 11 in my system? because the click event for button is not working . I cant understand whats the flash movie here ???

1

There are 1 answers

0
Mazzu On

If you want zclip to work in all browsers, You might try to change Z-index or add a doctype to the page.

First case: (Z-index)

See the source code of jquery.zclip.js, you will find the following:

// float just above object, or zIndex 99 if dom element isn't set

var zIndex = 99;
if (this.domElement.style.zIndex) {
zIndex = parseInt(this.domElement.style.zIndex, 10) + 1;
}

so if set the zindex of the zclip div, you must set calling domelment's zindex, like this:

<a href="##" style="z-index:10000">copy to clipboard</a>

Second case: (doctype)

Clicking the flash to copy to clipboard would not function properly in IE. I fixed this by adding a doctype to the page. For me this fixed my issue:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Hope to help you!