Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery mobile sliders reset on button click
    primarykey
    data
    text
    <p>I am trying to have my jQuery mobile sliders reset when a button is pressed.</p> <p>Here is the code for the form:</p> <pre><code>&lt;div class="sliders"&gt; &lt;input class="ui-hidden-accessible" data-track-theme="b" data-theme="a" type="range" name="slider1" id="slider1" value="50" min="0" max="100" animate="true"/&gt;&lt;br/&gt; &lt;input class="ui-hidden-accessible" data-track-theme="b" data-theme="a" type="range" name="slider2" id="slider2" value="50" min="0" max="100" animate="true"/&gt;&lt;br/&gt; &lt;button data-theme="a" id="go-back"&gt;Done Rating&lt;/button&gt; &lt;/div&gt; </code></pre> <p>And here is the JS (it is in the context of a D3 vizualization):</p> <pre><code>$('#go-back').click(function () { //$('#slider1').val(50).slider("refresh"); $('.rate').slideUp(); $('.frame').hide(); _this.transition() .attr('r', _this.attr('data-r')) .duration(1000); }); </code></pre> <p>As above, it works fine and the transitions execute when the button is pressed. If I uncomment the line to reset the slider, the button does nothing when I press on it.</p> <p>I am getting <code>Uncaught TypeError: Object [object Object] has no method 'slider</code>.</p> <p>I know this is the correct command to reset the slider, because I asked <a href="https://stackoverflow.com/questions/17627755/changing-jquery-mobile-slider-value">here</a>.</p> <p>EDIT: here's the list of JS imports:</p> <pre><code> &lt;script type='text/javascript' src='js/csrf-ajax.js'&gt;&lt;/script&gt; &lt;script type='text/javascript' src='bootstrap/js/bootstrap.min.js'&gt;&lt;/script&gt; &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" /&gt; &lt;script src="http://code.jquery.com/jquery-1.8.2.min.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"&gt;&lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload