DragLib

Slider Module

Tutorial

Instance Methods, properties, and Event Handlers

On the previous page, you learned how to get a Slider instance. On this page, you will learn some things that you can do with that instance.

Reference

  1. Instance Methods
    • slideToX(i) - Slide the handle to i position on x-axis
    • slideToY(i) - Slide the handle to i position on y-axis
    • setValue Sets the value of the
  2. Instance Properties
    Property Data Type Description
    handle Object The handle that is used to drag the object. If no handle has been set, then the object itself is returned.
    minValue Number the number representing the slider's value at its lowest position
    maxValue Number the number representing the slider's value at its highest position
    trackbar Object The slider's trackbar is also the slider's handles's container.
  3. Event Handlers
    • onslide

      Fires when the object slider moves, either by clicking the slider handle or clicking in the trackbar.

      When the onslide handler fires, you can retreive the slider's value and rationalValue.

Class Name Permutations

When a slider is focused (by clicking), and dropped (by releasing the mouse button) the className token "focus" is added to/removed from the handle's element.

The className token "scrollbar-track-active" is added to /removed from the trackbar.

Event Object whose className is changed className token added className token removed
onbeforedragstart trackbar scrollbar-track-active -
handle focus -
ondragend trackbar - scrollbar-track-active
handle - focus

The style rules for focus and scrollbar-track-active can be changed in the css file.

A Slider's handle is a DragObj

As previously stated, a slider's handle is a drag object. Any methods of of a DragObj instance can be called on a slider's handle.

 

*AnimTree
*Tabs
*GlideMenus
*DragLib