1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Input Range</title>
</head>
<body>
<input type = "range" id="InputRange" min="0" max="255" step="1" onchange="showValue(this.value)" onmouseup="Threshold(this.value);showValue(this.value)"/>
<span id="InputRange-Value">0</span>
<script type = "text/javascript">
function showValue(newValue)
{
document.getElementById("InputRange-Value").innerHTML=newValue;
}
function GetTagInfo(TagName)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","Factory.xml",false);
var xmlDoc=xmlhttp.responseXML;
alert(xmlDoc);
xmlhttp.send();
var LocValue = xmlDoc.getElementsByTagName(TagName);
return LocValue[0].childNodes[0].nodeValue;
}
function Threshold(_value)
{
var MinThreshold = GetTagInfo("WakeUpMinVolume");
var InputRangeValue = _value;
if(InputRangeValue <= MinThreshold)
{
document.getElementById("InputRange").value = MinThreshold;
}
else
{
document.getElementById("InputRange").value = InputRangeValue;
}
}
</script>
</body>
</html> |