2011-07-07 51 views
0

我刚刚为我的博客添加了一个类似按钮,首先它不起作用,但现在确实如此,但它显示在我创建的所有页面上,包括联系页面http://scheissemag.blogspot.com/p/contact.html ,这困扰我,我想隐藏它或删除div。 对于按钮的代码,我用这一个:(我<div class='post-footer-line post-footer-line2'/>后装)删除Blogger上联系人页面上的Facebook Like按钮

<div> 
<div id='fb-root'/> 
<script> 
    (function() { 
    var e = document.createElement(&#39;script&#39;); 
    e.src = document.location.protocol + &#39;//connect.facebook.net/fr_FR/all.js#xfbml=1&#39;; 
    e.async = true; 
    document.getElementById(&#39;fb-root&#39;).appendChild(e); 
    }()); 

     </script> 
     <fb:like action='like' colorscheme='light' expr:href='data:post.url' font='arial' layout='standard' send='false' show_faces='false'/> </div> 

我试着用我在这个网站上找到搜索后的代码删除:

<div id="fr-root"> (I tired LikeDiv too) 
    my div 
</div> 
<script> 
    { 
     // Remove the element from the dom 
     var Node1 = document.getElementById('likeDiv'); 
     Node1.removeChild(Node1.childNodes[0]); 
    } 
</script> 

但它总是在那里!

+0

在你的第二个示例中,div id是'fr-root',但是你将'likeDiv'传递给'getElementById'。在这篇文章中输错,或者在你的代码中输入错误(这可以解释失败)? – tomlogic

回答

0

而不是将其删除,您可以将其visible属性设置为FALSE

+0

代码已安装在主模板中,未在“页面编辑”选项中显示。 – purplerain

相关问题