复制代码 代码如下:
<html>
<head>
<title></title>
<script type="text/javascript" language="javascript">
/*根据获得焦点的时候给setVal给值*/
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">
/*根据获得焦点的时候给setVal给值*/
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>
JS,鼠标滚轴,文本框值
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
更新日志
- ABC唱片-鲍比达·新民乐《满江红》[APE+CUE]
- 许嵩.2014-不如吃茶去【海蝶】【WAV+CUE】
- 周笔畅.2024-HAVE.A.GOOD.NIGHT【SN.Music】【FLAC分轨】
- 周笔畅.2024-HAVE.A.NICE.DAY【SN.Music】【FLAC分轨】
- 证声音乐图书馆《真夏派对 x 迪斯可》[FLAC/分轨][380.78MB]
- 证声音乐图书馆《星空下 爵士钢琴》[320K/MP3][65.88MB]
- 证声音乐图书馆《星空下 爵士钢琴》[FLAC/分轨][283.95MB]
- 沙门怀一《竹山听雨HQ》头版限量[低速原抓WAV+CUE]
- 沙门怀一《于喁·壹HQ》头版限量编号[低速原抓WAV+CUE]
- 群星《魅音绝唱》黑胶CD【WAV】
- 腾格尔.2002-四十独白【风潮】【WAV+CUE】
- 陈明真.1992-到哪里找那么好的人【华星】【WAV+CUE】
- 黄凯芹.2012-廿五年3CD【环球】【WAV+CUE】
- 证声音乐图书馆《七夕 爵士情缘》[320K/MP3][64.8MB]
- 证声音乐图书馆《七夕 爵士情缘》[FLAC/分轨][327.79MB]