1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

jQuery slimScroll Integration

Discussion in 'XenForo Development Discussions' started by Eagle, Mar 11, 2013.

  1. Eagle

    Eagle Well-Known Member

    Hello there..

    I'm using the slimScroll plugin for jQuery by Piotr Rochala. I've made new personal conversations like Facebook personal conversations view but I have a problem. So, when reply to conversation, the last message not coming up the top of page. I've tried a lot of function for this but problem still exists. I really can't understand where the problem is?

    For example;
    test.PNG

    Following is the code I'm using to place personal conversations by SlimScroll;
    Code:
    $('#personalconversations').slimscroll({
    width: 'auto',
    height: '400px',
    start: 'bottom',
    railVisible: true,
    allowPageScroll: true,
    touchScrollStep: 1000
    });
    
    start: 'bottom' working great e.g. when refresh the page, it's showing up the bottom of the last message of the page. However, as I said on my the first paragraph (when reply to conversation, the last message (new message) not coming up the top of page), I'm having trouble using this function.. Can someone help me with this jQuery SlimScroll issue?
     
  2. EQnoble

    EQnoble Well-Known Member

    I can take a look if you can start a convo and send a link
     
  3. Eagle

    Eagle Well-Known Member

    Thank you for replying. Now I've sent personal conversation to you the site with details.
     
  4. ibnesayeed

    ibnesayeed Well-Known Member

    I am not sure how it will work with slimScroll but otherwise chat like applications scroll the element up with a very large value every time after appending new content.

    Code:
    $('#personalconversations').scrollTop = 10000000;
     
  5. Eagle

    Eagle Well-Known Member

    I've tried it but that's not working..
     
  6. ibnesayeed

    ibnesayeed Well-Known Member

    People have posted some tricks here that might be helpful for you.
    This bug report also has a code example that can give you a clue about how to force scroll.
     
  7. silence

    silence Well-Known Member

    How did you manage to get it running since it doesn't wanna run on the version of jquery-ui that xenforo is using?
     
  8. EQnoble

    EQnoble Well-Known Member

    Xenforo doesn't use jq ui as far as I know...they use jQ + parts of jQuery tools as far as I know....

    To use this you need to include jQUI and use a no conflict setting to get jqUI and Tools to play together since they share the usage of the tabs and such.

    I did the same procedure to make this work (just to test out if I could for use in another mod but decided to hold off and see what else I could come up with.)


    I also tried this and tbh the outcome can be ugly....I use a different scroller but cant come up with the name off the top of my head.

    Maybe after I finish the mediasites update I will try putting out something that does this with the scroller I like that I know works well in xf already.
     
  9. silence

    silence Well-Known Member

    The only scrollbar I found that works sexy and without conflict, even on jQuery 1.5.2 is jQuery-NiceScroll. I can't use it since my theme is already choppy enough with all the css3 gradients and box-shadows.
     
  10. EQnoble

    EQnoble Well-Known Member

    I will checkout NiceScroll as well I guess...never heard of it before this actually.
     
  11. silence

    silence Well-Known Member

    It's probably the best scroll plugin out there, it's still being actively maintained as well :)
     
  12. Eagle

    Eagle Well-Known Member

    Yes of course I know but still didn't fix my problem. I just think it so, XenForo's PC system are difference with that.

    Well, I'm still using jQuery UI and there is noConflict in JS files because I'm using custom download; http://jqueryui.com/download/ so, widgets and effects are unnecessary.
     

Share This Page