I am attempting to demonstrate the effects of a delivery based on the dates sub parts arrive. Input fields (individual parts) accept days +/- expected arrival dates and move the image at the top along a timeline. The input field slider is moves the image but text input does not. I’m also planning to use multiple fields/sliders to add/subtract days per part. This functionality has so far eluded me.
Any help would be appreciated.
“`
<html>
<head>
<script type=”text/javascript”>
function movex1(){
var x = document.getElementById(“spinx”).value;
var image = document.getElementById(“test”).style;
image.marginLeft=x+”px”;
}
function showValue(newValue) {
document.getElementById(“spinx”).innerHTML= newValue;
}
function changeRangeValue(val){
document.getElementById(“range”).value = isNaN(parseInt(val, 10)) ? 0 : parseInt(val, 10);
showValue(val);
}
function changeInputValue(val){
document.getElementById(“number”).value = isNaN(parseInt(val, 10)) ? 0 : parseInt(val, 10);
showValue(val);
}
</script>
<style>
#test h3{
margin-left:0px;
overflow: hidden;
color:red;
}
#test2 h3{
margin-left:0px;
overflow: hidden;
color:red;
}
#test3 h3{
margin-left:0px;
overflow: hidden;
color:red;
}
</style>
</head>
<body><b>Parts Slip Demo</B><br> <div id=”test”><h3><img src=”s-l640.jpg” width=”64″ height=”22″></h3></div>
<table border=”0″ width=”1550″>
<tr>
<td colspan=24><hr></td>
</tr>
<tr>
<td>1.1.20</td>
<td>1.15.20</td>
<td>2.1.20</td>
<td>2.15.20</td>
<td>3.1.20</td>
<td>3.15.20</td>
<td>4.1.20</td>
<td>4.15.20</td>
<td>5.1.20</td>
<td>5.15.20</td>
<td>6.1.20</td>
<td>6.15.20</td>
<td>7.1.20</td>
<td>7.15.20</td>
<td>8.1.20</td>
<td>8.15.20</td>
<td>9.1.20</td>
<td>9.15.20</td>
<td>10.1.20</td>
<td>10.15.20</td>
<td>11.1.20</td>
<td>11.15.20</td>
<td>12.1.20</td>
<td>12.15.20</td>
</tr>
</table><br>
Part1<br>
Days Δ EDD: <input type=”number” id=”number” min=”0″ max=”1200″ onkeyup=”changeRangeValue(this.value)”/>
<br />
<input type=”range” min=”0″ max=”1200″ id=”spinx” name=”spinx” style=”width:500″ value=”number.RangeValue(this.value)” step=”1″ oninput=”changeInputValue(this.value, movex1())”/>
</body>
</html>