Java Kodları
<script>
$("#send_message").on("click", function (event) {
event.preventDefault();
var data = $('input[name="message"]').val();
$.ajax({
url: "../db/config.php?islem=chatmesajgonder",
type: "POST",
data: "deger="+data,
success: function (cevap) {
document.getElementById("MESAJAT2").reset();
}
});
});
</script>
css kodları
#sohbet .content .contact-profile {
width: 100%;
height: 10px;
line-height: 60px;
background-color:#fff;
color: #000;
}
#sohbet .content .messages {
height: 300px;
min-height: calc(100% - 115px);
max-height: calc(100% - 115px);
overflow-y: scroll;
overflow-x: hidden;
}
#sohbet .content .messages::-webkit-scrollbar {
width: 8px;
background: rgba(0, 0, 0, 0);
}
#sohbet .content .messages::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.3);
}
#sohbet .content .messages ul li {
display: inline-block;
clear: both;
float: left;
margin: 0px 0px 0px 0px;
width: calc(100% - 25px);
font-size: 0.9em;
}
#sohbet .content .messages ul li.replies p {
background: #f5f5f5;
float: left;
width: 100%;
max-width: 350px;
word-wrap: break-word;
}
#sohbet .content .messages ul li p {
display: inline-block;
padding: 10px 15px;
border-radius: 20px;
max-width: 205px;
line-height: 130%;
}
#sohbet .content .message-input .wrap input {
font-family: 'PT Sans' ;
float: left;
border: none;
width: calc(100% - 80px);
padding: 11px 32px 10px 8px;
font-size: 1.5em;
background: #ffe5e5;
color: #fc3e81;
}
#sohbet .content .contact-profile {
width: 100%;
height: 60px;
line-height: 60px;
background-color: #fff;
color: =$THEME_COLOR2;?>;
}
#sohbet .content .message-input .wrap button {
float: right;
border: none;
width: 60px;
padding: 12px 0;
cursor: pointer;
background-image: linear-gradient(to right, #dae8e3, #cbe5dc, #c7e6dc, #b1e0d0, #a1dbc7);
color: #f5f5f5;
text-align: center;
margin-right: 10px;
border-radius: 20px;
}
html kodları
=$LN_CHAT_TITLE;?>(3 Seviye+)
Bu scrollbarı otomatik aşağı indirmem ve, atılan son 20 civarı mesajı veritabanından çekmem için inceleyip yardımcı olursanız sevinirim