<script><br>
var $dom = $(document);<br>
$dom.on('mousedown','#d',function (argument) {<br>
$(this).data('mouse','down');<br>
console.log('down');<br>
})<br>
$dom.on('mouseup',function(){<br>
$('#d').data('mouse','up');<br>
console.log('up');<br>
});<br>
$dom.on('mousemove','#d',function(event){<br>
if($(this).data('mouse') == 'down'){<br>
var m_x = event.clientX;<br>
var d_b = $(this).find('.d_b');<br>
m_x = m_x < 8 ? 8 : m_x;<br />
m_x = m_x > 208 ? 208: m_x;<br>
d_b.css('left',m_x-13);<br>
var max = $(this).attr('max');<br>
$(this).attr('value', Math.floor((m_x-8)/200 * max))<br>
console.log($(this).attr('value'));<br>
$('#text').text($(this).attr('value'))<br>
}<br>
});<br>
</script>