new ng.Slider (Object options) vs. 1.1.1 Full+Lite

The Slider is a visual control used to select a single or multiple values from a continuous range of values. Sliders are always displayed as horizontal, vertical or rectangle bars. An indicator, or thumb, notes the current value of the slider and can be moved by the user to change the setting.

Features

  • Horizontal, Vertical or Rectangle slider
  • Create range off sections (where the user can't select).
  • Set any number of thumbs
  • Customize the width, height, steps increment and values
  • Sinkable via CSS

Parameters

Object options vs. 1.1.1 Full+Lite
An option object that holds the Slider properties.

Examples

Basic Sliders
In this example, we'll create basic sliders in three different types.
Demo:
Horizontal Slider:
Vertical Slider:
Rectangle Slider:
Advance Sliders
In this example, we'll add different type of options to show how to block different areas and change the values of the slider.
Demo:
Horizontal Slider:
Vertical Slider:
Rectangle Slider:
Range Slider
In this example, we'll create a range slider by changing the CSS background to the first fill object.
Demo:
Range Slider: $25 $75

Inheritance Tree

This class inherits the following classes and all their methods and properties. It's recommended to check if any private properties/options are defined before using them. The complete list of inheritted methods and events are listed below the current object Custom Events.
ng.Events ()
ng.PlugIn (options)
ng.Component (options)
ng.Slider (options)

Methods

Function ng.Slider.get_value () vs. 1.1.1 Full+Lite
Gets the current slider value.
Function ng.Slider.set_width (width) vs. 1.1.1 Full+Lite
Sets the slider width.
Function ng.Slider.get_width () vs. 1.1.1 Full+Lite
Gets the slider width.
Function ng.Slider.set_height (height) vs. 1.1.1 Full+Lite
Sets the slider height.
Function ng.Slider.get_height () vs. 1.1.1 Full+Lite
Gets the slider height.
Function ng.Slider.set_start (start) vs. 1.1.1 Full+Lite
Set the start value for the slider.
Function ng.Slider.get_start () vs. 1.1.1 Full+Lite
Gets the slider start value.
Function ng.Slider.set_end (end) vs. 1.1.1 Full+Lite
Sets the end value of the slider.
Function ng.Slider.get_end () vs. 1.1.1 Full+Lite
Gets the slider end value.
Function ng.Slider.set_step (step) vs. 1.1.1 Full+Lite
Sets the slider increment steps.
Function ng.Slider.get_step () vs. 1.1.1 Full+Lite
Gets the increment step of the slider.
Function ng.Slider.set_range_off (range_off) vs. 1.1.1 Full+Lite
Sets the slider range off.
Function ng.Slider.get_range_off () vs. 1.1.1 Full+Lite
Gets the range off array.

Custom Events

In the events' functions, the this will refer to the class object.
Event onSlide vs. 1.1.1 Full+Lite
Fires whenever the user slide a thumb. The event method will receive the sliding value and the thumb number that the user is moving (e.g function(val, thumb){/*...*/});
Event onMouseDown vs. 1.1.1 Full+Lite
Fires when the user press the mouse button over the sliding area. The method for this event will receive the mouse down event.
Event onMouseUp vs. 1.1.1 Full+Lite
Fires when the user release the mouse button over the sliding area. The method for this event will receive the mouse up event.
Event onChange vs. 1.1.1 Full+Lite
Fires when the user make a selection by sliding the thumbs or changing the input field.
Function ng.Slider.set_value (value) vs. 1.1.1 Full+Lite
Sets the slider value.

ng.Events () Methods

Some of these methods might be overriden by the inheriting class.
Function ng.Events.add_event (evt, func) vs. 1.1.0 Full+Lite
The add_event method will attach an event listener to an object. When the event is fired, the listeners functions will be executed on last added first run approach.
Function ng.Events.add_events (obj) vs. 1.1.0 Full+Lite
This method works the same way as Events.add_event(evt, func) except it takes an object with a list of events and functions.
Function ng.Events.remove_event (evt, func) vs. 1.1.0 Full+Lite
Remove the function func from the event evt queue. When adding the event, you should add the function by reference. Anonymous functions cannot be removed.
Function ng.Events.remove_events (obj) vs. 1.1.0 Full+Lite
This method works the same way as Events.remove_event(evt, func) except it takes an object with a list of events and functions.
Function ng.Events.clear_events (evt) vs. 1.1.0 Full+Lite
Remove all the functions under the event name evt.
Function ng.Events.clear_all_events () vs. 1.1.0 Full+Lite
This function works the same way Events.clear_events(evt) except it removes all the events attached to the object.
Function ng.Events.fire_event (evt_nm, args, evt) vs. 1.1.0 Full+Lite
Executes all the functions in the event evt_nm queue. Functions are executed in lasted added first exectued order.

ng.PlugIn (options) Methods

Some of these methods might be overriden by the inheriting class.
Function ng.PlugIn.get_position () vs. 1.1.0 Full+Lite
Get the plugin holding object position.
Function ng.PlugIn.get_width () vs. 1.1.0 Full+Lite
Get the ng.PlugIn holding object width.
Function ng.PlugIn.get_heigh () vs. 1.1.0 Full+Lite
Get the ng.PlugIn holding object height.
Function ng.PlugIn.set_object (obj) vs. 1.1.0 Full+Lite
Sets the ng.PlugIn holding HTML Element. The HTML Element should hold all the output and handles any events.
Function ng.PlugIn.get_object () vs. 1.1.0 Full+Lite
Gets the HTML Elements that holds the ng.PlugIn output.
Function ng.PlugIn.make_id (txt) vs. 1.1.0 Full+Lite
Creates a unique id for the ng.PlugIn object.
Function ng.PlugIn.get_id () vs. 1.1.0 Full+Lite
Get's the plugin ID.
Function ng.PlugIn.set_language (lang) vs. 1.1.0 Full+Lite
Sets the plugin language and reset the HTML Element direction based on the language.
Function ng.PlugIn.get_language () vs. 1.1.0 Full+Lite
Gets the plugin language.
Function ng.PlugIn.remove () vs. 1.1.0 Full+Lite
Removes the plugin and all it's properties. This method will also remove any HTML Elements that are associated with the plugin.
Function ng.PlugIn.create_options (options, default) vs. 1.1.2 Full+Lite
Create the initial options for the plugin. This method doesn not alter the plugin variables, but return an object that can be assigned to a variable in the plugin.
Function ng.PlugIn.create_events () vs. 1.1.2 Full+Lite
Create the plugin events from the customized option. This method should be called after ng.PlugIn.create_options.
Function ng.PlugIn.get (prop) vs. 1.2.2 Full+Lite
Gets the plugin property. This method will check if there is a getter function for the plugin and return it's value, otherwise it'll return the raw property. This method is useful for getting custom properties.
Function ng.PlugIn.set (prop, value) vs. 1.2.2 Full+Lite
Sets the plugin property. This method will check if there is a setter method for the plugin and call it. Otherwise, it will set the raw property value.This method is useful for setting custom properties.

ng.Component (options) Methods

Some of these methods might be overriden by the inheriting class.
Function ng.Component.set () vs. 1.1.0 Full+Lite
Sets the ng.Component default values and prepare it's HTML structure.
Function ng.Component.set_parent (parent) vs. 1.1.0 Full+Lite
Sets the ng.Component parent object. This allows for nested components.
Function ng.Component.get_parent () vs. 1.1.0 Full+Lite
Gets the parent component.
Function ng.Component.get_parents_components () vs. 1.1.0 Full+Lite
Gets an array of all the component parents.
Function ng.Component.get_children_components () vs. 1.1.0 Full+Lite
Gets an array of all the children components.
Function ng.Component.set_html (html, append, eval_script) vs. 1.1.0 Full+Lite
Sets the component HTML code. Review ng.Element.set_html for more details.
Function ng.Component.get_html () vs. 1.1.0 Full+Lite
Gets the component HTML code.
Function ng.Component.open () vs. 1.1.0 Full+Lite
Opens the component and fires the onOpen event.
Function ng.Component.close () vs. 1.1.0 Full+Lite
Closes the component and fires the onClose event.
Function ng.Component.toggle () vs. 1.1.0 Full+Lite
Opens or closes the component.
Function ng.Component.reposition (obj) vs. 1.1.0 Full+Lite
Reposition the component based on the object position. This method is useful when the placement is the opposite to the language direction and the content changes regularly when the component is open.
Function ng.Component.get_content_div () vs. 1.2.0 Full+Lite
Get the div HTML Element that holds the component content.
Function ng.Component.set_button_ui_class () vs. 1.2.0 Full+Lite
Set the button UI CSS class name option.
Function ng.Component.get_button_ui_class () vs. 1.2.0 Full+Lite
Gets the buttons UI CSS class name.
Function ng.Component.is_open () vs. 1.1.0 Full+Lite
Checks if the component is open.
Function ng.Component.is_close () vs. 1.1.0 Full+Lite
Checks if the component is closed.
Function ng.Component.disable () vs. 1.1.0 Full+Lite
Disables the component and any associated buttons and input field. This method will first the onDisable event.
Function ng.Component.enable () vs. 1.1.0 Full+Lite
Enables the component and any associated buttons and input field. This method will fires the onEnable event.
Function ng.Component.is_enabled () vs. 1.1.0 Full+Lite
Checks if the component is enabled.
Function ng.Component.is_disabled () vs. 1.1.0 Full+Lite
Checks if the component is disabled.
Function ng.Component.set_input (object) vs. 1.1.0 Full+Lite
Sets the component input field. If the component already has an input set, it will remove the events from the original input field.
Function ng.Component.get_input () vs. 1.1.0 Full+Lite
Gets the input field for the component.
Function ng.Component.set_button (btn) vs. 1.1.0 Full+Lite
Sets the component button. When the ng.[NG[Link=Button]Button is clicked, it will toggle the component.
Function ng.Component.get_button () vs. 1.1.0 Full+Lite
Gets the components button.
Function ng.Component.set_placement (placement) vs. 1.1.0 Full+Lite
Sets the component placement.
Function ng.Component.get_placement () vs. 1.1.0 Full+Lite
Gets the component's placement.
Function ng.Component.set_offset (offset) vs. 1.1.0 Full+Lite
Sets the component's offset.
Function ng.Component.get_offset () vs. 1.1.0 Full+Lite
Gets the component's offset.
Function ng.Component.set_visible (visible) vs. 1.1.0 Full+Lite
Sets the component's visibility.
Function ng.Component.get_visible () vs. 1.1.0 Full+Lite
Gets the component visibility.
Function ng.Component.set_open_onfocus (open_focus) vs. 1.1.0 Full+Lite
Sets the component open_onfocus property.
Function ng.Component.get_open_onfocus () vs. 1.1.0 Full+Lite
Gets the component open_onfocus property.
Function ng.Component.set_open_onclick (open_click) vs. 1.1.0 Full+Lite
Sets the component open_onclick property.
Function ng.Component.get_open_onclick () vs. 1.1.0 Full+Lite
Gets the component open_onclick property.
Function ng.Component.get_input_html () vs. 1.1.4 Full+Lite
Get the HTML table code for an input field and button holder. The code will not contain the input or the button.

ng.PlugIn (options) Custom Events

In the events' functions, the this will refer to the class object.
Event onBeforeRemove vs. 1.2.2 Full+Lite
This event will fire right before the plugin (or any object that inherit it, e.g. components) is removed.

ng.Component (options) Custom Events

In the events' functions, the this will refer to the class object.
Event onOpen vs. 1.1.0 Full+Lite
Fires when the component is opened.
Event onClose vs. 1.1.0 Full+Lite
Fires when the component is closed.
Event onEnable vs. 1.1.0 Full+Lite
Fires when the component is enabled.
Event onDisable vs. 1.1.0 Full+Lite
Fires when the component is disabled.