Style Social Sharing Widget đẹp cho blog
Bài này mình sẽ chia sẻ một style cực đẹp của widget Social Sharing cho Blogger (xem hình trên). Sau đây là các bước thực hiện:
Bước 1: Tại trang quản trị blog, các bạn vào Mẫu > Chỉnh sửa HTML, chèn đoạn code sau vào trước thẻ ]]></b:skin>:
/* Social Sharing Widget by kjmagic.blogspot.com */
#kjsocialslide{background:#f3f3f3;
border-radius:9px;
-moz-border-radius:9px;
-webkit-border-radius:9px;
-moz-box-shadow:inset 0 0 3px #333;
-webkit-box-shadow:inset 0 0 3px #333;
box-shadow:inner 0 0 3px #333;
padding:12px 14px 12px 14px;
width:300px;position:fixed;
bottom:13px;
right:2px;
display:none;
z-index:3;
height:65px;}
Bước 2: Lưu template. Vào Bố cục, tạo một tiện ích HTML/JavaScripts tại vị trí muốn hiển thị widget và dán đoạn code bên dưới vào phần nội dung:
<!--Social Sharing Widget by kjmagic.blogspot.com-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">$(window).scroll(function(){if($(document).scrollTop()>=$(document).height()/4)$("#kjsocialslide").show("slow");else $("#kjsocialslide").hide("slow");});function closekjsocialslide(){$('#kjsocialslide').remove();$.ajax({type:"POST",url:"/facebookpage.php"});}</script>
<div style="display: none;" id="kjsocialslide">
<a style="position:absolute;top:14px;right:10px;color:#555;font-size:10px;font-weight:bold;" href="javascript:void(0);" onclick="return closekjsocialslide();">(X)</a>
<span style="font-family: Tekton Pro; font-size: 20px; margin: 10px 0; text-shadow: 1px 1px 0 #FFFFFF;">Don't forget to join our community!</span><br />
<div style="float:left; margin:15px;"><g:plusone annotation="none"></g:plusone></div>
<div style="float:left; margin:15px;"><iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fmrjan.tk&send=false&layout=button_count&width=80&show_faces=false&action=like&colorscheme=light&font=arial&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:80px; height:21px;" allowtransparency="true"></iframe></div>
<div style="float:left; margin:15px;"><a href="https://twitter.com/quocdoantrinh" class="twitter-follow-button" data-show-count="false" data-size="large" data-show-screen-name="false">Follow @hannygames</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></div>
</div>
<div class='clear'></div>
<!--/Social Sharing Widget by kjmagic.blogspot.com-->
- Chỗ mình đánh dấu màu xanh là màu nền của widget, các bạn có thể tùy chỉnh bằng mã màu HTML.
- Nếu blog của bạn đã có thư viện jQuery thì xóa đoạn màu vàng đi.
- Có thể chỉnh sửa dòng chữ màu xanh theo ý thích của bạn.
- Sửa những chỗ mình in đậm thành ID Facebook Fanpage và Twitter của bạn.
Chúc thành công !
.png)
Không có nhận xét nào: