0

Here are the settings:

$(function()
{
    $('.info').jScrollPane(
        {showArrows: true, hijackInternalLinks: true, animateScroll: true}
    );
}); 

The problem is the animateScroll: true conflicting with the arrows but I need that for my internal anchor links.

I assume this will fix the conflict. When you click the arrow button: <a class="jspArrow jspArrowDown jspActive"</a> it will change the jScrollPane settings to animateScroll: false then when you unclick it reverts to animateScroll: true

I hope this makese sense. Any help would be great.

Edit

Sorry for not getting back sooner. I have set up a demo, as you can see the down arrow doesn't work. I think its related to animateScroll: true

http://jsfiddle.net/sVSsy/

Thanks

Community
  • 1
  • 1
uriah
  • 2,485
  • 5
  • 28
  • 40

4 Answers4

1

There is no problem seen on the official scroll_to_animate.html DEMO page using both options you require when the DIV's width is around 600px.

The solution is to use the jScrollPane arrowButtonSpeed Option with a value other than the default 0 when using smaller sized DIV's such as your 300px width when using certain browsers, like Chrome.

This jsfiddle update also has a removed asset of a duplicated mouse script, replaced a duplicate ID 'one' with an additional ID 'four' for DIV content since an ID can only be used once. You'll see other speed settings with their default values that you can experiment with for any changes in your DIV size.

Here's the updated jsfiddle:
http://jsfiddle.net/sVSsy/3/

arttronics
  • 9,957
  • 2
  • 26
  • 62
  • Fantastic, I didn't see the arrowButtonSpeed option. Thank you so much for a great answer! – uriah May 15 '12 at 13:51
  • If you look at the non-minified **jquery.jscrollpane.js** file you will see at the very bottom all the options and default settings. That will give you excellent information about the API options currently used, to research a little further if required. – arttronics May 15 '12 at 14:04
  • Great tip, I'll do that in the future as well. – uriah May 15 '12 at 14:05
0

try to destroy and rebuild it with what attribute you want.

var api= $('#element').data('jsp');
api.destroy();
$('#element').jScrollPane({animateScroll: true});
littlealien
  • 429
  • 4
  • 11
0

did you try something like :

$('yourelement').click(function(){
    if($('panedelement').jScrollPane.animateScroll === true)
        $('panedelement').jScrollPane.animateScroll = false;
    else
        $('panedelement').jScrollPane.animateScroll = true
});
jbduzan
  • 1,106
  • 1
  • 14
  • 30
-1

You can bind to the onmousedown and onmouseup events:

http://www.w3schools.com/jsref/event_onmousedown.asp http://www.w3schools.com/jsref/event_onmouseup.asp

So, on mouse down on an arrow, you would set animateScroll to false, and on up you would set animateScroll to true.

servarevitas3
  • 483
  • 1
  • 6
  • 23