Administrator Administrator
Đến từ : OnlineWorld Tham Gia : 20/12/2011 Posts : 168 Points : 542 Thanked : 3 Tuổi : 26 Lời Muốn Nói : Mình Chỉ Cần 4 Điều: 1 Vợ...2 Con...3 Lầu...4 Bánh
| Tiêu đề: ChatBox VĐS ver1 [nhanh, gọn, nhẹ] Thu Feb 09, 2012 7:07 pm | |
| Cho mọi phiên bản Hướng dẫn: Thêm vào CSS: - Code:
-
.chatvds_menu { display: inline; cursor: pointer; padding: 5px; background-color: #333; color: #ffff00; text-align: center; border:1px solid #999; } .chatvds_menu:hover { background-color: #000; } .thongdiep_chat { position: fixed; bottom: 30px; right: 80px; } .anhientuychinh_chat { display: none; padding: 5px; margin-right: 5px; background: #000; border:1px solid #999; } .tuychinh_chat { z-index: 999; height: 20px; position: fixed; bottom: -1px; right: 5px; font-family: Tahoma, Arial; font-size: 12px; font-weight: bold; } #chatvds { background-image: url("http://i48.servimg.com/u/f48/13/58/60/43/mainco13.png"); z-index: 999; position: fixed; right:5px; bottom: 30px; width: 50%; height: 50%; margin: 0px; padding: 0px; display:none; border:1px solid #999; } #mes_chatvds, #onl_chatvds, #away_chatvds {color: #ff0000;} Javascript [In all the pages] - Code:
-
if (my_getcookie('check_loginchat')!='off') { setTimeout('chatvds_login_on();',2000); } else { $('.autologinchatvds').removeAttr('checked'); };
function trangthai_chatvds() { old_tn = my_getcookie('old_messenger'); new_tn = $('#chatvds').contents().find('#chatbox p').length; new_messenger = parseInt(new_tn) - parseInt(old_tn); if ($('#chatvds').contents().find('#chatbox_option_co').css('display')!='none') {new_messenger = 'Off';} else if ((new_messenger < 0)||($('#chatvds').css('display')!='none')) {new_messenger = '?';};
$('#mes_chatvds').html(new_messenger);
onl = $('#chatvds').contents().find('#chatbox_members ul:eq(0) li'); away = $('#chatvds').contents().find('#chatbox_members ul:eq(1) li'); if (away[0]) { $('#onl_chatvds').html(onl.length); $('#away_chatvds').html(away.length); } else { tt = $('#chatvds').contents().find('#chatbox_members h4').text(); if (tt == 'Online') {$('#onl_chatvds').html(onl.length);$('#away_chatvds').html('0');}; if (tt == 'Away') {$('#onl_chatvds').html('0');$('#away_chatvds').html(onl.length);}; };
if ($('#chatvds').css('display')!='none' && $('#chatvds').contents().find('#chatbox_option_disco').css('display')!='none'){luutru_tn();};
if (new_messenger != 'Off'){setTimeout('trangthai_chatvds();',3000);}; };
function chatvds_login(){ $('#chatvds').slideToggle(function(){ if ($('#chatvds').css('display')!='none'){chatvds_login_on();}; if ($('#chatvds').contents().find('#chatbox_option_disco').css('display')!='none'){luutru_tn();}; }); };
function chatvds_login_on(){ if ($('#chatvds').contents().find('#chatbox_option_co').css('display')!='none') {$('#chatvds')[0].contentWindow.CB_disconnect();}; setTimeout('trangthai_chatvds();',2000); }; function luutru_tn(){ old_messenger = $('#chatvds').contents().find('#chatbox p').length; my_setcookie('old_messenger',old_messenger, 1); };
function hien_tuychinh(){ $('.anhientuychinh_chat').css('display','inline'); if ($('.autologinchatvds').attr('checked')){my_setcookie('check_loginchat','on', 1);} else {my_setcookie('check_loginchat','off', 1);}; };
function an_tuychinh(){$('.anhientuychinh_chat').css('display','none');}; Portal & Widgets: Forum widgets management: Tạo mới một widget và cho cái này vào. [Nhớ đặt lên Forum widgets management nha] - Code:
-
<div class="tuychinh_chat" onmouseover="hien_tuychinh();" onmouseout="an_tuychinh();"><div class="anhientuychinh_chat"> <input class="autologinchatvds" type="checkbox" checked="checked" /><span class="gensmall"> Auto Login</span> </div><div class="chatvds_menu" style="display:inline;" onclick="chatvds_login();">Chat VĐS [<span id="mes_chatvds">Off</span>] - Online [<span id="onl_chatvds">?</span>] Away [<span id="away_chatvds">?</span>]</div> </div> <iframe id="chatvds" src="/chatbox/index.forum?archives=1"></iframe> | |
|