sunny
sunny

Reputation: 852

Bootstrap jquery ui slider

Have been trying to adjust the jquery slider width to the right size and limit its drag outside of its area. I have understood that the font-size makes the slider scale correctly ; but setting font-size causes the width to the look wierd. How can i reduce the slider boxes to small squares and not slide out ?

jsfiddle / edit here http://jsfiddle.net/EkkKG/

    <div class="navbar navbar-fixed-top">
     <div class="navbar-inner">
       <div class="container">
        <a data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar">
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </a>
    <a href="#" class="brand">Project name</a>
    <div class="nav-collapse">
      <ul class="nav">
         <li class="dropdown">
          <a data-toggle="dropdown" class="dropdown-toggle" href="#">Dropdown <b class="caret"></b></a>
          <ul class="dropdown-menu">
            <li><a href="#">
                <p>
                                <label for="amount">Price range:</label>
                                <input type="text" id="amount" style="border: 0; color: #f6931f; font-weight: bold;" />
                            </p>

                <!--div style="font-size:10px;"-->
                   <div id="slider-range"></div>
              <!--/div-->
                </a></li>

            <li><a href="#">Another action</a></li>

          </ul>
        </li>
      </ul>
    </div><!-- /.nav-collapse -->
  </div>
</div><!-- /navbar-inner -->
  </div>​

jquery

    $( "#slider-range" ).slider({
            range: true,
            min: 0,
            max: 500,
            values: [ 75, 300 ],
            slide: function( event, ui ) {  $( "#amount" ).val( "$" + ui.values[ 0 ] + " -   $" + ui.values[ 1 ] );
            }
  });
   $( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) + " - $" + $(  "#slider-range" ).slider( "values", 1 ) );

enter image description here

This fiddle in 'incognito' mode in chrome gave me my desired result but on my actual side it still doesnt

Upvotes: 2

Views: 14844

Answers (1)

sunny
sunny

Reputation: 852

Pointed to version 2.2 css of bootstrap

Upvotes: 1

Related Questions