New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slider initialize does not style the box with number #7545

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

Comments

Projects
None yet
2 participants
@jonas-db

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

This comment has been minimized.

Show comment
Hide comment
@gabrielschulhof

gabrielschulhof Jul 6, 2014

Contributor

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.

Contributor

gabrielschulhof commented Jul 6, 2014

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

This comment has been minimized.

Show comment
Hide comment
@jonas-db

jonas-db Jul 6, 2014

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

jonas-db commented Jul 6, 2014

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

gabrielschulhof added a commit that referenced this issue Jul 31, 2014

Slider: Demo dynamic creation
(cherry picked from commit 9a060c1)

Closes gh-7549
Fixes gh-7545

agcolom added a commit to agcolom/jquery-mobile that referenced this issue Nov 26, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment