Description

Performs the scrolling with the mouse.

Usage

Parameters

  • clip {CanvasEngine.Element}

    Element containing the main element in the second parameter of this method. Indicate the dimensions of the element

  • content {CanvasEngine.Element}

    Element with the content to scroll. Indicate the dimensions of the element

  • callbacks {Object}

    (optinal) Different callbacks

    • dragstart : When the user starts to scroll
    • drag : When the user scrolls
    • onTop : When the scroller reaches the top of the element
    • onBottom : When the scroller reaches the bottom of the element

    return {CanvasEngine.Scrolling}

Example

In method ready

var clip = this.createElement(300, 350), // Dimensions of the element
    content = this.createElement(300, 800); // Dimensions of the element

var scroll = canvas.Scrolling.New(this);
scroll.mouseScroll(clip, content);

stage.append(clip);

Discussion