Home arrow News - Articles arrow Tips & Tricks arrow Range Slider
 
  XnRnXZvLpO www.danielhp.com
Range Slider PDF Print E-mail
Written by Administrator   
Friday, 05 June 2009
This is about how to build range slider, a slider with two handled value.

While browsing some ecommerce website for looking any inspiration for ecommerce projects, I found shopwiki.com website. This an ecommerce directory. You can buy almost everything sold by the traditional store  here. The website navigator is easy to understand by user. It clear and simple, but effective.

My next Project in the internet application class is to build list or table from SQL Server database with ADO.NET in ASP.NET.  I have look the list in this website shown with this table style and listing style. And I think my student can do both of that style in their projects.

Anyway, actually in this article I want to share about one interesting tool in this page . As you can see in the top right corner there are Filter panel like this :
as

These 2 sliding bar is for filtering the list in more specific price range and color. Than I want to discover how to include these slider in our website. I have not yet found the code for the color slider, but I have found it for the price range slider.

The price range slider called ‘two handled slider’ or ‘range slider’. While googling it I have found the first choice is with JQUERY UI. Yes it a very great range slider from provider with great collection of tools. But before using this collection I prefer to search the ‘lite’ one. And I found this script.

This script use this javascript : yui-range-slide.js
and this style sheet file : yui-range-slide.css

after download those 2 file, you can try this code:

<html>
<head>
<meta http-equiv=content-type content="text/html; charset=utf-8">
<title>DHTML Widget : Inline Range Slider</title>
<script src = "http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/2/yahoo_2.0.0-b3.js" ></script>
<script src="http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/2/event_2.0.0-b3.js" ></script>
<script src="http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/2/dom_2.0.2-b3.js" ></script>
<script src = "yui-range-slide.js" ></script>
<link rel="stylesheet" type="text/css" href="yui-range-slide.css" />
</head>
<body>

<div id="mydiv">Price $1 to $100</div>
<span id="myslider" ></span>
<script type="text/javascript">
      var oMS1 = new YAHOO.widget.RangeSlider(  'myslider' , {width:140,height:20,from:1,to:100});
      oMS1.setValue(0,100);
      var onMS1Slide = function(sType)
      {          
            var aData =  this.getValue();
            document.getElementById('mydiv').innerHTML = 'Price $'+ aData[0] + ' to $'+ aData[1];        
      };
      oMS1.onSlide.subscribe(onMS1Slide, oMS1 , true);
</script>
</body>
</html>

 

this is the display when you run the script.

sas

 

The script show that we build slider with width 140 and height=20. With min value=0, and max value=100. First we set with setValue method for range 0 and 100 respectively.
And than, in  this example, we take the Value1 and Value2 after any slide motion for updating the price text in the top of the slider. Of course for the system information like in above website, we need to passing those 2 value in another function, like AJAX function that doing query .

Comments
Search
jmfgnh (222.79.27.xxx) 2009-07-20 14:55:27

All WOW accounts were purchased from gamers who give up the wow gold kaufen. Internet WOW account resellers check every within 10 minuteswow gold kaufen . WOW wow gold account for safety and then put the WOW account on their websites. At the
same time, every WOW account is checked every day. Internet WOW
account resellers strive to be the best online shopping service by the
online help operator’s team wow gold . Their online support is available 24 hours. It is for global customers
to buy WOW accounts any time. WOW account is a shiny yellow metal,
that for some reason everyone seems to want WORLD OF WARCRAFT gold.
This is just as true in the real world, as it is in the virtual WOW account
of online games. Internet WOW account resellers guaranteed all WOW
accounts on the lowest prices every day. You will never feel that any
WOW account is so expensive. Compare wi...
hi
speedy18us (62.231.93.xxx) 2009-07-22 09:04:01

can you tell where did you get this thing? because at that adress which you
specified is not like this (as presented here). i like it more than jquery or
prototype slider plugins.
dfdf (62.231.93.xxx) 2009-08-14 11:15:33

google
jmfgnh (62.231.93.xxx) 2009-08-14 11:16:52

Free Online Directory with pagerank transfer
Anonymous (125.113.172.xxx) 2009-08-17 03:25:02

AmandaDollar is an award-winning dollar items website. Find everything to stock your store shelves with. Wholesale merchandise: low cost shipping, over 10,000 items, buy wholesale now and save money! Whoever you are, and wherever you are, AmandaDollar
offers blue-ribbon dollar store items with the same price to all: the lowest possible. Whether you're a one dollar shop or 99 cent store owner, or a global wholesaler sell cheap wholesale products, AmandaDollar provides top notch service and discount wholesale prices. Meanwhile, our partner can offer you high quality shoes wholesale and promotional gifts with custom logo imprinted. China wholesale, wholesale from China direct from Chinese wholesaler.
Only registered users can write comments!

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

Last Updated ( Friday, 05 June 2009 )
 
Next >
 
 
(C) 2010 daniel hary prasetyo
Free Joomla Template designed by funky-visions.de
 

articles (a-z order)