slider events
slider events
Hi,
I am using jqm 1.4.4 in a multi-page website and I would like to catch the state of a slider when a user swiped or taped the slider.
I'm trying to do it like this :
- <div class="ui-field-contain">
- <label for="slider-'+key+'">flip-'+key+'</label>
- <select name="flip-'+key+'" id="flip-'+key+'" data-identity="'+key+'" data-role="slider">
- <option value="off">Off</option>
- <option value="on" selected>On</option>
- </select>
- </div>'
-
- $("#flip-"+key).bind('change', function(e) {
- //$(« #flip-"+key).change(function() {
- e.preventDefault();
- e.stopImmediatePropagation();
- console.log('fired ! ='+$(this).val() + ' or '+$("#flip-"+key).val());
- });
Of course it doesn't work.
BTW, the slider code is not present onload. I create it on the fly. This is a problem in my implementation because everytime you go back to the same page, the same piece of code (line9 - line14) will be created again...
Anyway, it doesn't work.
Can anyone tell me what's wrong and how to do this ?
I really like the online demo. But only one thing is missing : the javascript code for those kind of elements...
Where can I find the online manual with this part of the code ?
Cheers