forked from dexterpu/jquery.ui.chatbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
41 lines (41 loc) · 1.84 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!-- The following line is essential for the "position: fixed" property to work correctly in IE -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>jquery.ui.chatbox</title>
<link rel="stylesheet" href="css/ui-lightness/jquery-ui-1.8.2.custom.css" type="text/css" media="screen" />
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.2.custom.min.js"></script>
<link type="text/css" href="jquery.ui.chatbox.css" rel="stylesheet" />
<script type="text/javascript" src="jquery.ui.chatbox.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var box = null;
$("input[type='button']").click(function(event, ui) {
if(box) {
box.chatbox("option", "boxManager").toggleBox();
}
else {
box = $("#chat_div").chatbox({id:"chat_div",
user:{key : "value"},
title : "test chat",
messageSent : function(id, user, msg) {
$("#log").append(id + " said: " + msg + "<br/>");
$("#chat_div").chatbox("option", "boxManager").addMsg(id, msg);
}});
}
});
});
</script>
</head>
<body>
<p>It will not work untill necessary scripts and stylesheets are
properly loaded, check out the code.</p> <input type="button"
name="toggle" value="toggle" />
<div id="chat_div">
</div>
<hr />
<div id="log">
</div>
</body>
</html>