This topic contains 7 replies, has 2 voices, and was last updated by Sean Sean 2 years, 5 months ago.

ul id="chats" if li markup or chat list increases with ul tag then scroll issue


  • rajendra.badri
    Participant

    Posts: 11
    Member Reply #2570

    Hi,

    I would like to know that if  LI tag within <ul id=”chats”>

    increases, let say about 40-45 li with content i.e message body then scroll automatic to bottom doesn’t seem to work properly. how to fix this issue, as we are trying to use your function written javascript.

    Eg:

     

    var getLastPostPos = function () {

    var cont = $(‘#chats’);

    var height = 0;

    cont.find(“li.out, li.in”).each(function () {

    height = height + $(this).outerHeight();

    });

    return height;

    }

    var message = preparePost(‘in’, users_fromtime, fromuser_name, tousersprofileavatar, final_msg);

    message = $(message);

    chatContainer.append(message);

    cont.find(‘.scroller’).slimScroll({

    scrollTo: getLastPostPos()

    });

    But even this function makes to scroll to last li only till 20 li with body content but later 40-45th message onwards it doesn’t scroll to last li in the bottom..please test and reply with solution to fix this as soon as possible.

    Sean
    Sean
    Keymaster

    Posts: 4226
    Support Staff Reply #2600

    Hi,

    Can you reproduce this issue in the original theme or you are having it with your custom code ? Can you provide us a test link in private reply to your developing site so we can check it and advise you further.

    Thanks.


    rajendra.badri
    Participant

    Posts: 11
    Member Reply #2609

    http://www.keenthemes.com/preview/metronic/theme/templates/admin/

    in this above url..go to Chats section present in right side bottom of the page

    start typing upto 40-45 messages send them one by one

    so you will be able to see the scroll top issue with current message..so message list increases then it scrolls back to top instead of bottom.

    Attachments:
    You must be logged in to view attached files.
    Sean
    Sean
    Keymaster

    Posts: 4226
    Support Staff Reply #2616

    Hi,

    Thanks for your detailed clarification. We will check the issue further and provide the fix asap. If you need the fix asap please email our support at support@keenthemes.com to get the fix as soon as its available.

    Thanks.

    Sean
    Sean
    Keymaster

    Posts: 4226
    Support Staff Reply #2647

    Hi :),

    To fix the above issue you just need use below hot fix in quick-sidebar.js script and replace getLastPostPos function with below one:

    var getLastPostPos = function() {
    var height = 0;
    chatContainer.find(“.post”).each(function() {
    height = height + $(this).outerHeight(true);
    });

    return height;
    };

    If you need any further assistance please let us know.

    Thanks.


    rajendra.badri
    Participant

    Posts: 11
    Member Reply #2649

    Hi,

    Even after using the above function the issue not yet resolved.. You kindly try to enter 50-60 messages in chat input and keep on submitting then you will realize the issue.

    in your code  height = height + $(this).outerHeight(true);   value true alone is added as extra argument but even then that doesn’t fix auto scroll to last message at the bottom. I am not checking with side-bar chat section instead of home page footers Chats section.. hope you understood

    Sean
    Sean
    Keymaster

    Posts: 4226
    Support Staff Reply #2652

    Hi,

    Can you try to use below code:

    var getLastPostPos = function() {
    return 100000;
    });

    Thanks.

    Sean
    Sean
    Keymaster

    Posts: 4226
    Support Staff Reply #2664

    Hi,

    The above code was tested and worked as expected in our end. If its still not working for you can you please provide us a test link to your developing site in a private reply ? We will need to debug your page and check your code. Also can you let us know which OS and browser version are you using ?

    Thanks.

Tagged: 

You must be logged in to reply to this topic.