[Javascript]
<Html>
<Head>
<Title> </title>
<Script type = "text/javascript" language = "javascript">
/* Set setVal to the value when the focus is obtained */
Var setVal;
Var bool = false;
Var scrollFunc = function (e ){
Var direct = 0;
E = e | window. event;
Var ew = e. wheelDelta
If (ew & bool ){
If (ew> 0 ){
Var num1 = setVal. value;
If (num1> 0 ){
Num1 = eval (1 + parseInt (num1 ));
} Else {
Num1 = 1;
}
} Else {
Var num1 = setVal. value;
If (num1> 0 ){
Num1 = eval (parseInt (num1)-1 );
} Else if (num1 = 0 ){
Num1 = 0;
} Else {
Num1 = 1;
}
}
SetVal. value = num1;
}
}
Window. onmousewheel = document. onmousewheel = scrollFunc;
Function ufocus (eve ){
Bool = true;
SetVal = eve;
}
Function ublur (){
Bool = false;
SetVal = null;
}
</Script>
</Head>
<Body>
<Input type = "text" onfocus = "ufocus (this)" onblur = "ublur (this)"/>
</Body>
</Html>
<Html>
<Head>
<Title> </title>
<Script type = "text/javascript" language = "javascript">
/* Set setVal to the value when the focus is obtained */
Var setVal;
Var bool = false;
Var scrollFunc = function (e ){
Var direct = 0;
E = e | window. event;
Var ew = e. wheelDelta
If (ew & bool ){
If (ew> 0 ){
Var num1 = setVal. value;
If (num1> 0 ){
Num1 = eval (1 + parseInt (num1 ));
} Else {
Num1 = 1;
}
} Else {
Var num1 = setVal. value;
If (num1> 0 ){
Num1 = eval (parseInt (num1)-1 );
} Else if (num1 = 0 ){
Num1 = 0;
} Else {
Num1 = 1;
}
}
SetVal. value = num1;
}
}
Window. onmousewheel = document. onmousewheel = scrollFunc;
Function ufocus (eve ){
Bool = true;
SetVal = eve;
}
Function ublur (){
Bool = false;
SetVal = null;
}
</Script>
</Head>
<Body>
<Input type = "text" onfocus = "ufocus (this)" onblur = "ublur (this)"/>
</Body>
</Html>