已有新的寫法,請看本篇第二代!  

Pixnet加讚按鈕及FB分享按鈕可調整位置版(附使用說明)

 

--------------------------------------------------------

米團桑:「昨天阿宅文因為太長,發現整篇看完之後都沒有人會點讚,所以乾脆前後都加上」

坐飯糰:「教學要付學費嘛?」

米團桑:「此標是我下,此字是我打,若要由此學,留下迴響來!」


米團桑:「首先進入後台->部落格->側邊欄位設定」

坐飯糰:「講重點!這個大家都知道~」


Facebook讚按鈕 

米團桑:「假設放在公告版位,就點選公告版位的設定~」

Facebook讚按鈕 

米團桑:「然後填入程式碼」






<script type="text/javascript">
jQuery(document).ready(function(){
var item=new Array();
var item2=new Array();
var show=new Array();
jQuery("div.article-body").each(function(i)
{
item[i]='<iframe src="https://www.facebook.com/plugins/like.php?href='+
    encodeURIComponent(jQuery(this).parent().find("ul").find('a').attr('href'))+
    '&amp;layout=standard&amp;show_faces=true&amp;width=500&amp;action=like&amp;colorscheme=light&amp;height=20" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:20px;" allowTransparency="true"  ></iframe>'

    jQuery(this).before('<div style="margin-left:20px;margin-bottom:10px;">'+item[i]+'</div>');
});


jQuery("div.bookmark").each(function(i)
{
   
   item2[i]=jQuery(this).clone('true');
      
});




jQuery("div.forward").each(function(i)
{


   if(typeof item2[i]!="undefined"){
     jQuery(this).before(item2[i]);
  }
 show[i]='true';
});




jQuery("p.author").each(function(i)
{
if(typeof show[i]!="undefined"){
    jQuery(this).before("<div style='margin-top:5px;margin-bottom:15px;*width:400px'>"+item[i]+"</div>");
 }
});








});</script>







米團桑:「整段用力框複製貼上送出即可,讚按鈕就會出現在文章的開頭與結尾,不過如果是多篇的列表只會出現在開頭,點進去的才會出現在結尾!」

坐飯糰:「讚!那麼,這個教學會出影片版嘛!」

米團桑:「滾!」


--------------不能用的話請留言~----------------


===============只在最後加上Plurk & facebook 按鈕===========

 



<script type="text/javascript"> 
jQuery(document).ready(function() {
var push_item='<div style="text-align:right"><a type="button_count" name="fb_share" href="http://www.facebook.com/sharer.php" >分享</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript" /> <span style="margin-left:15px;text-align: center; background-color: #f37d17; width: 68px; height: 24px; color: #ffffff; cursor: pointer; border-style: outset;" title="推薦本文到Plurk噗浪去!" onclick="void(window.open(\'http://www.plurk.com/?qualifier=shares&amp;status=\' .concat(encodeURIComponent(location.href)) .concat(\' \') .concat(\'(\') .concat(encodeURIComponent(document.title)) .concat(\')\')));" onmouseover="this.style.color=\'#FFFF33\';" onmouseout="this.style.color=\'#FFFFFF\';"><span style="font-size: 8pt;"><strong>Plurk分享</strong></span></span></div>'


jQuery("div.forward").each(function(i)
{
   jQuery(this).before(push_item);
});
});
</script>



arrow
arrow
    全站熱搜

    ricebobo 發表在 痞客邦 留言(44) 人氣()