• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[Help] Making a auto scrollbar down when new message appers. (chat system)

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: New Bitmap Image - [Help] Making a auto scrollbar down when new message appers. (chat system) - RaGEZONE Forums
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:
Back
Top