Options
All
  • Public
  • Public/Protected
  • All
Menu

The JScroll instance that is created when initializing an element via the jQuery plugin. It can be accessed via the jsp data attribute of the jQuery element: $(scrollPanelElement).data("jsp").

Hierarchy

  • JScrollPaneInstance

Index

Methods

  • animate(ele: JQuery<HTMLElement>, prop: string, value: unknown, stepCallback: ((this: HTMLElement) => void)): void
  • This method is called when JScrollPane is trying to animate to a new position. You can override it if you want to provide advanced animation functionality.

    Parameters

    • ele: JQuery<HTMLElement>

      The element whose position is being animated

    • prop: string

      The property that is being animated

    • value: unknown

      The value it's being animated to

    • stepCallback: ((this: HTMLElement) => void)

      A function that will be executed after the animation had finished.

        • (this: HTMLElement): void
        • Parameters

          • this: HTMLElement

          Returns void

    Returns void

  • destroy(): void
  • Destroys the JScrollPane on the instance matching this API object and restores the browser's default behavior.

    Returns void

  • getContentHeight(): number
  • Finds the height of the content within the scroll pane.

    Returns number

    The height of the content within the scroll pane.

  • getContentPane(): JQuery<HTMLElement>
  • Gets a reference to the content pane. It is important that you use this method if you want to edit the content of your JScrollPane as if you access the element directly then you may have some problems (as your original element has had additional elements for the scrollbars etc added into it).

    Returns JQuery<HTMLElement>

    The content pane of this scroll pane.

  • getContentPositionX(): number
  • Finds the current x position of the viewport with regards to the content pane.

    Returns number

    The current x position of the viewport with regards to the content pane.

  • getContentPositionY(): number
  • Finds the current y position of the viewport with regards to the content pane.

    Returns number

    The current y position of the viewport with regards to the content pane.

  • getContentWidth(): number
  • Finds the width of the content within the scroll pane.

    Returns number

    The width of the content within the scroll pane.

  • getIsScrollableH(): boolean
  • Checks whether or not this scroll pane has a horizontal scrollbar.

    Returns boolean

    Whether or not this scroll pane has a horizontal scrollbar.

  • getIsScrollableV(): boolean
  • Checks whether or not this scroll pane has a vertical scrollbar.

    Returns boolean

    Whether or not this scroll pane has a vertical scrollbar.

  • getPercentScrolledX(): number
  • Finds the horizontal position of the viewport within the pane content

    Returns number

    The horizontal position of the viewport within the pane content.

  • getPercentScrolledY(): number
  • Finds the vertical position of the viewport within the pane content.

    Returns number

    The vertical position of the viewport within the pane content.

  • hijackInternalLinks(): void
  • Hijacks the links on the page which link to content inside the scroll pane. If you have changed the content of your page (e.g. via AJAX) and want to make sure any new anchor links to the contents of your scroll pane will work then call this function.

    Returns void

  • positionDragX(x: number, animate?: boolean): void
  • Positions the horizontal drag at the specified x position (and updates the viewport to reflect this)

    Parameters

    • x: number

      New position of the horizontal drag.

    • Optional animate: boolean

      Whether an animation should occur. If you don't provide this argument then the animateScroll value from the settings object is used instead.

    Returns void

  • positionDragY(y: number, animate?: boolean): void
  • Positions the vertical drag at the specified y position (and updates the viewport to reflect this)

    Parameters

    • y: number
    • Optional animate: boolean

      Whether an animation should occur. If you don't provide this argument then the animateScroll value from the settings object is used instead.

    Returns void

  • Reinitializes the scroll pane (if it's internal dimensions have changed since the last time it was initialized).

    The settings object which is passed in will override any settings from the previous time it was initialized - if you don't pass any settings then the ones from the previous initialization will be used.

    Parameters

    Returns void

  • scrollBy(deltaX: number, deltaY: number, animate?: boolean): void
  • Scrolls the pane by the specified amount of pixels.

    Parameters

    • deltaX: number

      Number of pixels to scroll horizontally

    • deltaY: number

      Number of pixels to scroll vertically

    • Optional animate: boolean

      Whether an animation should occur. If you don't provide this argument then the animateScroll value from the settings object is used instead.

    Returns void

  • scrollByX(deltaX: number, animate?: boolean): void
  • Scrolls the pane by the specified amount of pixels.

    Parameters

    • deltaX: number

      Number of pixels to scroll horizontally

    • Optional animate: boolean

      Whether an animation should occur. If you don't provide this argument then the animateScroll value from the settings object is used instead.

    Returns void

  • scrollByY(deltaY: number, animate?: boolean): void
  • Scrolls the pane by the specified amount of pixels

    Parameters

    • deltaY: number

      Number of pixels to scroll vertically

    • Optional animate: boolean

      Whether an animation should occur. If you don't provide this argument then the animateScroll value from the settings object is used instead.

    Returns void

  • scrollTo(destX: number, destY: number, animate?: boolean): void
  • Scrolls the pane so that the specified co-ordinates within the content are at the top left of the viewport.

    Parameters

    • destX: number

      Left position of the viewport to scroll to

    • destY: number

      Top position of the viewport to scroll to

    • Optional animate: boolean

      Whether an animation should occur. If you don't provide this argument then the animateScroll value from the settings object is used instead.

    Returns void

  • scrollToBottom(animate?: boolean): void
  • Scrolls this scroll pane down as far as it can currently scroll.

    Parameters

    • Optional animate: boolean

      Whether an animation should occur. If you don't provide this argument then the animateScroll value from the settings object is used instead.

    Returns void

  • scrollToElement(ele: string | HTMLElement | JQuery<HTMLElement>, stickToTop?: boolean, animate?: boolean): void
  • Scrolls the specified element into view so that it can be seen within the viewport.

    Parameters

    • ele: string | HTMLElement | JQuery<HTMLElement>

      A CSS selector, HTML element of jQuery wrapper object to scroll to.

    • Optional stickToTop: boolean

      If it is true then the element will appear at the top of the viewport, if it is false then the viewport will scroll as little as possible to show the element.

    • Optional animate: boolean

      Whether an animation should occur. If you don't provide this argument then the animateScroll value from the settings object is used instead.

    Returns void

  • scrollToPercentX(destPercentX: number, animate?: boolean): void
  • Scrolls the pane to the specified percentage of its maximum horizontal scroll position.

    Parameters

    • destPercentX: number

      Percentage from left of the full width of the viewport to scroll to

    • Optional animate: boolean

      Whether an animation should occur. If you don't provide this argument then the animateScroll value from the settings object is used instead.

    Returns void

  • scrollToPercentY(destPercentY: number, animate?: boolean): void
  • Scrolls the pane to the specified percentage of its maximum vertical scroll position.

    Parameters

    • destPercentY: number

      Percentage from top of the full width of the viewport to scroll to

    • Optional animate: boolean

      Whether an animation should occur. If you don't provide this argument then the animateScroll value from the settings object is used instead.

    Returns void

  • scrollToX(destX: number, animate?: boolean): void
  • Scrolls the pane so that the specified co-ordinate within the content is at the left of the viewport.

    Parameters

    • destX: number

      Left position of the viewport to scroll to.

    • Optional animate: boolean

      Whether an animation should occur. If you don't provide this argument then the animateScroll value from the settings object is used instead.

    Returns void

  • scrollToY(destY: number, animate?: boolean): void
  • Scrolls the pane so that the specified co-ordinate within the content is at the top of the viewport.

    Parameters

    • destY: number

      Top position of the viewport to scroll to

    • Optional animate: boolean

      Whether an animation should occur. If you don't provide this argument then the animateScroll value from the settings object is used instead.

    Returns void

Generated using TypeDoc