Quên mật khẩu?

Ẩn quảng cáo

 

 [Codes] Thu gọn bài viết và chữ ký

Go down 
Tác giảThông điệp
admin
[—»Sói™~]-[Ðại Ma Ðầu]
[—»Sói™~]-[Ðại Ma Ðầu]
admin


Giới tính Giới tính : Nam Virgo
Chinese zodiac Chinese zodiac : Horse
Bài viết Bài viết : 1042
Xu Xu : 158
Thanked Thanked : 650
Sinh Nhật Sinh Nhật : 20/09/1990
Tham Gia Tham Gia : 15/07/2011
Tuổi Tuổi : 34
Yahoo Yahoo : Hà Nội
Nghề Nghiệp Nghề Nghiệp : Giáo Sư
Status Status : hgfggggggggggggg

Character sheet
Tài Sản:

[Codes] Thu gọn bài viết và chữ ký   Empty
Bài gửiTiêu đề: [Codes] Thu gọn bài viết và chữ ký    [Codes] Thu gọn bài viết và chữ ký   EmptyTue Oct 25, 2011 7:49 pm

Chức năng của code này là thu gọn bài viết dài
hơn 500px lại, đồng thời hiện một nút Chi tiết.
Khi
click vào nút này thì bài viết sẽ hiển thị toàn bộ và nút bấm cũng mất
đi.
Với chữ ký thì code sẽ ẩn phần chữ ký dài hơn 300px, khi rê chuột
vào sẽ hiện kích thước thật, và trở lại kích thước thu gọn khi rê chuột
ra ngoài.
Demo:
[You must be registered and logged in to see this link.]
ACP - Modules - HTML &
JAVASCRIPT - Javascript codes management:


Title:
Thu gọn bài viết và chữ ký
Placement: In
the topics
Javascript Code: Tuỳ theo phiên
bản đang dùng để lấy code thích hợp

phpBB2:


Code:
    $(function(){$("div.postbody
    div:not('.cont_code')").each(function(){var
    $baivietdai=$(this);if($(this).height()>500){$(this).css({'overflow':'hidden','max-height':'300px'});$('<br/><button
    style="float:right; padding:1px" class="baivietquadai"><img
    title="Xem bài viết chi tiết" src
    ="http://i48.servimg.com/u/f48/16/58/89/73/more10.gif" alf="chi
    tiết"/></button>').insertAfter(this);$('.baivietquadai').click(function(){$baivietdai.css({'overflow':'hidden','max-height':'100%'});$(this).remove()})}});$('div.signature_div').each(function(){if($(this).height()>350){$('div.signature_div
   
    img').css('max-width','600px');$(this).css({'overflow':'hidden','max-height':'250px','max-width':'100%'});$(this).hover(function(){$(this).css({'overflow':'hidden','max-height':'100%','max-width':'100%'})},function(){$(this).css({'overflow':'hidden','max-height':'250px','max-width':'100%'})})}})});

phpBB3
Code:
    $(function(){$("div.content").each(function(){var
   
    $baivietdai=$(this);if($(this).height()>500){$(this).css({'overflow':'hidden','max-height':'300px'});$('<br/><button
    style="float:right; padding:1px" class="baivietquadai"><img
    title="Xem bài viết chi tiết" src
    ="http://i48.servimg.com/u/f48/16/58/89/73/more10.gif" alf="chi
    tiết"/></button>').insertAfter(this);$('.baivietquadai').click(function(){$baivietdai.css({'overflow':'hidden','max-height':'100%'});$(this).remove()})}});$('div.signature_div').each(function(){if($(this).height()>350){$('div.signature_div
   
    img').css('max-width','600px');$(this).css({'overflow':'hidden','max-height':'250px','max-width':'100%'});$(this).hover(function(){$(this).css({'overflow':'hidden','max-height':'100%','max-width':'100%'})},function(){$(this).css({'overflow':'hidden','max-height':'250px','max-width':'100%'})})}})});

punBB:
Code:
    $(function(){$("div.entry-content").each(function(){var
   
    $baivietdai=$(this);if($(this).height()>500){$(this).css({'overflow':'hidden','max-height':'300px'});$('<br/><button
    style="float:right; padding:1px" class="baivietquadai"><img
    title="Xem bài viết chi tiết" src
    ="http://i48.servimg.com/u/f48/16/58/89/73/more10.gif" alf="chi
    tiết"/></button>').insertAfter(this);$('.baivietquadai').click(function(){$baivietdai.css({'overflow':'hidden','max-height':'100%'});$(this).remove()})}});$('div.sig-content').each(function(){if($(this).height()>350){$('div.signature_div
   
    img').css('max-width','600px');$(this).css({'overflow':'hidden','max-height':'250px','max-width':'100%'});$(this).hover(function(){$(this).css({'overflow':'hidden','max-height':'100%','max-width':'100%'})},function(){$(this).css({'overflow':'hidden','max-height':'250px','max-width':'100%'})})}})});


Invision:
Code:
    $(function(){$("div.post-entry").each(function(){var
   
    $baivietdai=$(this);if($(this).height()>500){$(this).css({'overflow':'hidden','max-height':'300px'});$('<br/><button
    style="float:right; padding:1px" class="baivietquadai"><img
    title="Xem bài viết chi tiết" src
    ="http://i48.servimg.com/u/f48/16/58/89/73/more10.gif" alf="chi
    tiết"/></button>').insertAfter(this);$('.baivietquadai').click(function(){$baivietdai.css({'overflow':'hidden','max-height':'100%'});$(this).remove()})}});$('div.signature_div').each(function(){if($(this).height()>350){$('div.signature_div
   
    img').css('max-width','600px');$(this).css({'overflow':'hidden','max-height':'250px','max-width':'100%'});$(this).hover(function(){$(this).css({'overflow':'hidden','max-height':'100%','max-width':'100%'})},function(){$(this).css({'overflow':'hidden','max-height':'250px','max-width':'100%'})})}})});

Tùy chỉnh:
Code:
    $(function(){$(".noidungbaiviet").each(function(){var
   
    $baivietdai=$(this);if($(this).height()>500){$(this).css({'overflow':'hidden','max-height':'300px'});$('<br/><button
    style="float:right; padding:1px" class="baivietquadai"><img
    title="Xem bài viết chi tiết" src
    ="http://i48.servimg.com/u/f48/16/58/89/73/more10.gif" alf="chi
    tiết"/></button>').insertAfter(this);$('.baivietquadai').click(function(){$baivietdai.css({'overflow':'hidden','max-height':'100%'});$(this).remove()})}});$(".noidungchuky").each(function(){if($(this).height()>350){$('.noidungchuky
   
    img').css('max-width','600px');$(this).css({'overflow':'hidden','max-height':'250px','max-width':'100%'});$(this).hover(function(){$(this).css({'overflow':'hidden','max-height':'100%','max-width':'100%'})},function(){$(this).css({'overflow':'hidden','max-height':'250px','max-width':'100%'})})}})});

Đối với những forum có
chỉnh sửa Templates (phpBB2, punBB). Nếu không dùng được các code đã
chia sẽ thì các bạn có thể tự điều chỉnh bằng code tùy chỉnh này.
ACP - Display - Templates - viewtopic_body:
phpBB2: Tìm trong viewtopic_body:
Code:
    {postrow.displayed.MESSAGE}
Thay bằng
Code:
    <div
    class="noidungbaiviet">{postrow.displayed.MESSAGE}</div>
Tìm
Code:
{postrow.displayed.SIGNATURE}
Thay bằng
Code:
    <div
    class="noidungchuky">{postrow.displayed.SIGNATURE}</div>
punBB:
Tìm trong viewtopic_body:
Code:
    {postrow.displayed.MESSAGE}[table width="90%" align="center" border="0" cellpadding="0" cellspacing="1"][tr][/tr][/table]
Thay bằng
Code:
    <div
    class="noidungbaiviet">{postrow.displayed.MESSAGE}</div>
Tìm
Code:
    {postrow.displayed.SIGNATURE_NEW}
Thay bằng
Code:
    <div
    class="noidungchuky">{postrow.displayed.SIGNATURE_NEW}</div>
Về Đầu Trang Go down
https://itvui.123.st
 
[Codes] Thu gọn bài viết và chữ ký
Về Đầu Trang 
Trang 1 trong tổng số 1 trang
 Similar topics
-
» [Codes] Làm bảng nổi, khung chú ý trong bài viết
» [Codes] Vạch ngăn cách giữa các bài viết
» [Codes]Trang trí phần thống kê bài viết và thành viên
» [Codes] Chọn nội dung Codes cho FM Ver.2.1
»  Code tự động ghi nguồn gốc bài viết khi bài viết bị copy

Permissions in this forum:Bạn không có quyền trả lời bài viết
Kênh thông tin giải trí dành cho teen việt :: *`+`* Mã Nguồn *`+`* :: Thủ Thuật Forumotion :: Code-
Chuyển đến