Drag Slide Range

Using JavaScript

HTML

<script src="http://dna-design.dk/temp/dragdealer.js"></script>
        <div class="indkobWrapper">
            <div class="indkobText">
                Value per month:
            </div>
            <div class="indkobPris">
                $ <span id="dragValue"></span>
            </div>
        </div>
    
        <div id="just-a-slider" class="dragdealer">
            <div class="handle red-bar">
            </div>
        </div>

CSS

* {
	font-family:Arial, Helvetica, sans-serif;
	}

.dragdealer {
	position: relative;
	height: 5px;
	background: #999;
	cursor: pointer;
	}

.dragdealer .handle {
	position: absolute;
	top: -12px;
	left: 0;
	}
	
.dragdealer .red-bar {
	width: 20px;
	height: 30px;
	background: #CC0000;
	cursor:e-resize;
	}

.dragdealer .disabled {
	background: #898989;
	}
	
/********************************/
	
#just-a-slider .handle {
	height: 30px;
	line-height: 20px;
	}
	
#dragValue {
	font-size:16px;
	line-height:30px;
	font-weight: bold;
	}
	
.indkobWrapper{
	position:relative;
	background-color:#eaeaea;
	width:320px;
	margin:20px auto;
	padding:0 20px;
	clear:both;
	text-align:center;
	}

.indkobText{
	position:relative;
	font-size:16px;
	line-height:30px;
	width:130px;
	display:inline-block;
	}

.indkobPris{
	position:relative;
	font-size:16px;
	line-height:30px;
	width:100px;
	display:inline-block;
	}

JavaScript

$(function() {

  new Dragdealer('just-a-slider', {
    animationCallback: function(x, y) {
      $('#dragValue').text(Math.round(x * 150));
      var dvText = $('#dragValue').text();
      if(dvText != 0){ dvText += '00'; }
      $('#dragValue').text( dvText.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") );
    }
  });

  var availHeight = $('.content-body').outerHeight() -
                    $('.content-mask').outerHeight();
  new Dragdealer('content-scroller', {
    horizontal: false,
    vertical: true,
    yPrecision: availHeight,
    animationCallback: function(x, y) {
      $('.content-body').css('margin-top', -y * availHeight);
    }
  });
});