我一直在编写这段代码,为ShareThis实现一个可点击的“分享”按钮,而不是当用户将鼠标悬停在按钮上时弹出ShareThis窗口的代码。使其工作的关键是onmouseover:false设置:
<script language="javascript" type="text/javascript">
var object = SHARETHIS.addEntry({
title: "<?php the_title(); ?>",
url: "<?php the_permalink(); ?>"},
{button:false,onmouseover:false});
document.write('<span id="<?php the_title(); ?>"><a href="javascript:void(0);">Share</a></span>');
var element = document.getElementById("<?php the_title(); ?>");
object.attachButton(element);
</script>问题是onmouseover:false设置导致关闭按钮(X)在弹出窗口中停止工作(各种ShareThis控制所有工作)。有没有什么变通方法可以让这个功能重新工作起来?
发布于 2012-06-29 12:16:19
我在属性列表中添加了popup:true,如下所示:
var object = SHARETHIS.addEntry({
title: "<?php the_title(); ?>",
url: "<?php the_permalink(); ?>"},
{button:false,onmouseover:false,popup:true});这会使漂亮的ShareThis弹出框出现在一个完全独立的窗口中。它不是很优雅,但它是有效的。我会把这个放几天,如果没有其他人建议重新启用弹出窗口上的关闭按钮,那么我会接受这个作为答案。
发布于 2012-06-29 11:58:17
检查你的代码
var object = SHARETHIS.addEntry({
title: "<?php the_title(); ?>",
url: "<?php the_permalink(); ?>"}, <----
{button:false,onmouseover:false <----
});报价不平衡
https://stackoverflow.com/questions/11255807
复制相似问题