Show:

Q drawers Class

Implements vertical drawers that work on most modern browsers, including ones on touchscreens.

Constructor

Q drawers

(
  • [options]
  • [options.triggers=['{{Q}}/img/drawers/up.png',
  • [options.fullscreen=Q.info.isMobile
  • [options.beforeSwap=new
  • [options.onSwap=new
)
Q.Tool

Parameters:

  • [options] Object optional

    Override various options for this tool

    • [container=null] Element optional

      Optional container element for handling scrolling

    • [initial] Object optional

      Information for the initial animation

      • [index=1] Number optional
        The index of the drawer to show, either 0 or 1
      • [delay=0] Number optional
        Delay before starting initial animation
      • [duration=300] Number optional
        The duration of the initial animation
      • [ease=Q.Animation.linear] Function optional
        The easing function of the initial animation
    • [transition] Object optional

      Information for the transition animation

      • [duration=300] Number optional
        The duration of the transition animation
      • [ease=Q.Animation.linear] Function optional
        The easing function of the transition animation
    • [width] Function optional

      Override the function that computes the width of the drawers

    • [height] Function optional

      Override the function that computes the height drawers tool

    • [heights=[100,100] Array optional

      Array of [height0, height1] for drawers that are pinned. Can contain numbers or functions returning numbers, or names of functions.

    • [placeholders=['',''] Array optional

      Array of [html0, html1] for drawers that are pinned.

    • [behind=[true,false] Array optional

      Array of [boolean0, boolean1] to indicate which drawer is behind the others

    • [bottom=[false,false] Array optional

      Array of [boolean0, boolean1] to indicate whether to scroll to the bottom of a drawer after switching to it

    • [trigger] Object optional

      Options for the trigger elements

      • [rightMargin=10] Number optional
        How many pixels from the right side of the drawers
    • [transition=300] Number optional

      Number of milliseconds for fading in the trigger images

    • [foregroundZIndex=50] Number optional

      The z-index of the drawer in the foreground

  • [options.triggers=['{{Q}}/img/drawers/up.png', Array

    '{{Q}}/img/drawers/down.png']] Array of [src0, src1] for img elements that act as triggers to swap drawers. Set array elements to false to avoid rendering a trigger.

  • [options.fullscreen=Q.info.isMobile Boolean

    && Q.info.isAndroid(1000)]] Whether the drawers should take up the whole screen

  • [options.beforeSwap=new Number

    Q.Event()] Occurs right before drawer swap

  • [options.onSwap=new Number

    Q.Event()] Occurs right after drawer swap

Returns:

Item Index