有趣的是,这工作了一段时间后突然停止了,AFAIK 没有任何变化。可能是浏览器缓存的事情。无论如何我的 zeroclipboard 代码:
var $j = jQuery.noConflict();
ZeroClipboard.setMoviePath( 'ZeroClipboard.swf' );
$j('document').ready(function()
{
var address = $j('#address').html();
var clip = new ZeroClipboard.Client();
clip.setText( address );
$j('#get_address_button').mouseover(function() {
clip.glue(this);
clip.addEventListener( 'oncomplete', my_complete );
});
function my_complete( client ) {
alert('The Bitcoin Address: '+address+' has been copied to your clipboard' );
}
});
还有我的html:
<div id="address" style="display: none"><?php _e($address) ?></div>
<div style="border:1px solid grey; text-align:center; padding:5px; overflow: auto;">
<b><?php echo $message ?></b>
<img src="<?php _e(WP_PLUGIN_URL) ?>/bitcoin-donations-plugin/images/bitcoin_logo<?php _e($image) ?>.png" alt="image here"/>
<div style="position:relative; width:100%;">
<div style="float:left; width:92px; height:40px; background-image:url(<?php _e(WP_PLUGIN_URL) ?>/bitcoin-donations-plugin/images/button.png);""><a href="http://www.weusecoins.com/">What is<br>Bitcoin?</a></div>
<div style="float:right; width:92px; height:40px; background-image:url(<?php _e(WP_PLUGIN_URL) ?>/bitcoin-donations-plugin/images/button.png);" id="get_address_button">Get My<br>Bitcoin Address</div>
</div>
</div>
一切正常,但 zeroclipboard 在胶水顶部创建的隐形闪光按钮(这个);div 放置在它应该在的位置以北约 25px 处。有任何想法吗?