Tạo floating sticky footer bar cho blog

Hôm trước, mình đã giới thiệu với các bạn mẫu sticky bar có nút đóng nằm trên top và hôm nay mình sẽ giới thiệu một sticky bar nữa và nó sẽ nằm ở bottom.

#Có gì trong mẫu sticky bar này

1. Khung tìm kiếm, có tích hợp phần đề xuất tìm kiếm.
2. Nút chia sẻ
3. Social bookmark
4. Dịch
5. Nút đóng, sau khi đóng thì nút chia sẻ trên Facebook sẽ thay thế cho thanh này

#Thêm CSS

1. Đăng nhập Blogger
2. > Mẫu > Chỉnh sửa HTML
3. > Tìm thẻ ]]></b:skin>
4. > Dán code dưới vào trên thẻ vừa tìm được
 #custom-toolbar {
overflow: auto;
position: fixed;
background: #1B1B1B url("https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxurmS5KOiSQoBXK8rVq_eWNXTVVgVLdac7cUOq2K3Dby8qQZxhcSWZpIv_riNxdO8EgoDkktMLV4DPq8JalELAvidAB1UO5JUdplqmfbMEt-8JXtYK06zYPefKfUqcXXlk7E6jH7SvzWh/s1600/pagelist.png") repeat-x scroll 0 bottom;
font: bold 13px/17px "Helvetica Neue",Helvetica,Arial,Geneva,sans-serif;
height: 33px;
margin: 0 auto;
width: 100%;
bottom:0px;
right:0;
}
.close-toolbar {
float: right;
margin-top:6px;
padding-right: 10px;
cursor: pointer;
}
.search-text {
color: #D1D1D1;
text-align: center;
border-radius: 10px;
}

.google_translate:hover img {
filter:alpha(opacity=0.90);
-moz-opacity: 0.90;
opacity: 0.90;
border:0;
}

#Thêm Scrip

1. > Tìm thẻ </head> 
2. > Dán code dưới vào trên thẻ vừa tìm được
 <script type='text/javascript'>
// Custom Toolbar for Blogger (helplogger.blogspot.com)
//<![CDATA[
var toolbar_blogger = new Array();
var toolbar_clear = new Array();
function toolbarFloat(toolb) {
toolbar_blogger[toolbar_blogger.length] = this;
var ftrpointer = eval(toolbar_blogger.length-1);
this.pagetop = 0;
this.cmode = (document.compatMode && document.compatMode!="BackCompat") ? document.documentElement : document.body;
this.toolbsrc = document.all? document.all[toolb] : document.getElementById(toolb);
this.toolbsrc.height = this.toolbsrc.offsetHeight;
this.toolbheight = this.cmode.clientHeight;
this.toolboffset = toolbGetOffsetY(toolbar_blogger[toolbpointer]);
var toolbbar = 'toolbar_clear['+toolbpointer+'] = setInterval("toolbarFloatInit(toolbar_blogger['+toolbpointer+'])",1);';
toolbbar = toolbbar;
eval(toolbbar);
}

function toolbGetOffsetY(toolb) {
var toolbTotOffset = parseInt(toolb.mtasrc.offsetTop);
var parentOffset = toolb.toolbsrc.offsetParent;
while ( parentOffset != null ) {
toolbTotOffset += parentOffset.offsetTop;
parentOffset = parentOffset.offsetParent;
}
return toolbTotOffset;
}
function toolbarFloatInit(toolb) {
toolb.pagetop = toolb.cmode.scrollTop;
toolb.toolbsrc.style.top = toolb.pagetop - toolb.mtaoffset + "px";
}
function closeTopAds() {
document.getElementById("custom-toolbar").style.visibility = "hidden";
}
//]]>
</script>

#Thêm HTML

1. > Tìm thẻ </body> 
2. > Dán code dưới vào trên thẻ vừa tìm được
 <div id='custom-toolbar'>
<img border='0' class='close-toolbar' onClick='closeTopAds();return false;' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggJ-o7gWHogxnZBfQUM6QGd7eBS_wqQOiZ1CRStrWh5WjDTXVw0ch1KojOAmCfE6RHRfqbzSXNqjmDqGoFga_bT1hCCDMJlSAweYn7tGq9T80j9hyphenhyphenN0DLjfJiYor56ZgeyBksWJRLaJvjW/s1600/close_button.png' title='Close' width='17'/>

<table border='0' cellpadding='2'>
<tr>
<td style='padding-left:30px; padding-right:50px;'><form action='/search' id='search' method='get' name='searchForm' style='display:inline;'>
<input class='search-text' name='q' onblur='if (this.value == &quot;&quot;) this.value = &quot;Search here...&quot;;' onfocus='if (this.value == &quot;Search here...&quot;) this.value = &quot;&quot;;' size='28' type='text' value='Search here...'/></form></td>

<td style='padding-left:20px;'><a href='http://www.facebook.com/username' title='Follow on Facebook'><img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5CwQQ-PncxBJcznuuAQigFiJkhaysrCuGjVPj1jGDbf9SjHMLpAGMWIuiKQzbv9eCySBDcpVSEYr6rzP_ON80tGw3NWBbxZDQQfe_PSazpXFSuvdW90SezU7k50nsXF7lHJQrkDjaNhPb/s1600/facebook-icon.png'/></a></td>

<td><a href='http://twitter.com/username' title='Follow on Twitter'><img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipps3RNyo1zlU358RlCH3GP_cKVURvzB-htPO-aM48ePItV_ug6w9BkgLrm-R8uzRlSlXVfmVMUUUslLDfZcf991HXxjx3ig-yT6On7Hf1SKs4j-ljDVZpS8ehIRPNenTsqDziI928tSkn/s1600/twitter-icon.png'/></a></td>

<td><a expr:href='data:blog.homepageUrl + &quot;feeds/posts/default&quot;' title='Subscribe to Feed'><img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCMDNvdM9wPz7z_uynku6vgTxBXtMgXbu76wQPzIWN-VcC3kDgAlNflsTtggZsOn8PFirY_D2HwMdwnGHqvGSF63RaJTIU5fRQmrWRBWHsB-JCdohKiyshTPDM9W0fJWB2vlSleCgcOAj-/s1600/rss-feed-icon2.png'/></a></td>

<td style='padding-left:40px; padding-top: 5px;'><a class='twitter-share-button' data-count='horizontal' data-lang='en' href='http://twitter.com/share' title='Publish on Twitter'>Tweet</a><script src='http://platform.twitter.com/widgets.js' type='text/javascript'/></td>

<td><a href='http://www.facebook.com/sharer.php' name='fb_share' title='Publish on Facebook' type='button_count'>Share</a><script src='http://static.ak.fbcdn.net/connect.php/js/FB.Share' type='text/javascript'/></td>

  <td style='padding-left:60px;'><a class="google_translate" href='Javascript:void(0)' onclick='window.open(&quot;http://www.google.com/translate?u=&quot;+encodeURIComponent(location.href)+&quot;&amp;langpair=auto%7Cen&amp;hl=en&amp;ie=UTF8&quot;); return false;' rel='nofollow' title='English'><img align='absbottom' alt='English' border='0' height='24' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_7KvEP2PyecYwwh4o4nZ28c_F8KQLHTh8g2zUBdWp98s6ouX94FdRm9JkHkB1LKm6dfCSgIKehILO8S3pQdijpYW7LP00B5cmgMgZ8y-2VJPTxlAVgIyRHemF29fKnR0EYf6MP1h1Ipfw/s1600/United+Kingdom(Great+Britain).png' width='24'/></a></td>

<td><a class="google_translate" href='Javascript:void(0)' onclick="window.open(&quot;http://www.google.com/translate?u=&quot;+encodeURIComponent(location.href)+&quot;&amp;langpair=auto%7Cde&amp;hl=en&amp;ie=UTF8&quot;); return false;"><img alt="German" border="0" align="absbottom" title="German" height="24" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhar47b-hAYlFOez8MwSTO0RYNhM9xeTrKTWgiHjSVbr9Itm7nx559xrC7CyeawCFWRvJQ-t2aiKo4TfafkCGg03NuOiCMix_6ovzov_uClD3F-2pkF4nrpRq8Jo7Q3BFZGxpGIxwZq1TbZ/s1600/Germany.png" width="24"/></a></td>

<td><a class="google_translate" href='Javascript:void(0)' onclick='window.open(&quot;http://www.google.com/translate?u=&quot;+encodeURIComponent(location.href)+&quot;&amp;langpair=auto%7Cfr&amp;hl=en&amp;ie=UTF8&quot;); return false;' rel='nofollow' title='French'><img align='absbottom' alt='French' border='0' height='24' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPsACNKCuB0zTf3HersZpEqz4_lMdRrcE-XcXmHBIdCo9zA7gmUmNu_AybNSCHdqR2P5AuNrw2A7b9_MtgfCoqE71qacUWIZQmZPlzU5_ey1RdcQD3v_sQhU0yCRSthiC1S8sln2v9gdJj/s1600/France.png' width='24'/></a></td>

<td><a class="google_translate" href='Javascript:void(0)' onclick='window.open(&quot;http://www.google.com/translate?u=&quot;+encodeURIComponent(location.href)+&quot;&amp;langpair=auto%7Car&amp;hl=en&amp;ie=UTF8&quot;); return false;' rel='nofollow' title='Arabic'><img align='absbottom' alt='Arabic' border='0' height='24' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn0ExIO134cNvSFNAdIDiHLlW8xD-4CHaHTJjaVUkhWE33solBDM_On_Upou_w7QpMCKnKugxi4fRU5tBB5uCcgVr76GHz_w1N8C31_9rzCt46c4wirkn-G4PfL4vUbOro3kK6g0vkdvlE/s1600/Saudi+Arabia.png' width='24'/></a></td>

<td><a class="google_translate" href='Javascript:void(0)' onclick='window.open(&quot;http://www.google.com/translate?u=&quot;+encodeURIComponent(location.href)+&quot;&amp;langpair=auto%7Czh-cn&amp;hl=en&amp;ie=UTF8&quot;); return false;' rel='nofollow' title='Chinese Simplified'><img align='absbottom' alt='Chinese Simplified' border='0' height='24' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfwtwYKxpfXp_rUbumm381loJAW3D9wg7A8EIwtZTttkpfsnDE26u8tI2tfQdBcCRrZxDKUabpZWspB5ulGP2fBPyEMZdP4jFiBbLejyGEfN3w1WHvdWlT2gmXvrdGjw8P01u7YN7nGNwE/s1600/China.png' width='24'/></a></td>
<td><!-- code --></td></tr>
</table>
</div>
Nếu bạn không thích một thành phần nào đó thì hãy xóa code của thành phần đó trong cặp thẻ <td> (thẻ <td> có thể hơi khác ) và </td>. Tương tự, nếu bạn muốn thêm một thành phần nào đó thì chỉ cần dán code của thành phần đó vào cặp thẻ <td></td>.

Comments