Change background image
LOVE quotion

Bắt đầu từ 4.53' thứ Hai ngày 17/10/2011


You are not connected. Please login or register

Xem chủ đề cũ hơn Xem chủ đề mới hơn Go down  Thông điệp [Trang 1 trong tổng số 1 trang]

kẻ đương thời
kẻ đương thời Ưu tú

Cấp bậc: Ưu tú

Giới tính : Nam

Bài viết : 665

Danh vọng : 1151

Uy tín : 42

Chức năng:

  • Rút gọn những bài viết dài hơn 350px.
  • Hiệu ứng trượt khi thu gọn bài viết.
  • Có thể Bật/Tắt dễ dàng.


Hướng dẫn cho phpBB3

Bước 1: Thêm vào CSS
ACP - Display - Pictures and Colors - Colors - CSS Stylesheet:

Code:
/* Thu gọn bài viết - www.FMvi.org */
.baivietdai{overflow:hidden}
.thugon span:hover{text-shadow:1px 1px 1px #000;cursor:pointer}
.thugon{background-color:#F6FF9D;border:3px double #0668AD;clear:both;margin:0;padding:2px 10px}
.viewfull{background:url(//ssl.gstatic.com/ui/v1/zippy/arrow_down.png) no-repeat scroll 3px 7px transparent;padding:0 15px}
.viewhide{display:none;background:url(//ssl.gstatic.com/ui/v1/icons/mail/arrow_up.png) no-repeat scroll 3px 7px transparent;padding:0 15px}
.fullOff{background:url(http://i48.servimg.com/u/f48/16/58/89/73/power_11.png) no-repeat scroll 0 2px transparent;margin-top:-2px;padding:2px 5px 2px 20px}
.fullOn{display:none;background:url(http://i48.servimg.com/u/f48/16/58/89/73/power_10.png) no-repeat scroll 0 2px transparent;margin-top:-2px;padding:2px 5px 2px 20px}

Bước 2: Thêm vào javascript
ACP - Modules - HTML & JAVASCRIPT - Javascript codes management
Add a Javascript Code

  • Title * : Thu gọn bài viết dài
  • Placement : In the topics
  • Javascript Code * :


Code:
var CopyrightNoticeEn = 'Copyright ©  by FmVi. All Rights Reserved. Use, modification, and/or distribution of this script is not allowed without direct permission from baivong (gialangsangai2000@yahoo.com). This entire copyright notice must remain in the original, copied, or modified script';
var CopyrightNoticeVi = 'Bản quyền © FmVi. Giữ toàn quyền. Việc sử dụng, sửa đổi , và / hoặc phân phối mã này mà không được phép trực tiếp từ baivong (gialangsangai2000@yahoo.com) là không được phép. Toàn bộ thông báo bản quyền này phải được giữ nguyên khi sao chép, hoặc sửa đổi';
$(function () {
  $(".postbody .content").each(function () {
      if ($(this).height() >= 350) {
        $(this).after('<p class="thugon"><span class="viewfull">Xem toàn bộ</span><span class="viewhide">Thu gọn</span><span class="fullOff" style="float:right">Tắt chức năng thu gọn</span><span class="fullOn" style="float:right">Bật chức năng thu gọn</span></p>');
        $(this).addClass("baivietdai");
        $(".baivietdai").height(315);
      }
  });
  if (my_getcookie("thugonbaiviet") == "yes") {
      $(".fullOn, .viewhide").show();
      $(".fullOff, .viewfull").hide();
      $(".baivietdai").height("100%");
  }
  $(".viewfull").click(function () {
      $(this).parent().prev().height("100%");
      $(this).hide().next().show();
  });
  $(".viewhide").click(function () {
      $(this).parent().prev().animate({
        height: "315px"
      }, 1000);
      $(this).hide().prev().show();
  });
  $(".fullOff").click(function () {
      my_setcookie("thugonbaiviet", "yes", true);
      $(".baivietdai").height("100%");
      $(".fullOn, .viewhide").show();
      $(".fullOff, .viewfull").hide();
  });
  $(".fullOn").click(function () {
      my_setcookie("thugonbaiviet", "no", true);
      $(".baivietdai").animate({
        height: "315px"
      }, 1000);
      $(".fullOn, .viewhide").hide();
      $(".fullOff, .viewfull").show();
  });
});




Hướng dẫn cho punBB, Invision

Tương tự phpBB3, ở bước 2, tìm:

Code:
$(".postbody .content")

Thay bằng:

Code:
$(".postbody .post-entry")




Hướng dẫn cho phpBB2

Tương tự phpBB3, ở bước 2, tìm:

Code:
$(".postbody .content")

Thay bằng:

Code:
$(".postbody").find("div:first")

Viết bởi baivong
      

Xem chủ đề cũ hơn Xem chủ đề mới hơn Về Đầu Trang  Thông điệp [Trang 1 trong tổng số 1 trang]

Quyền hạn của bạn

Bạn không có quyền trả lời bài viết
free counters



  • Đoàn Ngọc Khánh

    mobile phone 098 376 5575


    Đỗ Quang Thảo

    mobile phone 090 301 9666


    Nguyễn Văn Của

    mobile phone 090 372 1401


    IP address signature
    Free forum | ©phpBB | Free forum support | Báo cáo lạm dụng | Thảo luận mới nhất