Jquery UI application-Slider

Source: Internet
Author: User

1,Animate:Type boolean Default ValueFalse

A)Usage:When you click the sliding area, whether the slider uses the animation effect to smoothly move to the clicked position.

B)CodeExample:

Set attribute values when creating an instance

$ (". Class"). Slider ({Animate: true });

Get attribute values after instantiation

VaR animate = $ ("# ID"). Slider ("option", "animate ");

Set attribute values after instantiation

$ ("# ID"). Slider ("option", "animate", true );

 

2,Max: Default Value of type number100

A) usage: Maximum sliding range.

B) sample code:

Set attribute values when creating an instance

$ (". Class"). Slider ({max: false });

Get attribute values after instantiation

VaR max = $ ("# ID"). Slider ("option", "Max ");

Set attribute values after instantiation

$ ("# ID"). Slider ("option", "Max", false );

 

3,Min: Default Value of type number
0

A) usage: The minimum sliding range.

B) Sample Code

Set attribute values when creating an instance

$ (". Class"). Slider ({min: false });

Get attribute values after instantiation

VaR min = $ ("# ID"). Slider ("option", "min ");

Set attribute values after instantiation

$ ("# ID"). Slider ("option", "min", false );

 

4,Orientation: TypeString Default Value
"Auto"

A) usage: sliding direction. Generally, you do not need to set this parameter. The control automatically detects the correct direction.

B) Sample Code

Set attribute values when creating an instance

$ (". Class"). Slider ({orientation: "vertical "});

Get attribute values after instantiation

VaR orientation = $ ("# ID"). Slider ("option", "orientation ");

Set attribute values after instantiation

$ ("# ID"). Slider ("option", "orientation", "vertical ");

 

5,Range: TypeBoolean/string Default ValueFalse

A) usage: when it is set to true, it automatically detects whether there are two slide and highlights the range between the two. When set to "min", the minimum value is highlighted to the slider range. When set to "Max", the slider is highlighted to the maximum value range.

B) Sample Code

Set attribute values when creating an instance

$ (". Class"). Slider ({range: "min "});

Get attribute values after instantiation

VaR range = $ ("# ID"). Slider ("option", "range ");

Set attribute values after instantiation

$ ("# ID"). Slider ("option", "range", "min ");

 

6,Step: Default Value of type number1

A) Purpose: Set the smallest travel value of the slider. The value must be divisible by the maximum range value minus the minimum range value.

B) Sample Code

Set attribute values when creating an instance

$ (". Class"). Slider ({step: 10 });

Get attribute values after instantiation

VaR step = $ ("# ID"). Slider ("option", "Step ");

Set attribute values after instantiation

$ ("# ID"). Slider ("option", "Step", 10 );

 

7,Value: Default Value of type number0

A) usage: Set the default value of the first slider.

B) Sample Code

Set attribute values when creating an instance

$ (". Class"). Slider ({value: 26 });

Get attribute values after instantiation

VaR value = $ ("# ID"). Slider ("option", "value ");

Set attribute values after instantiation

$ ("# ID"). Slider ("option", "value", 26 );

 

8,Values: TypeArray Default ValueNull

A) set multiple slider default values. When the range attribute is true, the number of elements in this value should be 2.

B) Sample Code

Set attribute values when creating an instance

$ (". Class"). Slider ({values: [10, 20, 50]});

Get attribute values after instantiation

VaR values = $ ("# ID"). Slider ("option", "values ");

Set attribute values after instantiation

$ ("# ID"). Slider ("option", "values", [10, 20, 50]);

 

9,Disabled: boolean type; default value: false

A) usage: determines whether the slider can be slide.

B) Code instance

1. $ ("# Slider"). Slider ({disabled: false });

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.