Newbie Spellweaver
- Joined
- Jan 18, 2011
- Messages
- 36
- Reaction score
- 1
hey guys i need some help here, i was stuck with a scrollbar issue.
i have a chat system, well im using some JS plugin to use a scroll bars on my div wheres the chat line appers,
there is the image:
and there is the code of the js,
basically i want when new message appers so the scroll bars going to down that i can see the message line.
so thanks guys if you can help me.
i have a chat system, well im using some JS plugin to use a scroll bars on my div wheres the chat line appers,
there is the image:
and there is the code of the js,
PHP:
touchslider = {
output: function(msg) {
if (console) {
console.info(msg);
}
},
createSlidePanel: function(/*string*/ gridid, /*int*/ cellWidth, /*int*/ padding) {
var x = padding;
$(gridid).each(function() {
$(this).css({});
$(this).parent().css('overflow', 'hidden');
$(this).children('.cell').each(function() {
$(this).css({});
x += cellWidth + padding;
});
touchslider.width = x;
touchslider.colWidth = cellWidth + padding;
try {
document.createEvent('TouchEvent');
touchslider.makeTouchable(gridid);
} catch (e) {
$(this).css({
'height': '600px',
'overflow': 'auto'
});
}
});
},
touchMove: function(/*JQuery*/ elem, /*event*/ e) {
if (!touchslider.sliding) {
elem.parent().addClass('sliding');
}
touchslider.sliding = true;
if (touchslider.startX > e.targetTouches[0].clientX) {
/*
* Sliding to the left
*/
elem.css('down', '-' + (touchslider.startX - e.targetTouches[0].clientX - touchslider.startLeft) + 'px');
touchslider.slidingLeft = true;
} else {
/*
* Sliding to the right
*/
var left = (e.targetTouches[0].clientX - touchslider.startX + touchslider.startLeft);
elem.css('left', left + 'px');
touchslider.slidingLeft = false;
}
}
};
$(document).ready(function() {
touchslider.createSlidePanel('#slidebar');
});
basically i want when new message appers so the scroll bars going to down that i can see the message line.
so thanks guys if you can help me.
Attachments
You must be registered for see attachments list
Last edited: