• About
  • Policy
  • Contact

Phan Anh Buổi Sáng

  • Home
  • Kiến thức IT
    • PSD
    • Blogger
  • Translate
Google
Custom Search
Trang chủ » Blogger » [ Blogger ] Hướng Dẫn Thêm Button Vào Blogspot

[ Blogger ] Hướng Dẫn Thêm Button Vào Blogspot

Unknown Labels: Blogger Leave A Comment 00:54

Bước 1 : Đầu tiên, bạn cần thêm thư viện jQuery vào blog bằng cách thêm đoạn sau vào phía dưới thẻ<head>
1
<script src='http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js'/>
Nếu bạn nào đã từng thêm thư viện jQuery vào blog rồi thì có thể bỏ qua bước này
Bước 2 : Tiếp theo, hãy thêm đoạn code dưới đây vào phía trên thẻ đóng </body>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<script type='text/javascript'>
  //<![CDATA[
  /* Facebook */
  (function(d, s, id){
       var js, fjs = d.getElementsByTagName(s)[0];
       if (d.getElementById(id)) {return;}
       js = d.createElement(s); js.id = id;
       js.src = "//connect.facebook.net/en_US/all.js";
       fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));
  window.fbAsyncInit = function() {
      // init the FB JS SDK
      FB.init({
        status     : true,                            
        xfbml      : true                              
      });
      FB.Event.subscribe('edge.create', function(href, widget) {
          $.event.trigger({
              type: "pageShared",
              url: href
          });
      });
  };
  /* Twitter */
    window.twttr = (function (d,s,id) {
    var t, js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return; js=d.createElement(s); js.id=id;
    js.src="https://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs);
    return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } });
  }(document, "script", "twitter-wjs"));
  twttr.ready(function (twttr) {
      twttr.events.bind('tweet', function (event) {
          $.event.trigger({
              type: "pageShared",
              url: event.target.baseURI
          });
      });
  });
  /* Google Plus */
  (function() {
      var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
      po.src = 'https://apis.google.com/js/plusone.js';
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
    })();
  function plusOned(obj){
      console.log(obj);
      $.event.trigger({
          type: "pageShared",
          url: obj.href
      });
  }
  /* Listen for the pageShared event */
  $(document).on('pageShared',function(e){
      if(e.url == window.location.href){
          $(".hide").show();
          $(".show").hide();
      }
  });
  //]]>
</script>
Bước 3 : Thêm đoạn code dưới đây vào phía trên thẻ  ]]></b:skin>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.hide {
  display: none;
  background: #f9f9f9;
  color: #111;
  border-radius: 5px;
  border-bottom: 4px solid #f1f1f1;
  padding: 20px;
}
.show {
  padding: 20px;
  background: #f9f9f9;
  color: #111;
  border-radius: 5px;
  border-bottom: 4px solid #f1f1f1;
  text-align: center;
 
}
.show .fb-like {
  margin-top: 0;
  top: -7px;
  position: relative;
}
.show .twitter-share-button {
  margin-right: 25px;
}

Làm sao để sử dụng ?

Để thêm button “Like to Unlock” vào bài viết, đầu tiên hãy chuyển sang chế độ soạn thảo HTML
1
Tiếp đó, điền đoạn code dưới đây vào vị trí muốn sử dụng
1
2
3
4
5
6
7
<div class="hide">
..........
</div>
<div class="show">
To unlock the content, use one of the social buttons below. Thank you for your support and love.
<span class="fb-like" data-layout="button_count" data-send="false" data-show-faces="false" data-width="90" expr:data-href="data:post.url" style="margin-right: 25px;"></span><a class="twitter-share-button" data-count="horizontal" data-related="" data-via="doiguocmoc"
    expr:data-text="data:post.title" expr:data-url="data:post.url" href="http://twitter.com/share">Tweet</a><span class="g-plusone" data-callback="plusOned" data-count="true" data-size="medium" expr:data-href="data:post.url"></span></div>
trong đó : …….. là phần nội dung sẽ bị ẩn đi
Cuối cùng, hãy xuất bản bài viết. Bây giờ, để xem phần nội dung bị ẩn đi, người dùng sẽ buộc phải like, twitter, +1 bài viết của bạn.
Chúc các bạn thành công

Bài viết liên quan

← Bài đăng mới hơn Bài đăng cũ hơn → Trang chủ
Powered by Blogger.

Các Bình Luận Gần Đây

Bài đăng phổ biến

  • Share CMND Nữ Cho Anh Em Để Unlock & Report
    COPYRIGHT : MINH HAKU IT                                               
  • [PHP] Get list username - vBulletin
    <?php // GET user function duyk_get_all_usr($link, $total_usr) { $max_page = $total_usr/100; $ma...
  • Ảnh bìa chế Phía sau một cô gái - Soobin Hoàng Sơn - Zoy Thủ Thuật #Zoy
    Đôi lúc em tránh ánh mắt của anh. vì dường như lúc nào em cũng hiểu thấu lòng anh Demo Cover Download PSD loading...
  • PhpFox 3.0.1 Cross Site Scripting
    Google Dork: Intext:"Powered By phpFox Version 3.0.1" Vendor Home : http://www.phpfox.com/  There are lots of parametrs Vulnerab...
  • [PSD] Hacker - Đặng Khắc ĐứcPSD
    Demo Click here Download Click here
  • [PSD] Share Ảnh Bìa Facebok Cho Con Gái - Zoy Thủ Thuật #Zoy
    Demo Click here Download Click here loading...
  • [PSD] Tâm trạng - Trần Văn Bảo
    Download
  • PHP sourcecode analyzer rfi sql and rce lfi
    Hi guys this is me again badmotherfucker this is a source code analyzer the about tells you what its does do. Code: <!-- ****************...
  • Priv8 symlink() 0day coded by NazZ
    Code: <?php // Symlink ByPass Tool // NaZZ // Credits to IT-Sec eval(gzinflate(str_rot13(base64_decode('Dc7HzptXAEDhx8l/xcIU0xRygYGhG...
  • SHARE CODE BOTLIKE GỌN NHẸ FULL ALL CHỨC NĂNG HOT NHẤT HIỆN NAY
    Mình sẽ share code bot like cho mọi người như đã hứa ở bài trước Một Số Chức Năng Như Sau: - Các Chức Năng AuTo AuTo Like Auto Sub Auto Shar...

Pageviews from the past week

Chuyên mục

Bài đăng phổ biến

  • Share CMND Nữ Cho Anh Em Để Unlock & Report
    Share CMND Nữ Cho Anh Em Để Unlock & Report
    COPYRIGHT : MINH HAKU IT                                               
  • [PHP] Get list username - vBulletin
    <?php // GET user function duyk_get_all_usr($link, $total_usr) { $max_page = $total_usr/100; $ma...
  • Ảnh bìa chế Phía sau một cô gái - Soobin Hoàng Sơn - Zoy Thủ Thuật #Zoy
    Ảnh bìa chế Phía sau một cô gái - Soobin Hoàng Sơn - Zoy Thủ Thuật #Zoy
    Đôi lúc em tránh ánh mắt của anh. vì dường như lúc nào em cũng hiểu thấu lòng anh Demo Cover Download PSD loading...
  • PhpFox 3.0.1 Cross Site Scripting
    PhpFox 3.0.1 Cross Site Scripting
    Google Dork: Intext:"Powered By phpFox Version 3.0.1" Vendor Home : http://www.phpfox.com/  There are lots of parametrs Vulnerab...
  • [PSD] Hacker - Đặng Khắc ĐứcPSD
    [PSD] Hacker - Đặng Khắc ĐứcPSD
    Demo Click here Download Click here
  • [PSD] Share Ảnh Bìa Facebok Cho Con Gái - Zoy Thủ Thuật #Zoy
    [PSD] Share Ảnh Bìa Facebok Cho Con Gái - Zoy Thủ Thuật #Zoy
    Demo Click here Download Click here loading...
  • [PSD] Tâm trạng - Trần Văn Bảo
    [PSD] Tâm trạng - Trần Văn Bảo
    Download
  • PHP sourcecode analyzer rfi sql and rce lfi
    Hi guys this is me again badmotherfucker this is a source code analyzer the about tells you what its does do. Code: <!-- ****************...
  • Priv8 symlink() 0day coded by NazZ
    Code: <?php // Symlink ByPass Tool // NaZZ // Credits to IT-Sec eval(gzinflate(str_rot13(base64_decode('Dc7HzptXAEDhx8l/xcIU0xRygYGhG...
  • SHARE CODE BOTLIKE GỌN NHẸ FULL ALL CHỨC NĂNG HOT NHẤT HIỆN NAY
    SHARE CODE BOTLIKE GỌN NHẸ FULL ALL CHỨC NĂNG HOT NHẤT HIỆN NAY
    Mình sẽ share code bot like cho mọi người như đã hứa ở bài trước Một Số Chức Năng Như Sau: - Các Chức Năng AuTo AuTo Like Auto Sub Auto Shar...
Google
Custom Search
Support: Facebook | Twitter | Google+ | Giới thiệu
Copyright © 2015 • Phan Anh Buổi Sáng • All Right Reserved. Template by Template Việt