Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery convert multiple dropdowns to slider
    primarykey
    data
    text
    <p>I am trying to replace a series of dropdowns with sliders. Everything seems to be working fine, however the sliders are acting very bizarre, not sure if it is because I have used a generic class rather than giving them all <code>ID</code>s?</p> <p>Basically when I scroll a slider rather than the expected: 0,1,2,3 it is more along the lines of 1 first then 0 then 3 then 2... </p> <p>Is this a simple case of incorrect setup or is it just not possible to use them in this way?</p> <p>Thanks a lot, Anthony.</p> <p><a href="http://jsfiddle.net/Anth12/BnL93/1/" rel="nofollow">http://jsfiddle.net/Anth12/BnL93/1/</a></p> <pre><code>$(document).ready(function () { $('.DropDownToSlider').each(function () { var NewSlider = $(this).next(".DropDownSlider"); var value = parseInt(NewSlider.text()); $(this).val(value); NewSlider.text(""); NewSlider.slider({ value: value, min: 0, max: 3, slide: function (event, ui) { $(this).prev(".DropDownToSlider").val($(this).slider("value")); $(".SliderVal").text($(this).slider("value")); } }); }); }); </code></pre> <pre><code>&lt;select id="dd1" class="DropDownToSlider" style=""&gt; &lt;option value="3"&gt;Admin&lt;/option&gt; &lt;option value="2"&gt;Basic&lt;/option&gt; &lt;option value="1"&gt;NoAuth&lt;/option&gt; &lt;option value="0"&gt;Delete&lt;/option&gt; &lt;/select&gt; &lt;div id="ddslider1" class="DropDownSlider"&gt;1&lt;/div&gt; &lt;select id="dd2" class="DropDownToSlider" style=""&gt; &lt;option value="3"&gt;Admin&lt;/option&gt; &lt;option value="2"&gt;Basic&lt;/option&gt; &lt;option value="1"&gt;NoAuth&lt;/option&gt; &lt;option value="0"&gt;Delete&lt;/option&gt; &lt;/select&gt; &lt;div id="ddslider2" class="DropDownSlider"&gt;2&lt;/div&gt; </code></pre>
    singulars
    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.
    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