kelvinluck.com

a stroke of luck

jScrollPane – custom cross-browser scrollbars

jScrollPane is a jQuery plugin which provides you with custom scrollbars which work consistently across all modern browsers. You can style the scrollbars using simple CSS and they degrade gracefully where JavaScript is disabled.

Examples

There are full examples of many different use-cases for jScrollPane all available from the jScrollPane homepage.

Version

jScrollPane is currently at version 2.0. You can keep up to date with all changes to jScrollPane via its github project page.

Download

jScrollPane has it’s own github project – this is where the latest sourcecode and releases can be downloaded from. You will find the latest cutting edge code in the master branch while all previous releases will be available as tags in the git repository. Thanks to the magic of github, archives of each branch/ tag are available on the download page.

Bug reporting and feature requests

All bugs should be reported through the github issues list. Please first make sure that you are in fact seeing a bug, the best way to confirm is to discuss the issue first on the google group (see support section below). You should also check the known issues and FAQs. If you do submit a bug please provide a minimal test case showing the bug in action. This can be a URL to any page showing the bug although I would suggest creating a js fiddle – this makes it really easy to tweak the test case and fix the bug. You can use this basic jScrollPane demo fiddle as a starting point for your bug demo if you like.

Support

Support for jScrollPane is available either via stackoverflow (tag your questions with jquery and jscrollpane) or through the jScrollPane google group. But please make sure you first check the FAQs. I will do what I can to help although some questions might get a faster response from the friendly folks on the jQuery mailing list. If your problem is urgent and you want prioritised help then there is donate button below which you can use to try and catch my attention ;)

Donate

jScrollPane is completely free and open source. However, if you find jScrollPane useful and you would like to make a donation towards my beer fund then please use the paypal button below to donate any amount. Thanks!
You can also donate to the project by joining the mailing list and answering any questions that you can.

172 Comments, Comment or Ping

  1. Hi,
    we tested your plugin jscroll example downloading evrything expcept mint/?js, the plugin works in firefox and explorer, but in safari doesn’t work. When we link mint/?js, all works well. But we quickly read the code of mint/?js and I suppose it’s a development code. Can you help me.

    Thx
    Federico

    December 13th, 2007

  2. Hi,

    The mint script is just the stats tracking package I use on my site. It shouldn’t effect how the scroll pane scripts work… Do you have a URL to your page which isn’t working in Safari and maybe I can help you debug?

    Cheers,

    Kelvin :)

    December 13th, 2007

  3. Oleg

    Hi, this is a very nice script but I need some functions to use it in real app.
    1. Horizontal scrolling
    2. Resizing function(because of the window that can be resized)

    Do you plan to extend your plugin ?
    Thanks

    December 30th, 2007

  4. Pawel

    Hi, great script but I need Panetrack on the left side, can You help me :)

    regards
    Pawel

    January 7th, 2008

  5. Hi Pawel,

    You can move the panetrack to the left hand side using some CSS.

    Another user posted this example on a bug report – maybe it helps you?

    http://plugins.jquery.com/node/449#comment-73

    Cheers,

    Kelvin :)

    January 12th, 2008

  6. Andreas

    Hi, is it possible to use it for a horizontal-scroll?

    Best regards

    February 7th, 2008

  7. Nick W

    Hi,
    I would like to refresh the scrollpanes when the text is resized. Seems that firefox (mac/win) has trouble with this. Or am i missing something?

    regards,

    Nick

    March 7th, 2008

  8. Hi Nick,

    Did you see this example?

    http://kelvinluck.com/assets/jquery/jScrollPane/textSizeChange.html

    Cheers,

    Kelvin :)

    March 7th, 2008

  9. Nick W

    Hi Kelvin,
    Yes i have seen that. This does the text but i can’t make the box expand using ems. I was wondering if there could be a call the scrollpane initialising script in the header of the html each time somebody resizes the text.

    – Nick

    March 10th, 2008

  10. doug

    Hey Kelvin,

    Nice plug-in. Im using scrollpane for thumbnails in an image gallery. On clicking a thumbnail the page is refreshed and the image is displayed in a view pane. If the thumbnail clicked is outside the intial window pane( ie had to scroll to get to it) then the scrollbar looses position after refresh. Any ideas

    March 11th, 2008

  11. Nick W

    Is there a way to make the scroll pane elastic?. The box resizes properly if the window is reloaded but stays the same otherwise even when using ems.

    March 18th, 2008

  12. Hi Nick,

    Sorry for the slow reply, I’ve been really busy. Unfortunately I don’t think the scrollpane will work elastically as it currently is. There is a support ticket with a similar request here too:

    http://plugins.jquery.com/node/1790

    I’ll try and look into it when I get a spare minute. In the meantime you could try listening to the window resize event and reinitialising the scrollpane then (like in my full body scroll example)

    Hope that helps,

    Kelvin :)

    March 18th, 2008

  13. Hi Doug,

    I can’t really comment without seeing your page but it would probably be better not to refresh the whole page when a thumbnail is clicked but instead to use JS to update the rest of the page.

    Otherwise you could use the scrollTo method on document ready to scroll to the relevant link (like in this example),

    Hope that helps,

    Kelvin :)

    March 18th, 2008

  14. I was wondering if you had a scroll bar that would work on the horizontal axis instead?

    Thanks
    Mike

    March 21st, 2008

  15. Hi Mike,

    I’m afraid jScrollPane currently only creates vertical scrollbars. If I ever find some spare time I will extend it to work horizontally but I don’t think that will happen too soon…

    Cheers,

    Kelvin :)

    March 21st, 2008

  16. amarnath

    Is this a free downloadable open source plugin to use or licenced?

    Thanks
    Amarnath :)

    March 25th, 2008

  17. Yes – the plugin is licensed under the same MIT and GPL licenses as jQuery itself,

    Cheers,

    Kelvin :)

    March 28th, 2008

  18. Diego

    Hi Kelvin! First of all, really nice script!
    Did you have any complains about it used on a modal thickbox window? Because i could make it work on a single page but once i try it on thickbox it doesn’t shows any of the div’s contents and a JS “invalid argument” error is shown on the opener window.

    I would appreciate any help on this. No rush at all!

    Also, great pics!

    Greets from Argentina, Diego.

    May 20th, 2008

  19. Wilson

    Hi Kelvin,

    Is there any customization that can make Arrow Keys (up and dowm) from keyboard can control the JScrollPane?

    June 3rd, 2008

  20. Hi guys,

    @Diego – I think it should work in a thickbox window as long as you initialise the scrollpane after opening the window… Do you have a test URL I could look at to maybe see what’s going wrong?

    @wilson – Sorry, there is currently no keyboard control for the scroll pane. You could set up your own keyboard listeners which would use the scrollBy functionality of the plugin to control the jScrollPane,

    Hope that helps,

    Kelvin :)

    June 4th, 2008

  21. hi.. i’m using your plugin and it works greatly on my image gallery. tks!!!

    June 27th, 2008

  22. Any idea why the script rarely although sometimes works on http://www.lionsbreath.ca/teachertraining/ but seems to always work on http://www.lionsbreath.ca/classdescriptions/ If you have an answer I would be happy to compensate you. Thanks.

    July 12th, 2008

  23. Wilson

    Hi Kelvin,

    How can I determine the Scroll Bar produced or not?

    July 23rd, 2008

  24. hello.

    i’m trying to use the scrollbar for a horizontally scrolling div, rather than a vertical one. is this possible?

    thanks a lot.

    August 11th, 2008

  25. Chad Davis

    Hey Kevin. This is a great plugin. I am running into one problem with it. If I update my jquery file to anything more recent then 1.2.3 the plugin locks up in Safari and crashes every time. Is this something that you are currently aware of? If so is there a fix for it. Thanks!

    August 11th, 2008

  26. Mark S

    Awesome script Kelvin! Thanks for sharing.

    To all the people asking for a horizontal version, someone made a mod: http://plugins.jquery.com/project/jscrollhorizontalpane

    August 20th, 2008

  27. Florian

    Hi Kelvin,

    great plugin. Just having trouble if I open the scrollpane 2 time via ajax request. The second time the height of class jScrollPaneContainer is always 0px hence no content is shown. Which function do I have to use to reload the scrollpane correctly on the close button of my dialog window? thx Florian

    August 21st, 2008

  28. Tobi

    Hi Kelvin,

    We found a Problem when using jScrollPane on a div thats not displayed.

    < div style="display:none">
    < div class="scroll-pane">
    some stuff
    < /div>
    < /div>

    then an error occured in ie6 and ie8 (we did not test ie7). The developer toolbar in ie8 told us about an Illegal Argument (I hope thats the right translation) in line 115: ”$this.css(cssToApply);”.
    This comes because of an error in jquery.pack.js in line 1, character 13287: “d[f]=c;return d[f]”
    Illegal Argument
    >>d
    {...}
    >>f
    “width”
    >>c
    ”-12px”

    In FF everythink works.

    We’re using jquery 1.2.6 and jScrollPane.js 4765 2008-02-17 21:14:59Z

    Thanks for the great plugin!

    October 30th, 2008

  29. Paco

    Hi! I have sort of a weird problem. Somehow the scroll works perfectly on firefox, but it just dissappears on ie. Any idea why that might happen? Thnx btw, it’s come in handy =D

    October 31st, 2008

  30. HI everyone - sorry for the very slow replies!

    @John Allan - I'm not sure I'm afraid... It seems to work fine on both links for me now... Are you still having problems?

    @Wilson - something like the following should work (where selector selects the element you tried to apply jScrollPane to):
    if ($('SELECTOR').parent().is('.jScrollPaneContainer'))

    @Tudor - Sorry, not currently. I believe someone else modified jScrollPane to add that functionality though (in fact, Mark S links to it above).

    @Chad Davis - It's not something I'm aware of... Are you still having issues with the latest jQuery?

    @Florian - Maybe the problem is that you are not waiting until the AJAX content has loaded before you apply jScrollPane? If you can provide a test URL then I may be able to help more...

    @Tobi - That sounds like a genuine issue - I've raised a ticket for it: http://plugins.jquery.com/node/4691 . In the meantime did you try showing the parent div before applying the scroll pane and then hiding it directly afterwards?

    @Paco - AFAIK the scrollpane should work fine in IE. Can you provide a URL where it is failing? Which version of IE are you using?

    I'm going to try and go through the bug reports on the plugins site now and do some fixes - let me know if there are any more problems...

    November 5th, 2008

  31. Alejandro

    Hey Kelvin,

    Awesome script! Just wondering if it's possible for the drag bar to always remain bottom positioned every time the text area gets updated with new content (i.e. with append), instead of it always re-initializing at the top position? For example, with instant messaging chat boxes, every time a new message is sent, the scrollbar adjusts to the newly inserted content but the scrollbar remains fixed at the bottom position. Can this be replicated? Thanks and hope to hear from you soon!

    Cheers

    November 8th, 2008

  32. Michael

    Hey Kelvin,
    I'm having some trouble using jscrollpane in conjunction with a thumbnail image links. My scrollable area contains a serious of thumbnail pictures and when you click on a thumbnail, the larger version of the image appears on main section of the page. The scrolling functions are working great but when I click one of my thumbnails, it forces that image to scroll to the top of the scrollable area and then I have to click it again to get the large picture to show up.

    Basically, the large image event won't happen unless the corresponding thumbnail is at the top of the scrollable area. When I disable jscrollpane in my script and just use the browser default scroll bar, everything works just fine.

    Do you have any idea what could be causing this?

    November 12th, 2008

  33. Hi Kelvin,

    great script, I've been looking for something like this for ages!
    Only I'm having the same problem as someone else mentioned earlier, I can get it to work anywhere I want to (latest stable versions of IE, Firefox and Opera) except Safari. It shows the text as one large window without scrolling...

    Can you help? Thanks in advance!

    November 16th, 2008

  34. And this you'll always see... look at it for hours and right when you ask for support, it works afterwards :$.
    I think (not sure) it was because I switched the order: I had put my styles files below my script files in the header, instead of the other way around.
    Sorry for bothering, but still wanted to say: wonderful script!!

    November 16th, 2008

  35. Scrollbar is working just fine with text and image but not when I put a film coming from Youtube (<param name="movie" value="http://www.youtube.com/v/...)
    The movie is showing above the scroll area.

    Do you have any idea where this problem is coming from.

    Francois

    November 20th, 2008

  36. Maarten Wolzak

    Hey Kelvin,
    Great plugin, flexible, very nice!
    I found that some clients like a single shaped drag handle nicer. Changed 'dragH' to a set size (line 289) and it works like a charm.
    Maybe a good one for the options? {dragFixedHeight:10}

    thanks,
    Maarten

    December 4th, 2008

  37. Hey Maarten,

    I think you should be able to do this by passing both a dragMinHeight and a dragMaxHeight in when you instantiate the jScrollPane. Then you won't need to edit the plugin sourcecode. Did you try this? I guess I could provide a convenience parameter which would set both of these for you...

    Cheers,

    Kelvin :)

    December 4th, 2008

  38. Joe

    Somewhat ridiculous question. I don't have the page uploaded as yet Kevin but I cannot seem to make 2 matching scrolls function on a page.?

    Got one ... it's exactly what I need. It's your Basic example pane 2.

    Using exactly the same tags on a second scoll on the page I get nothing but standard vertical and horizontal scrollbars?

    December 8th, 2008

  39. Hey Joe,

    I answered you on the issue you created on googlecode:

    http://code.google.com/p/jscrollpane/issues/detail?id=26

    Cheers,

    Kelvin :)

    December 8th, 2008

  40. Hi Kelvin, I just wanted to say thanks. I've successfully included your plugin in the application I was creating, and your code is so cool that it was quite easy to modify. For example, I had UL items as folding menus and I needed to assign the id of the UL menu to the wrapping divs.
    I've tested your plugin in IE6, 7, O9.62, S3.11, Ch, FF3,2 and it works sweet everytime. Thanks again Kelvin.

    December 9th, 2008

  41. daniel

    Hey Kelvin,

    thanks for your great Plugin...it works fantastically...

    but there is a problem I cannnot solve myself...is it possible that the panedrag automatically jumps to the bottom after loading content via Ajax??

    December 11th, 2008

  42. Hey Elliot,

    Sweet - glad you liked it! Thanks for letting me know :)

    December 12th, 2008

  43. Hi Daniel,

    I've just uploaded an example of doing just this:

    jScrollPane - always scroll to bottom

    If you want to use this approach then please grab the latest jScrollPane (revision 37 +) from my site or the googlecode svn as I just fixed a bug related to this,

    Cheers,

    Kelvin :)

    December 12th, 2008

  44. Semenov Alexander

    Hello, Kelvin!

    Thank you for this great plugin! I have a question, similar to Maarten Wolzak's question about customized ScrollPaneDrag height. Setting min and max height are working fine, ScrollPaneDrag displays correct (for example, I use 16x16 picture), but when I press mouse at ScrollPaneTrack, it works like real height of ScrollPaneDrag is not 16 pixels. Could you, please, add examples of using different heights of ScrollPaneDrag.

    Thank you very much!

    December 14th, 2008

  45. Hi Semenov,

    Can you provide a URL showing the problem? And can you please input the problem as an issue on googlecode:

    http://code.google.com/p/jscrollpane/issues/list

    What happens when you click on the track? It is meant to move the drag towards the place where you clicked - is this not happening?

    Thanks,

    Kelvin :)

    December 16th, 2008

  46. Hi Kelvin,

    This is a really great plugin; thanks so much for making it! We use it a lot in the Smithsonian's Freer-Sackler Asian Ceramics Gallery website.

    Through the course of making the website I've fixed several bugs in the scrollpane code. The most annoying one is that anchor links don't work properly if they are inside the scrollpane; you have to use some crazy anchors with classes and the links have to be special JavaScript calls. Not the ideal for people without Javascript or staying standards-compliant.

    I have written a function that fixes this and allows you to use normal anchor links anywhere on the page, like the scrollpane wasn't even there. You can find the code on my blog: http://phreakhead.livejournal.com/74276.html.

    I hope you think this is a good addition and perhaps you will include in future releases. Thanks!

    December 19th, 2008

  47. Hi Tyler,

    Glad you like the plugin.

    Thanks for the information on your website. The functionality you are talking about has been included in jScrollPane for quite a while now (see the release announcement for 1.2). Please grab the latest version of jScrollPane and tell me if it works on your website without your extra code...

    Also, I noticed that on the ceramics website some of the links are to an IP address (rather than domain name) and that that IP address isn't longer available to me,

    Thanks,

    Kelvin :)

    p.s. people without javascript will always see normal browser implemented scrollbars as jScrollPane is made to degrade gracefully.

    December 19th, 2008

  48. Brian

    I'm trying to use multiple instances of the jScrollPane on the same page. The page has an ASP Tab Container with two tabs, both using the scroll pane. and a seperate panel with the scroll pane next to the tab container. Everything works great in FF, Safari, and Chrome. In IE however, only the first scroll bar works. The others fail when trying to retrieve the InnerHeight() and InnerWidth() both of which return 0. This causes the CSS that is passed to the elements to have negative heights and widths which causes a failure and none of the content in the panes is displayed. If another call is made, say a modal pop up the scroll bars work. Any insight or do you need more info?

    December 23rd, 2008

  49. Hi Brian,

    It would be great if you could file an issue about this on the googlecode issues list:

    http://code.google.com/p/jscrollpane/issues/list

    If you could supply a URL that would help to diagnose the problem but it sounds like it might be related to the issue with scrollpane not working when initialised on invisible div... A test URL would help me to figure out exactly what's going on though,

    Cheers,

    Kelvin :)

    December 23rd, 2008

  50. @Anne-Lies
    Thank you! When I place the stylesheet before the script my trouble with strange width after reload dispersed!

    January 2nd, 2009

  51. Hi,

    I'm trying to get this to work on a wordpress site with no luck, any chance you'd take a look and let me know where I'm going wrong.

    http://kimfrederiksen.com/kim-frederiksen-cvbio/

    I want to use custom scroll bar and arrows but if I could even get the basic functionality working it'd be great.

    Thanks in advance mick

    January 9th, 2009

  52. Hi Mick,

    It looks like your page also includes Scriptalicious so you will need to use jQuery.noConflict() and then change your references to $ to be to jQuery instead e.g.

    jQuery(function()
    {
    jQuery('#biopage').jScrollPane();
    });

    Hope that helps,

    Kelvin :)

    January 9th, 2009

  53. I'm getting there, missing / in my code.

    Now on to getting custom stuff working, great script btw

    January 9th, 2009

  54. Kim.

    Thanks for the input, I'm afraid I don't know what you mean by " jQuery.noConflict()".

    I've tried enabling arrows but this doesn't work, perhaps that's the conflict you are referring to, again any help appreciated.

    Mick

    January 12th, 2009

  55. oops sorry about the Kim Kelvin

    January 12th, 2009

  56. Thanks so much for your great work.. I spent today banging my head against the desk trying to get expanding divs (as used in Drupals collapsible fieldsets) to properly resize the scroll pane and scroll handle.

    Finally just now figured out that after the initial jScrollPane was fired off when document loads that I also needed to declare another function in the head so that Drupal's own 'collapse.js' could call upon it everytime someone expands or collapses a fieldset in the interface.

    So after declaring that new function I have a call to it in Drupal's 'collapse.js' at the end of every function in that script. That re-initializes the jScrollPane for every expand/collapse perfectly.

    Unfortunately there's no example of this available from the public side, but the jScrollPane is in action for the majority of the site here:
    http://shawnlemmon.com/public

    Cheers!
    ~Steve Hryniuk

    January 18th, 2009

  57. RSBomber

    Hi Kelvin…

    I’m wondering if you or someone else has run into a problem I’m experiencing and if there’s a workaround. The script works great, but I’m trying to implement it in a tab-box display. I have two tabs and inside of each there will be an implementation of jScrollbar. I’m using jQuery UI Tabs to control the functionality of the tabs. All content for both tabs loads on the page, but tab two content is set to ‘display:none’ - which is changed via JS when tab two is activated. Because of this, anything inside of the scrollbar container in tab container two disappears when the page loads and does not display when tab container two is activated. Good grief… I hope I didn’t lose you there. Does this make sense at all? If not, let me know and I’ll try to throw up and example for you to see.

    Thanks

    January 19th, 2009

  58. Hey Steve,

    Yeah - you need to reinitialise the jScrollPane after it's parent container resizes or it's content changes. I also added a jScrollPaneRemove function recently which allows you to undo the scroll paning (which is useful if you want to re-initialise it taking into account changes in the parent's size). Glad you liked jScrollPane and used it on the shawnlemmon site :)

    Cheers,

    Kelvin :)

    January 19th, 2009

  59. Hey RSBomber,

    Yes - it's a problem that lots of people have run into... I put together an example which shows how the tabs plugin and jScrollPane can work well together:

    http://www.kelvinluck.com/assets/jquery/jScrollPane/tabs_example.html

    The basic idea is not to actually hide inactive tabs and comes from this example on the tabs page:

    http://docs.jquery.com/UI/Tabs#...my_slider.2C_Google_Map.2C_etc._not_work_when_placed_in_a_hidden_.28inactive.29_tab.3F

    I'd like to put together some more robust functionality for "make jScrollPane work when applied to hidden elements" but I'm having trouble finding a way to implement it without using a timer which seems kinda dirty to me...

    Anyway - hopefully the example will help in your situation,

    Cheers,

    Kelvin :)

    January 19th, 2009

  60. Sheldon

    Awesome script - works really well.

    Is there a way to sync more than one instance of a jScrollPane?

    I have two windows open which are essentially the same document but only one has the scrollbar showing - I'd like the content on both windows to be scrolled when one of the scrollbars is used.

    Thanks for your help and a great plugin!

    January 19th, 2009

  61. Hey Sheldon,

    Glad you like the script...

    I'm not sure I entirely understand what you are trying to do - if you have a URL it may help...

    What you are describing should be possible though by listening to 'scroll' events on the jScrollPaned element and passing a message to the other window so it could call a scrollTo on the other content...

    Hope that helps,

    Kelvin :)

    January 19th, 2009

  62. Beng

    Hi Kelvin,

    First of all, I'm new to web development, and i would like to thank you for this wonderful plugin. however, how can i apply it using a table? for example a 2x2 table? because the spacing of the columns are not equal to each other.

    here is my pseudocode

    some stuffs here

    some stuffs here

    some stuffs here

    some stuffs here

    Follow up quest there are no arrows being shown when i use the {showArrows:true}.

    Thanks,
    Beng

    January 20th, 2009

  63. RSBomber

    Brilliant! Thanks for the description and links. You rock!

    January 21st, 2009

  64. Sheldon

    Hello again,

    I haven't yet been able to fix my first problem - but perhaps you could help me out with this one as well:

    I've looked at the your posted example for a chat implementation, but I would like to have the scrollPane automagically scroll only when the scroller is at the bottom. So if a user has scrolled up to look at a previous message in the chat, they won't get forced back down whenever a new message pops up.

    Thanks again :)

    January 22nd, 2009

  65. Hey there

    First of all thank you for all your work you out in this plugin.

    I have a question that I hope you can help me with.
    I have made a site, and used your plugin. I have used both the version where you can import content through AJAX, and at the same time I would like the scroll-bar to automatically update, when an image has loaded, because most og the content are images.

    But it doesn't seem to work :(

    I have changed in the 'reinitialiseScrollPane'-function that is used for the AJAX, and it now looks like this:

    reinitialiseScrollPane = function()
    {
    $('#pane1').jScrollPane({scrollbarWidth:5, wheelSpeed:20, reinitialiseOnImageLoad: true});
    }

    But it doesn't work. Do you have a solution or a gues to what the problem might be?

    Best regards and thanks again
    Kim Andersen

    January 23rd, 2009

  66. Hi Kim,

    Can you please raise an issue on googlecode:

    http://code.google.com/p/jscrollpane/issues/list

    And include a URL displaying the problem and I'll try to help you fix it,

    Cheers,

    Kelvin :)

    January 23rd, 2009

  67. Hi Sheldon,

    I've just updated the chat example with the functionality you describe... I had to make some changes to jScrollPane itself as well so you'll need to grab the latest version of that too...

    Cheers,

    Kelvin :)

    January 23rd, 2009

  68. Hi Beng,

    Sorry - I can't understand your pseudocode - I guess some of it got chopped out by my blog?

    Can you please raise an issue on googlecode:

    http://code.google.com/p/jscrollpane/issues/list

    And supply a URL and I will try to look into it.

    Re. the arrows not showing up - are you sure you have the correct CSS and images files?

    Cheers,

    Kelvin :)

    January 23rd, 2009

  69. Michael

    Hello Kelvin,
    Lovely plugin. I approached a project with no previous jquery knowledge and your plugin and example pages really helped. Thanks so much.

    January 26th, 2009

  70. Nicolas (from Argentina)

    Great work!

    I added a small feature , which is to have to possibility to use a callback after calling the scrollTo method.

    Congratulations for the puglin!

    January 27th, 2009

  71. Hola Nicolas (from Argentina) :D

    You can bind an event listener for the "scroll" event - this will be fired every time the scollpane is scrolled,

    Cheers,

    Kelvin :)

    January 27th, 2009

  72. Rob

    Hi

    great plugin! I am using the ajax version with no issues. It loads the initial text fine, and when I click the add-content button it loads an html file I created. I then have another button that I want to click similar to your remove-content button. But rather than removing the content, I would like the initial text to appear again - like switching back and forth. Ive tried:

    $('#back').bind(
    'click',
    function()
    {
    $('#pane1').jScrollPane({scrollbarWidth: 10, scrollbarMargin: 10,showArrows: true,dragMaxHeight: 20}, reinitialiseScrollPane);
    }
    );

    and a few other ways but I cant get it to load the initial text. Any ideas?

    Thanks

    Rob

    January 28th, 2009

  73. Hi Kevin,

    I have an unusual need for a scroll pane within a . Is this possible?
    Obviously I have tried but not succeeded (yet). Please advise.

    Thanks.

    January 28th, 2009

  74. Hi Rob,

    Your question isn't directly related to the scroll pane. You could maybe first try and get the functionality you want working without jScrollPane and then it should be easy to add jScrollPane back into the mix...

    To give you a hint, when the user first decides to add content you will want to store the original content in a variable. When they hit the button to show the initial text you will pass this variable into a html() call on your container.

    To make this work with jScollPane you just need to remember to reinitialise the scroll pane each time you change the text.

    Hope that helps,

    Kelvin :)

    January 28th, 2009

  75. Hi Forrest,

    You need to fit the scroll pane into a dot? Only joking but it looks like my blog stripped out whatever tag you want to fit the scroll pane into - can you clarify?

    Cheers,

    Kelvin :)

    January 28th, 2009

  76. Sabrina

    Hey,

    I'm glad I've found your site. JScrollPane is what I need for a project. But it doesn't work on a Joomla CMS Layout which I've created. I think I put the code correctly, but the div isn't shown anymore.
    I'm sorry, I've got no example page, but it's still a lokal project. Do you have any idea what could be wrong?
    Could it be a problem that there are some other js-scripts?

    Greetings,
    Sabrina

    January 30th, 2009

  77. Hi Sabrina,

    I'm afraid that it's almost impossible for me to guess what is going wrong without a sample page...

    Does your page work if you don't initialise jScrollPane? The element should have overflow:auto so you should see default scrollbars if you don't initialise jScrollPane... Does the element you are scroll paning have a width and height? Is it hidden when you try and initialise the scrollpane? Are there any errors produced by your page?

    Hope one of those helps,

    Kelvin :)

    January 30th, 2009

  78. Hi Kelvin...

    I did a improvement to jScrollPane that maybe can be usefull to other people... and I think you can add that to your last release...

    It's simple... I created a new setting option where you can scroll by a pre-defined height (the line height)... so, the text will never be cut...

    The code:

    // add a new setting... byLine
    $.fn.jScrollPane.defaults = {
    scrollbarWidth : 10,
    scrollbarMargin : 5,
    wheelSpeed : 18,
    showArrows : false,
    arrowSize : 0,
    animateTo : false,
    dragMinHeight : 1,
    dragMaxHeight : 99999,
    animateInterval : 100,
    animateStep: 3,
    maintainPosition: true,
    scrollbarOnLeft: false,
    reinitialiseOnImageLoad: false,
    byLine: 0
    };

    // then, the positionDrag function...
    var positionDrag = function(destY)
    {
    destY = destY maxY ? maxY : destY);
    dragPosition = destY;
    $drag.css({'top':destY+'px'});
    var p = destY / maxY;
    var scrollTarget = (paneHeight-contentHeight)*p;
    if (settings.byLine > 0) {
    var scrollTargetHandler = Math.round(scrollTarget/settings.byLine);
    scrollTarget = scrollTargetHandler*settings.byLine;
    }
    $this.data('jScrollPanePosition', (paneHeight-contentHeight)*-p);
    $pane.css({'top':scrollTarget + 'px'});
    $this.trigger('scroll');
    if (settings.showArrows) {
    $upArrow[destY == 0 ? 'addClass' : 'removeClass']('disabled');
    $downArrow[destY == maxY ? 'addClass' : 'removeClass']('disabled');
    }
    };

    Hope that help,
    Giovanni

    February 3rd, 2009

  79. petrocket

    I do not know why but in Safari sometimes when I would refresh the page it appeared as if jScrollPane calculated the jScrollPaneContainer size incorrectly - consistently too large - and because it was too large, the scrollbar would be hidden by the overflow:hidden setting I had on my .holder div (like in your examples only with the overflow set to hidden and a manual size).

    The only way to fix this was to change line 143 or jScrollPane.js from
    if (percentInView < .99) {
    to
    if (1) {
    The way I determined this would fix it was by manually creating a jScrollPaneContainer div around the .scroll-pane div and set the width manually (which still got overwritten by .js), and I noticed that when the width was calculated incorrectly it wouldn't add the scrollbar - so I forced it to always add the scrollbar and since then I haven't been able to reproduce the incorrect size calculations.

    I really don't know why the dimensions would randomly get calculated wrong in Safari - maybe partial caching? Anyways, I realize this makes scrollbars always visible, but that's fine on my site.

    February 5th, 2009

  80. Hi Petrocket,

    It sounds like you maybe were manually adding the jScrollPaneContainer div in your HTML? You shouldn't do this - the script adds it automatically... If you are still having problems please open an issue on the googlecode page:

    http://code.google.com/p/jscrollpane/issues/list

    Including a URL so I can help you fix it (without the change you made to the sourcecode which obviously doesn't work for the majority of sites who need the scrollbar visiblility to be dynamic),

    Cheers,

    Kelvin :)

    February 6th, 2009

  81. petrocket

    OK, well my "fix" didn't fix it because Safari would still occasionaly make the scrollpane width way too wide. What I ended up doing was specifying the padding and margin for the holder and the pane because I suspect maybe Safari was providing incorrect numbers for those for the scroll pane size calculations - in the section where it calculates how to adjust the pane size for adding the scroll bar.

    Also - IMPORTANT NOTE TO YOU SAFARI PEEPS - be sure to set the width and height attributes of the images in your scroll pane because if you don't Safari will incorrectly calculate the height of the scroll pane around line 140:

    var contentHeight = $this.outerHeight();

    I found that adding the image and height attributes to my img tags fixed that issue.

    Thanks for all your hard work Kelvin! BTW I'm using your scrollpane on this site:

    http://sullivanfinerugs.com

    February 7th, 2009

  82. Hi Petrocket,

    The site you are using jScrollPane on looks nice - good work :) I notice that you have some white space before the doctype declaration though. This puts a number of browsers into quirks mode which may cause problems.

    Also - did you try using reinitialiseOnImageLoad? If you have this then you shouldn't need to add the width and height to images... Although if your images are static then adding the width and height to them is probably a good idea anyway...

    Cheers,

    Kelvin :)

    February 7th, 2009

  83. Sabrina

    Hey,

    sorry for my late answer, I was ill and couldn't work. It was a simple fault I didn't recognize: the div had the attribute display:none which wasn't changed during a fade-in.
    Now it works fine with half of my site. I've still got problems with CollapsiblePanels, but I know the reason and I'm trying to fit it.
    Thanks for your excellent work :D

    Greetings,
    Sabrina

    February 13th, 2009

  84. matthias

    Hi, i want to integrate jscrollpane into a joomla website.
    There is already a window to scroll and i want to change the scrollbar.

    But i don't know how to apply in my template.
    I copied the scripts and placed the code in the index.php.

    But i don't know how to acitivate in Joomla.

    Link: http://arcteam.de/index.php?option=com_content&view=article&id=74&Itemid=56

    thanks
    a newbie

    February 18th, 2009

  85. Hey Kelvin,

    Great plugin! I've been using it on a mini-project I've been working on to provide a custom look to drop-down form elements (among others). I'm having great success thus far, but have run into a very strange problem. I have an unordered list which is wrapped in a div. I then apply jScrollPane to the unordered list inside. Seems to be working great, except...

    Whenever I have list items with spaces in them, jScrollPane somehow calculates that it needs the track and arrows when it really doesn't. To demonstrate, I've posted a page: http://jonlinczak.com/jscrollpane/.

    Underneath the Expiration date fields are two 'Select a Question' fields. They are both identical, except the first one has a space in the middle of the third option, and the second question has no spaces. It's the second question behaving correctly. Have any insight into what might be happening here?

    February 19th, 2009

  86. So you can totally disregard my question above. I'm sure my problems had to do with a CSS issue more than anything else. I've since gone a different route and things seem to be working well for me.

    February 20th, 2009

  87. Hey Jon,

    Glad you figured it out, sorry I didn't get a chance to look into it for you,

    Cheers,

    Kelvin :)

    February 20th, 2009

  88. I get some very odd results in Safari as well.

    Please check out http://wordpress.bustatheme.com/wp-calendar/?m=200902

    It recalculates the width of my .day elements incorrectly and kills my layout.

    Any way to disable the plugin for Safari since it doesn't want to play nice?

    February 21st, 2009

  89. Hi Greg,

    I can confirm I'm seeing the problem in Safari on windows too. Can you please open a ticket on googlecode:

    http://code.google.com/p/jscrollpane/issues/list

    And I will look into it and issue a fix,

    Thanks,

    Kelvin :)

    p.s. It's the height rather than the width that looks broken to me...
    p.p.s. Is it still broken with the latest jQuery and latest jScrollPane file?

    February 21st, 2009

  90. Hey Kevin,

    Cheers for the quick response. Ticket is here: http://code.google.com/p/jscrollpane/issues/detail?id=66

    The height AND width are off. You'll see the box height is gone entirely and the text does not wrap more than one line.

    I have updated to latest version of jQuery and the effect is the same.

    P.S. You need this plugin: http://wordpress.org/extend/plugins/subscribe-to-comments/

    February 21st, 2009

  91. Hi Greg,

    Thanks for the ticket - I'll look into it ASAP...

    And thanks for the hint on the plugin, I definitely did need it so I've just installed it :)

    Cheers,

    Kelvin :)

    February 21st, 2009

  92. Awesome Kelvin!

    Subscribed.

    February 22nd, 2009

  93. Dear Kelvin,

    Trying to implement jScrollpane with UI Tabs and am running into the problem with the hidden tab.

    I tried implementing it by adding a callback function to the tabsshow event but got unpredictable results in IE7.

    I saw your example at:
    http://www.kelvinluck.com/assets/jquery/jScrollPane/tabs_example.html

    But can't find any documentation on you exactly you got it to work.

    Any assistance would be most appreciated.

    Thanks,

    Evan

    February 23rd, 2009

  94. Hi Evan,

    The hint is "hide the inactive tabs using absolute positioning rather than the display: none". So you cheat and the tabs are never actually invisible but are instead hidden by moving them off screen. The idea came from here:

    http://docs.jquery.com/UI/Tabs#...my_slider.2C_Google_Map.2C_sIFR_etc._not_work_when_placed_in_a_hidden_.28inactive.29_tab.3F

    And you should be able to see the necessary CSS on my page,

    Hope that helps,

    Kelvin :)

    February 23rd, 2009

  95. Thank you for such a quick response. If I could bother you to take a look at the following URL:
    http://www.tscplcommunityconnect.com/beta/scrollpane_iso.htm

    I've pulled the tabs and the jScrollpane out the rest of the layout to more clearly illustrate the problems I'm having.

    Any tips would be most appreciated as for the life of me I can't figure out what is wrong.

    Thanks in advance!!

    -Evan

    February 24th, 2009

  96. Hi Evan,

    The URL doesn't currently work,

    Cheers,

    Kelvin :)

    February 24th, 2009

  97. Sorry Kelvin...moved it and forgot to update you:
    http://www.tscplcommunityconnect.com/internalbeta/scrollpane_iso.htm

    Thanks for taking the time!

    February 24th, 2009

  98. Sabrina

    Hey,

    I've found a bug. The Plugin is working fine in the normal version of Opera, but it doesn't work in Opera Portable. There is shown no scrollbar, but the normal scrollbar is missing too. The div is like overflow:hidden. I was testing it with Opera@USB 9.62

    Greetings,
    Sabrina

    February 25th, 2009

  99. Problems with in ie7 ver.7.0.5730.11. (danish)
    When I include this script on my site, nothing is shown in the browser, but if I chose view source code, the full code is downloaded.

    In fact the same problem apears on the frontpage on your site: http://www.kelvinluck.com

    Can you tell me whats the problem? And can i use jsscrollpane without the "mint-script"?

    February 25th, 2009

  100. Hi All,

    @Evan - I can't currently get to http://www.tscplcommunityconnect.com at all at the moment :(

    @Sabrina - That is essentially the same issue as in this ticket: http://code.google.com/p/jscrollpane/issues/detail?id=67 - please subscribe to the ticket and I will update it when I find a solution.

    @Claus - I have no idea what might be causing your problem but I haven't heard of anyone else with issues and it seems OK to me in IE7... The mint script isn't necessary - it's just stats tracking from my site...

    Cheers,

    Kelvin :)

    February 25th, 2009

  101. Jimmy

    I'm having problems with the image drag bar it won't go all the way down or all the way up.

    any classic misstake i'm doing?

    February 27th, 2009

  102. Hi Jimmy,

    No classic mistake I can think of. If you can add an issue to the googlecode list including an example URL then I'll try to help more,

    Cheers,

    Kelvin :)

    March 3rd, 2009

  103. P4R4D0X

    does function script also in iframe?

    March 6th, 2009

  104. Hey Kevin,

    Love the plugin, thanks for doing all the hard work. :)

    I've got 2 small questions, both probably not "problems" with your coding but more just how I've tried to use it.

    1) In IE, the mouse scroll only works when over content (text, images) but when tried over dead, static, background space it will not scroll. Ideas?

    2) I'm using this code:

    [a href="#" onclick="javascript:$('#talky').load('releases.html');"]

    To swap/load .html pages in the same div as the link is in (much like target="_self" would do with frames). When I do this, however, jScrollPane doesn't reinitialize, so if the size of my content is greater than the size of the div, it gets cut off and I can't access it. Any tips on how I can make reinitialize when the link is clicked and the new page loads?

    Thanks again! :)

    http://lonelyrobot.ca/

    March 7th, 2009

  105. Hi P4R4D0X,

    Yes - it should. Do you want to make the entire iframe scroll using jScrollPane or do you want a jScrollPane in the content of the iframe? If it's the former then you may want to look at this example which includes full body scroll:

    http://www.kelvinluck.com/assets/jquery/jScrollPane/fullBodyScroll.html

    Hope that helps,

    Kelvin :)

    March 8th, 2009

  106. Hi Cam,

    1) I'm not sure... Maybe if you put a background color on the element or something? I haven't run into it...

    2) You need to reinitialise the scroll pane in the callback from the ajax load like in this example:

    http://www.kelvinluck.com/assets/jquery/jScrollPane/ajax_example.html

    Rather than adding the onclick inline in the element it would be also be better to use jQuery to bind a click handler which did what you want...

    Hope that helps,

    Kelvin :)

    March 8th, 2009

  107. P4R4D0X

    Hello Kelvin

    Sorry for my bad English I uses a translator:-)
    Thanks for your answer. My problem is, I have iframe with scrolling on "no." in this iframe again still lies iframe with scrolling on "auto", for this iframe I would exchange with pleasure scrollbars. Unfortunately, the idea with fullbodyscroll has not helped me, I think one would have to define for iframe directly scrollbars. Unfortunately, do not point I whether this was generally feasible.

    March 11th, 2009

  108. Robert

    How do you maintain scroll position when clicking links within the scroll pane? Mine keeps jumping back to the top. I thought animateToInternalLinks and maintainPosition would allow this to happen but it seems like that is not the case.

    March 11th, 2009

  109. Hi P4r4dox,

    I think it is feasible to have jScrollPane make pretty scrollbars in an iframe. You will need to include jQuery and jScrollPane scripts inside the document in the iframe and use the code from the fullbodyscroll example inside the iframe. I think that should work...

    Hope it helps,

    Kelvin :)

    March 12th, 2009

  110. Hi Robert,

    That sounds like a bug - do you see the problem on my example pages too? Can you fill out a bug report on the googlecode issues list including a URL to the broken page and what browser you see the broken behaviour in? Then I will try to look into it...

    Thanks,

    Kelvin :)

    March 12th, 2009

  111. P4R4D0X

    Hi Kelvin

    Thanks for the tip, that works perfectly:-)

    March 15th, 2009

  112. Hello Kelvin!

    Thank you for a great plugin. Let me stick into discussion as recently I started to use JScrollPane on my site.

    Inside jScrollPane.js I found a piece of code, whose aim is to solve the
    isslues with [a href="#anchor" rel="nofollow"] links.

    $(document).bind(
    'click',
    function(e)
    {
    $target = $(e.target);
    if ($target.is('a')) {
    var h = $target.attr('href');
    if (h.substr(0, 1) == '#') {
    scrollTo(h);
    }
    }
    }
    );

    The problem is that this code works only when you directly click on the link.

    Imagine the situation when anchor is loaded as part of the url from different page.

    Like:
    http://www.fotoschool.eu/index.php?option=com_content&task=view&id=55244&Itemid=666392#JOSC_TOP

    I made a 'workaround' for this inside the page itself, using jQuery.url plugin for extracting the anchor text from url:

    var $j = jQuery.noConflict();
    $j(document).ready(function(){
    // Your code here
    $j('#content-relative').jScrollPane({showArrows:true, scrollbarWidth: 17, reinitialiseOnImageLoad:true, topshift: 130, dragMinHeight: 100, dragMaxHeight:100 });

    var anchorName = jQuery.url.attr("anchor");

    if (anchorName.length > 0) {

    var anchorSelector = "a[name='" + anchorName + "']";
    var anchor = $j(anchorSelector).eq(0);
    if (anchor.length > 0) {
    var pane = anchor.parents("#content-relative").eq(0);
    if (pane.length > 0) {
    //var pos = $anchor.offset().top - $pane.offset().top;
    pane[0].scrollTo(anchorSelector);
    }
    }
    }

    Is it possible to include this scrollTo(anchor) feature inside jScrollpane.js in future versions?

    March 17th, 2009

  113. Great work man, thanks so much for the contribution.

    March 17th, 2009

  114. Jorge

    Hi I have a question, can it be used in multiple hidden divs inside one page so when the are reveal they are scrollable?

    great code, by the way

    thanks

    March 17th, 2009

  115. Here's a quandry regarding this excellent bit of code you've created...

    I'm using a jscrollpane which includes two Flash elements embedded using the swfobject method. The page works perfectly in Safari and Firefox on the Mac, and passably in IE on the PC (the redraw while scrolling is ugly, but usable). However, in Firefox on the PC, the Flash content is not masked by the scrollpane and is visible when it's above and below the scrolling area.

    Suggestions?

    March 18th, 2009

  116. Hi All,

    @Ros: I think you missed some more of my code which scrolls the jScrollPane on initialisation if there is a hash in the URL. You can see it in action if you visit this URL:

    http://www.kelvinluck.com/assets/jquery/jScrollPane/jumpToExternalAnchorExample.html#marker

    Search for "location.hash" in the sourcecode to see how it works

    @P.J.: No worries - glad you like it :)

    @Jorge: Yes it can. There is currently a bug though where an element has to be visible when you initialise the scrollpane. So you will need to make sure that you initialise jScrollPane on each div after it is shown.

    @Andrew: Hmmm - that sounds like a problem. Could you open an issue on the googlecode site for this please (and include a demo URL). Then I'll try to find a solution... You could also confirm that FF doesn't display this problem on a normal overflow: auto div. And you could maybe try playing with the wmode of the embedded flash?

    Cheers,

    Kelvin :)

    March 18th, 2009

  117. Ros Ivantsev

    Hi Kelvin,

    Sorry for confusion with my question. Indeed, there is code that checks for anchors in url during initialization. For some reason it does not work on my site when viewed with Firefox... but before I figure it out there are some more questions

    1. Standard W3C anchor points look like <A name="anchorname">
    2. In your example 'anchors' are <DIV id="anchorname">

    Does jScrollpane workl with p.1 anchors or all anchors on page should be named like in p.2?

    March 21st, 2009

  118. Hi Ros,

    You can anchor to any element with an id. This is my prefered method because it means you aren't adding any extra markup to your page... I don't think jScrollPane will work with p.1 but you could try <A name="anchorname" id="anchorname">. I specifically check for an element with the relevant ID attribute inside the scroll pane - this is a much quicker selector that searching each elements name attribute (as behind the scenes jQuery is able to use getElementById)

    Hope that helps,

    Kelvin :)

    March 21st, 2009

  119. alberto

    hello there
    im using your plugin and it works great but ive got exact the same problem like andrew described some few posts earlier: "However, in Firefox on the PC, the Flash content is not masked by the scrollpane and is visible when it's above and below the scrolling area."
    any fix in sight for this?
    alberto

    March 23rd, 2009

  120. Hi Alberto,

    You need to set a wmode on your flash movie. See the googlecode issue:

    http://code.google.com/p/jscrollpane/issues/detail?id=82

    Cheers,

    Kelvin :)

    March 23rd, 2009

  121. Petr

    Hi,
    thank you for awesome script, I like to ask how to create something similar to http://www.abercrombie.com/webapp/wcs/stores/servlet/category1_10051_10901_13055_-1_12202

    I mean fullpage div with content and small slider, is it possible, I can't find example of this.

    Thank you

    April 1st, 2009

  122. Hi Petr,

    So you want the height of the scrollpane to be independent of the height of the element it is scrolling? That isn't currently possible with jScrollPane and I'm not sure it is a very normal use-case so I don't know if I would add it in... You should be able to hack it in yourself though...

    Cheers,

    Kelvin :)

    April 1st, 2009

  123. Hi. I'm just about to go crazy, seeing that everything worked fine a couple hours ago and suddenly, the script's not working. I can't see any possible reasons why it's not...can you see anything that's wrong?
    Thank you.

    April 1st, 2009

  124. Hi Nicole,

    I can't really help without a URL!

    Cheers,

    Kelvin :)

    April 1st, 2009

  125. Well, I've only applied the script function to my home page because I didn't want to have to fix the problem twice. But if you want a direct link, you can look at the source of http://nicole.illusivehopes.net/index.php.

    April 1st, 2009

  126. I just had a look and it looks like you are using scriptalicious on the same page as jquery and jscrollpane. You will need to use jquery in noconflict mode and you will need to use "jQuery" instead of "$" when you are initialising jScrollPane.

    Hope that helps,

    Kelvin :)

    April 1st, 2009

  127. Oh my God, you're a genius. It worked! Thank you so much! What a waste of tears. XD
    Thanks!!

    April 1st, 2009

  128. Chris

    Hi Kevin,
    i just wanted to say thanks for the plugin!
    i did have an error that someone else experienced above where ie7 doesnt render the scroller correctly, and wanted to give you the fix:

    ~ line 123:
    change
    var p = this.originalSidePaddingTotal;

    to

    var p = (this.originalSidePaddingTotal) ? this.originalSidePaddingTotal : 0;

    originalSidePaddingTotal is only set if the parent is not the container, and is undefined in my situation. setting it to 0 where it doesnt exist fixes things downstream

    April 2nd, 2009

  129. Hi Chris,

    Thanks for the feedback. I don't think the change is necessary though. This problem normally shows up when people add the jScrollPane container into their generated HTML manually. You should not do this, the container is added by the javascript when the jScrollPane is first initialised. If you have an example URL for a page where you needed this fix then please send it to me and I'll try to help you debug,

    Cheers,

    Kelvin :)

    April 2nd, 2009

  130. I am developing a site in textpattern, and jscrollpane works great except for one little bug... All subpages on the site shrink by 95% when the javascript is executed. My homepage looks fine. I think there may be some conflict with my stylesheet, but I can't narrow it down to any specific selectors. The problem seems to effect every element on the page

    The problem page is at "www.troublmedia.org/troublmag/". User - troubl. Password - introubl. If you click on one of the archives links, or on contact, or about, the page that follows will be a little smaller than the homepage.

    Any help towards a solution would be greatly appreciated.

    Thanks,

    Derrick Meadows
    awayfromhear.com

    April 7th, 2009

  131. Kevin, I read through the comments above and my problem was similar to Nicole's.. javascript library conflict. Thanks for the informative and helpful article.

    April 7th, 2009

  132. After a second look, removing references to other scripts did not solve my problem. For some reason, subpage content still shrinks onload. I'll be patient for a response this time instead of flooding your comments.

    Problem page: troublmedia.com/troublmag/index.php
    user name - troubl
    password - introubl

    If you click on any of the nav links, you'll notice the page resize. Thanks.

    April 7th, 2009

  133. Spires

    Thanks for the work, Kelvin.
    Appreciate the plugin!

    I've dived head first into jQuery and jScrollPane, so my appologies if I repeat anything from other users.

    I'm running into two issues on the same div:

    1) The scroll arrows disappear when the bar reaches the top or bottom of the bar.
    Thought maybe it was an image issue, but when I hover over the arrow the image position adjusts appropriately and I see the second image.

    2) Utilizing jQuery's .slideUp() and .slideDown() causes the content & scroll bar to never reappear.
    When the div is displayed on page load, jScrollPane initializes just fine and shows the scrollbar. Triggering .slideUp() rolls the content away; triggering .slideDown() the content never comes back. No content and no scrollbar.
    Without jScrollPane the site code works beautifully, content comes and goes, with the default scroll bars in place. My feeling is I'm in need of taking another initialization step when the div is revealed again. Not sure how, when, or where, though :-(

    Thanks for the efforts.

    Best regards,
    Spires

    April 7th, 2009

  134. Jon R. Humphrey

    Morning Kelvin,

    First, thanks for this plugin! :-D

    Second, seem to found a few issues which nothing I change seem to fix:

    A. If I don't specify an inline width and height for both the parent and scrollpane containers I end up with a situation like PETROCKET above where the container goes very wide, all the text is on single lines, and the scrollbar is hidden by the overflow.

    B. With the widht and height specified inline, I then get areas where the content seems longer than actually is, as in there is a lot of "empty" space below the last paragraph; this also ties into the third issue.

    C. Now content which should be smaller than the max height set still gets scrollbars, but not every one? I've been able to determine that there were some added paragraph elements and removed them, but this has not solved everything.

    And D. In IE6 my arrows flicker as the scroll happens.

    Now, I've modified some of the css to allow the same arrow images site-wide, and I added a new setting to the plugin: dragPaneWidth because I was orignally going to use -moz/-webkit-border-radius and make the drag ovalish in shape without using images. But that's it!

    So if there could be any help with these I would be immensly grateful!

    Link follows in email as usual client NDC issues pertain.

    Cheers,
    Jon

    April 9th, 2009

  135. Hi Derrick,

    Sorry for the slow reply... I just looked at your test page and I couldn't see the resizing happening. Did you find a solution? If you are still seeing the problem please open an issue on the googlecode issues list including information about which browser(s) you are seeing the problem in,

    Cheers,

    Kelvin :)

    April 10th, 2009

  136. Hi Spires,

    1) This could be to do with the "disabled" state which is added to the arrows when they can't scroll any more. Do you have any css rules related to a class of disabled which could be causing issues? Do you see the problems on my example pages? Can you provide a URL demonstrating the problem?

    2) Yes - you need to use the callback to the jquery slide functons to reinitialise the jScrollPane once the resizing is done. You may even want to have a timeout which reinitialised the jScrollPane every 200 milliseconds or so while the animation happens and cancel this timeout in the complete callback.

    Hope that helps,

    Kelvin :)

    April 10th, 2009

  137. Hi Jon,

    A. You should only need an explicit height and width for the container that you are changing into a jScrollPane. You can apply this height and width via a CSS class or ID rather than inline.

    B & C. The size of the content includes any margins or padding. So for example, if your content is paragraphs these have a default bottom margin which may be causing what you are seeing. Try setting the margin-bottom of the last paragraph to 0.

    D. Do you see this on my examples as well?

    Hope that helps,

    Kelvin :)

    April 10th, 2009

  138. Breaks in Safari. Works fine in Firefox, IE, Chrome, Flock.

    url - http://www.troublmedia.com/troublmag/

    user - troubl
    pass - introubl

    --------------------

    BTW, I commented earlier about page resize issues, where every element on the page shrinks proportionally. That seems to be a browser specific css issue that happens to occur on the same page, but it's unrelated to jscrollpane.

    April 13th, 2009

  139. Breaks in Safari. Works fine in Firefox, IE, Chrome, Flock.

    url - http://www.troublmedia.com/troublmag/

    user - troubl
    pass - introubl

    --------------------

    BTW, I commented earlier about page resize issues, where every element on the page shrinks proportionally. That seems to be a browser specific css issue that happens to occur on the same page, but it's unrelated to jscrollpane.

    April 13th, 2009

  140. Jason

    Hi,
    I am trying to make a widget using jquery and I am using your scrollpane script. I am embedding everything in one script and scrollpane is not working due to jquery load. Please see this code

    document.write('');
    document.write('');

    when I initialize scrollpane I get jQuery is not defined.
    jQuery(function(){jQuery('.scroll-pane').jScrollPane({showArrows:true, scrollbarWidth: 10});});

    I have noticed jquery is taking time in loading and script passes so quickly to other code.

    Any suggestion how can I overcome this problem? After commenting scroll pane code rest works fine including jquery code which is at last lines.

    Btw: I also tried to put everything in a single but still no luck

    April 13th, 2009

  141. Jon R. Humphrey

    Kelvin,

    Sorry for the delayed response, thanks for the help with A, B & C! I got it working ... I had not set the "holder" div to overflow: hidden; which now works fine!

    And for D, yes on your pages the arrows disappear in IE6. I checked using "Multiple IE's" and this page:

    http://www.kelvinluck.com/assets/jquery/jScrollPane/examples.html

    and this:

    http://www.kelvinluck.com/assets/jquery/jScrollPane/scrollTo.html

    To note: they also disappear when using the scrollTo link!

    If you need any help with testing, please do not hesitate to ask, it's the least I could do!

    I hope this helps!

    Cheers!

    Jon

    April 14th, 2009

  142. Jason

    Hello again,
    I just realized the scrollpane is not working in IE 6 and IE 7. The contents of scrollpane are showing on right side. IE8 shows fine

    here is my code
    jQuery(function(){jQuery(".scroll-pane").jScrollPane({showArrows:true,scrollbarWidth:10})})

    any suggestion?

    April 14th, 2009

  143. Jon R. Humphrey

    Me again!

    I've got a new one for you... have you run into a situation where the container's height is not fully determined and therefore some of the bottom contents are cut off?

    If you use the link I sent you before, and view the awards section, you should see what I mean. Let the page load, scroll down, note what the bottom award is, refresh and look again?

    Let me know, I've got it on all the browsers now?

    Cheers,
    Jon

    April 14th, 2009

  144. Jon R. Humphrey

    So sorry, after re-reading the comments above, and looking at the code, I realised I hadn't specified the height's of the images in the listing!

    Please ignore the above reqest!
    J

    April 14th, 2009

  145. Hi everyone,

    @Derrick - I can reproduce your problem in Safari on my computer. I will try to debug further and I'll update the googlecode ticket when I make any progress.

    @Jason - it looks like my blog cut out most of your code so I can't see what you were saying... Can you post a URL? Or create an issue on the googlecode page (where you can post code).

    @Jon. Re. D - weird - in my IE6 (also installed using Multiple IE) the arrows don't disappear. And cool you figured the rest out!

    Cheers,

    Kelvin :)

    April 14th, 2009

  146. Sabin

    Hi Kelvin,

    I can successfully implement the scrollbar in single aspx page. But when i used it inside the ajax modalpopupextender i get the error "invalid arguement". Any help would be highly appreciable.

    April 14th, 2009

  147. Sabin

    Hi Kelvin,

    I can successfully implement the scrollbar in single aspx page. But when i used it inside the ajax modalpopupextender i get the error "invalid arguement". Any help would be highly appreciable.

    sabin

    April 14th, 2009

  148. kyle monday

    Hi Kelvin,

    I'm having an issue getting jscrollpane to reinitialise under a certain condition; namely, I have a series of divs that expand and collapse accordion style, utilizing the slideToggle plugin for jquery; this basically just hides and shows these divs, which could be of any height. These divs are all contained within the scrollpane div; so, when clicking on these expand-collapse divs, the height adjusts, but the scrollpane doesn't show up. How do I reinitialize the jscrollpane when there is no call to the server and the page doesn't refresh? I have reinitialiseonimageload happening when the page loads, but it doesn't work under this condition.

    Kyle

    April 15th, 2009

  149. Jon Humphrey

    Kyle!

    Kelvin, sorry to hijack this; please let me repay your work with some of mine!

    I just built something that does exactly this! Email me at jon(at)randomprecision(dot)co(dot)uk for an answer! I'm on my train ride home but can reply in about an hour with code!

    April 15th, 2009

  150. Jon R. Humphrey

    Kyle,

    I hope this snippet can help you!

    Now I encapsulate my accordions in a DL, using the DT for the clickable title and the DD as the information; it just made sense to me! ;-D

    So, here is a snippet which I know works as I'm currently using it! This also allows you to pass a hash to the page to enable individual accordions opening on page load! (Credit goes to Remy Sharp [http://remysharp.com/] for the inspiration!)

    // if there is a hash on the url, filter the links by the hash prop
    var toshow = window.location.hash ? '[hash=' + window.location.hash + ']' : ':first';
    //Grab the articles into an variable; #news-accordion is a DL tag here;
    var containers = $('#news-accordion > dd');

    $('#news-accordion dt a.opener').click(function () {

    //On click hide everything and then filter through
    containers.hide().filter(this.hash).show()

    //the .article class is the container with the width,height and overflow:auto set;
    .find('.article').show().jScrollPane({
    showArrows: true,
    scrollbarWidth: 16,
    scrollbarMargin: 10,
    arrowSize: 16,
    dragMaxHeight: 370
    });
    //You can add specific styles to all open containers with this:
    $('#news-accordion dt a.opener').removeClass('selected');
    $(this).addClass('selected');
    //If the Hash is passed then initiate and open
    }).filter(toshow).click();

    I hope this helps!

    Cheers,
    Jon

    April 16th, 2009

  151. Hi,

    @Sabin - Can you provide an example URL? I'm not familiar with what a "ajax modalpopupextender" does...

    @Kyle - hopefully Jon's example helps? Basically the jScrollPane needs to be initialised when the accordian is opened (as the hidden element has a height of 0 which messes up the initialisation).

    @Jon - No problem with hijacking - thank you for jumping in and helping Kyle out :)

    Cheers,

    Kelvin :)

    April 19th, 2009

  152. Sorry, I wrote you an email too, but probably others would like to know this also. Is it possible the give the scrollbar an different height and position that the div it scrolls? I would like to have the scrollbar alsways bottom left of the div I scroll and 150px heigh.

    Thanks fpr this great script!
    Thomas

    April 19th, 2009

  153. Luca

    Hi Kevin,
    thank you for your plugin.
    I have a problem: try to open this page (http://tinyurl.com/d5vfnc) and you'll see that in IE everything is right but in Firefox and Safari it's a fine mess. Can you help me?
    Thank you in advance.

    P.S.: coming back from tinyurl (in Firefox), the page rendered perfectly (!!!)
    maybe some initialization issue?

    April 22nd, 2009

  154. Hi,

    @Thomas - sorry, that is not possible,

    @Luca - I opened it in firefox but I can't see any problems.. Was the problem somehow related to jScrollPane? I can't see any scrollpanes either!

    Cheers,

    Kelvin :)

    April 24th, 2009

  155. There is a new google group for getting support for jScrollPane. This comments thread has got too long to manage and isn't threaded which makes it hard to keep track of individual comments. So I am going to close comments here and ask everybody who needs support for jScrollPane to join the group here:

    http://groups.google.com/group/jscrollpane/

    (or by sending an email to jscrollpane-subscribe AT googlegroups DOT com)

    I would also like to encourage anyone who has used jScrollPane and is familar with it to also join the group and maybe help out by answering some questions from the newbies. Thanks!

    April 24th, 2009

  1. 10 jQuery?????? « ??? - June 11, 2011