Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can fiddle with the CSS to make it look like you want. The inner portion of the slider:</p> <pre><code>&lt;----[]==========[]----&gt; ^^^^^^^^^^ </code></pre> <p>gets its background from <code>.ui-widget-header</code>, the outer portion of the slider:</p> <pre><code>&lt;----[]==========[]----&gt; ^^^^ ^^^^ </code></pre> <p>gets its background from <code>.ui-widget-content</code>. So to reverse them, you just need a <a href="http://api.jquery.com/toggleClass/" rel="nofollow"><code>toggleClass</code></a> to toggle those classes on the the widget as a whole (for the outer background) and the thumb (for the inner area). The outer area is just the slider itself, the inner area is the <code>.ui-slider-range</code> inside the slider.</p> <p>For example, if you have a slider like this:</p> <pre><code>&lt;div id="slider-range"&gt;&lt;/div&gt; </code></pre> <p>Then you can reverse the backgrounds with this:</p> <pre><code>$('#slider-range, #slider-range .ui-slider-range').toggleClass('ui-widget-header ui-widget-content'); </code></pre> <p>You might want to keep track of which mode the slider is in somewhere or you could just check the classes on <code>#slider-range .ui-slider-range</code> instead.</p> <p>Demo: <a href="http://jsfiddle.net/ambiguous/Mu8XS/" rel="nofollow">http://jsfiddle.net/ambiguous/Mu8XS/</a></p> <p>If you're not comfortable toggling the jQuery-UI classes then you could wrap the slider in a <code>&lt;div&gt;</code>, toggle a class on that <code>&lt;div&gt;</code>, and override the jQuery-UI CSS:</p> <pre><code>.inverted .ui-widget-content { /* The usual background properties for .ui-widget-header */ } .inverted .ui-widget-header { /* The usual background properties for .ui-widget-content */ } </code></pre> <p>Then you could toggle <code>.inverted</code> on the wrapper <code>&lt;div&gt;</code> to swap the backgrounds around.</p>
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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