Listbox滚动条上串问题
<html>
<head>
<script>
function restore(){
var s = document.cookie;
var a = s.split("; ");
var b, r="";
for(var i=0;i<a.length;i++){
b = a[i].split("=");
if(b[0]=="s"){r=b[1];break;}
}
if(r != ""){
a = r.split("-");
var sel = document.form1.sel;
sel.scrollTop = a[0]
sel.selectedIndex = a[1];
}
}
function doit(){
var sel = document.form1.sel;
document.cookie = "s=" + sel.scrollTop + "-" + sel.selectedIndex;
}
</script>
</head>
<body onload="restore();">
<form name="form1">
<select name="sel" size="5" multiple="multiple" onchange="doit();">
<option>00000</option>
<option>00001</option>
<option>00002</option>
<option>00003</option>
<option>00004</option>
<option>00005</option>
<option>00006</option>
<option selected="selected">00007</option>
<option>00008</option>
<option>00009</option>
<option>00010</option>
<option>00011</option>
<option>00012</option>
<option>00013</option>
</select>
<form>
</body>
</html>