Jquery based website chat implementation

by barkkathulla 2013-07-06 14:49:55

The following script shows alerts (play option) in chat system in any website.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

<script type="text/javascript">
$(function(){
$("#id of focusssed part").focus();
$(' $("#trig").on("click",function(){
var a = $("#id of focussed part").val().trim();
if(a.length > 0){
$("#id of focussed part").val('');
$("#id of focussed part").focus();
$("<li></li>").html('<img src="example.jpg"/><span>'+a+'</span>').appendTo("#your message id");
$("#chat id").animate({"scrollTop": $('#chat id')[0].scrollHeight}, "slow");
$('#chatAudio id')[0].play();
}
});
});
</script>
1038
like
0
dislike
0
mail
flag

You must LOGIN to add comments