Here are the few options you can customize for your chat box:
options: {
id: null, //id for the DOM element
title: null, // title of the chatbox
user: null, // can be anything associated with this chatbox
hidden: false, // show or hide the chatbox
offset: 0, // relative to right edge of the browser window
width: 230, // width of the chatbox
messageSent: function(id, user, msg){
// override this
this.boxManager.addMsg(user.first_name, msg);
},
boxClosed: function(id) {}, // called when the close icon is clicked
...
}
To create a chatbox at the bottom of the browser window with an offset of 200px to the right edge, use the following code:
$(document).ready(function(){
// to create
$("#chat_div").chatbox({id : "chat_div",
title : "Title",
user : "can be anything"
offset: 200,
messageSent: function(id, user, msg){
alert("DOM " + id + " just typed in " + msg);
}});
// to insert a message
$("#chat_div").chatbox("option", "boxManager").addMsg("Mr. Foo", "Barrr!");
});
Use the following standard jQuery UI approach to access the options after the chat box is created:
...
// getter
var offset = $("#chat_div").chatbox("option", "offset");
// setter, to change the possition of the chatbox
$("#chat_div").chatbox("option", "offset", 300);