うーん..jScrollPaneにはマウスホイールを有効/無効にするものがないようですが、私が思う2つの解決策を見つけることができます:
jqueryマウスホイールプラグイン(jScrollPaneではオプション)を含めないでください
$(**yourcontainer**).jScrollPane();
次のようなものを使用した後、コンテナの「mousewheel」イベントをjQueryでバインド解除
します。
$(**yourcontainer**).unbind('mousewheel');
編集 :
マウスホイールイベントをバインドするプラグインコードは次のとおりです。
$container.bind(
'mousewheel',
function (event, delta) {
delta = delta || (event.wheelDelta ? event.wheelDelta / 120 : (event.detail) ? -event.detail/3 : 0);
initDrag();
ceaseAnimation();
var d = dragPosition;
positionDrag(dragPosition - delta * mouseWheelMultiplier);
var dragOccured = d != dragPosition;
return !dragOccured;
}
);
そしてここにプラグインとその設定の説明があります:
* @name jScrollPane
* @type jQuery
* @param Object settings hash with options, described below.
* scrollbarWidth - The width of the generated scrollbar in pixels
* scrollbarMargin - The amount of space to leave on the side of the scrollbar in pixels
* wheelSpeed - The speed the pane will scroll in response to the mouse wheel in pixels
* showArrows - Whether to display arrows for the user to scroll with
* arrowSize - The height of the arrow buttons if showArrows=true
* animateTo - Whether to animate when calling scrollTo and scrollBy
* dragMinHeight - The minimum height to allow the drag bar to be
* dragMaxHeight - The maximum height to allow the drag bar to be
* animateInterval - The interval in milliseconds to update an animating scrollPane (default 100)
* animateStep - The amount to divide the remaining scroll distance by when animating (default 3)
* maintainPosition- Whether you want the contents of the scroll pane to maintain it's position when you re-initialise it - so it doesn't scroll as you add more content (default true)
* tabIndex - The tabindex for this jScrollPane to control when it is tabbed to when navigating via keyboard (default 0)
* enableKeyboardNavigation - Whether to allow keyboard scrolling of this jScrollPane when it is focused (default true)
* animateToInternalLinks - Whether the move to an internal link (e.g. when it's focused by tabbing or by a hash change in the URL) should be animated or instant (default false)
* scrollbarOnLeft - Display the scrollbar on the left side? (needs stylesheet changes, see examples.html)
* reinitialiseOnImageLoad - Whether the jScrollPane should automatically re-initialise itself when any contained images are loaded (default false)
* topCapHeight - The height of the "cap" area between the top of the jScrollPane and the top of the track/ buttons
* bottomCapHeight - The height of the "cap" area between the bottom of the jScrollPane and the bottom of the track/ buttons
* observeHash - Whether jScrollPane should attempt to automagically scroll to the correct place when an anchor inside the scrollpane is linked to (default true)
* @return jQuery