JQuery Mobile Slider Widget uses JS control

Source: Internet
Author: User
JQuery Mobile Slider bar control

Basic usage don't say more, look here:

Http://www.runoob.com/jquerymobile/jquerymobile-form-sliders.html

The creation method is still very simple, the Runnoob also specially gave four kinds of different sliding bar style.

However, one less effect is to remove the input box next to (input type number).

The first method I used was the CSS modification method:

#slider {Display:none;float:left}

The #slider here is the ID of the slider Widget you created.

After hiding, set the slider bar. Ui-slider-track CSS.

(mainly to modify the margin, pading and the like, this open chrome, press F12 to change the good).

Later found not so troublesome, add to it a class= "ui-hidden-accessible" can be perfectly hidden.

There is also the use of JS code control it:

Set the value of
$ ("#slider"). Val (+) slider ("Refresh");

Set the value of Min, max
$ ("#slider"). Prop ("Min", 1). Slider ("Refresh");
$ ("#slider"). Prop ("Max"). Slider ("Refresh");

Monitoring changes:
$ (document). Ready (function () {
$ ("#slider"). On (' Slidestop ', function (event) {
var Slider_value = $ ("#slider"). Val ();
alert (Slider_value);
});
});

JQuery Mobile Slider Widget uses JS control

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.