Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Slider initialize does not style the box with number #7545

Closed
jonas-db opened this issue Jul 5, 2014 · 2 comments
Closed

Slider initialize does not style the box with number #7545

jonas-db opened this issue Jul 5, 2014 · 2 comments
Assignees
Milestone

Comments

@jonas-db
Copy link

jonas-db commented Jul 5, 2014

I talked about it in the irc but didn't get a reply (http://irc.jquery.org/%23jqueryui-dev/default_%23jqueryui-dev_20140703.log.html#t14:37:29)

Anyways if you do .slider() on a number element it doesn't style the box..

picture: http://imgur.com/r5m2LMM

checkout this jsbin:
http://jsbin.com/hiwolepe/3/edit

@gabrielschulhof
Copy link

The correct way to dynamically inject a slider is the following:

    $( "<input type='number' data-type='range' min='0' max='100' step='1' value='23'>" )
        .appendTo( "#myForm" )
        .slider()
        .textinput();

You must use an input of type number and you need to add the attribute data-range="true" to the input.

I'll make a demo.

@jonas-db
Copy link
Author

jonas-db commented Jul 6, 2014

Didn't know that i had to call textinput() also, thanks! :)

gabrielschulhof pushed a commit that referenced this issue Jul 31, 2014
(cherry picked from commit 9a060c1)

Closes gh-7549
Fixes gh-7545
agcolom pushed a commit to agcolom/jquery-mobile that referenced this issue Nov 26, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants