<!DOCTYPE html>
<html>
<head>
<title>双击滚动代码</title>
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script> </head>
<body> <button id="a1">-</button>
<input type="number" id="t1" disabled="disabled" value="" style="text-align:center;">
<button id="j1">+</button>
<hr/>
<hr/>
<button id="a2">-</button>
<input type="number" id="t2" disabled="disabled" value="" style="text-align:center;">
<button id="j2">+</button> <div style="height:1500px;">
</div> <script> var currentpos,timer;
function initialize()
{
timer=setInterval("scrollwindow()",);
}
function sc(){
clearInterval(timer);
}
function scrollwindow(){
if(document.body.scrollTop){//加了DTD头时,document.body.scrollTop值始终为0,在此判断一下
currentpos=document.body.scrollTop;
window.scroll(,++currentpos);
if (currentpos != document.body.scrollTop){
sc();
}
}
else{
currentpos=document.documentElement.scrollTop;
window.scroll(,++currentpos);
if (currentpos != document.documentElement.scrollTop){
sc();
}
}
} document.onmousedown=sc
document.ondblclick=initialize </script>
</body>
</html>

js 鼠标双击滚动单击停止的更多相关文章

  1. js鼠标滚轮滚动图片切换效果

    效果体验网址:http://keleyi.com/keleyi/phtml/image/12.htm HTML文件代码: <!DOCTYPE html PUBLIC "-//W3C// ...

  2. JS中双击和单击事件冲突解决

    在JS中代码中同一功能块中通常同时会用到单击.双击事件,但通常会遇到一个问题,就是在双击的时候即执行了一次双击事件,而且还执行了两次单击事件.此类冲突在ZTree.DHTMLX中经常遇到. 想要解决两 ...

  3. html的鼠标双击,单击,移上,离开,事件捕捉,JavaScript

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  4. js鼠标滑轮滚动事件绑定(兼容主流浏览器)

    /** Event handler for mouse wheel event. *鼠标滚动事件 */ var wheel = function(event) { var delta = 0; if ...

  5. IE和Chrome执行javascript对鼠标双击事件的不同响应

    最近在用天地图API帮同学做点开发的工作,主要是基于天地图的API实现违法用地举报的在线地图标绘,要实现的效果如下: 由于是基于天地图API的TPolygonTool工具实现面积量测和多边形绘制功能, ...

  6. 用VBS控制鼠标的实现代码(获取鼠标坐标、鼠标移动、鼠标单击、鼠标双击)

    网上搜到的答案普遍是VBS无法实现,或者是要用第三方COM(ActiveX?)组件.我对第三方组件是很反感的,使用第三方组件毫无可移植性可言,因为别人的系统中不一定注册了这个组件.我的建议是,尽量不要 ...

  7. MFC鼠标单击截获鼠标双击事件,且无法记录单击的数据的解决方案

    遇到的问题: 鼠标点击会截断鼠标双击的事件,无法保存椭圆的数据.也就是说双击执行的过程是OnLButtonDown,OnLButtonUp,OnLButtonDblClk,OnLButtonUp.并不 ...

  8. JS鼠标滚动插件scrollpath使用介绍

    JS鼠标滚动插件scrollpath:在这个插件中首先要引人的JS是jQuery,因为后面的JS都是基于它的.再者需要引入的是jquery.scrollpath.js.scrollpath.css还有 ...

  9. 用VBS控制鼠标(获取鼠标坐标、鼠标移动、鼠标单击、鼠标双击、鼠标右击)

    Demon's Blog 忘记了,喜欢一个人的感觉 Demon's Blog  »  程序设计  »  用VBS控制鼠标(获取鼠标坐标.鼠标移动.鼠标单击.鼠标双击.鼠标右击) « bbPress积分 ...

随机推荐

  1. Combinations ——LeetCode

    Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For exampl ...

  2. Linux Zynq GPIO中断

    注册中断:对每个pin进行循环遍历for (pin_num = 0; pin_num < min_t(int, ZYNQ_GPIO_NR_GPIOS,  (int)chip->ngpio) ...

  3. UVa1658 Admiral(拆点法+最小费用流)

    题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=51253 [思路] 固定流量的最小费用流. 拆点,将u拆分成u1和u ...

  4. selenium grid java 资料

    Grid TestNG: 使用Selenium Grid改进Web应用程序的测试: http://www.ithov.com/server/117464.shtml

  5. Apache XAMPP Fails to start under Windows XP

    Apache XAMPP Fails to start under Windows XP I’ve been installing XAMPP a hundred times before since ...

  6. Structual设计--Flyweight模式

    1.意图 运用共享技术有效地支持大量细粒度的对象. 2.别名 无 3.动机 有些应用程序得意于在其整个设计过程中採用对象技术,但简单化的实现代价极大.如我们在使用word的时候.假设设置正文字体为:t ...

  7. hook研究结果备忘

    hook研究结果: 最近一周时间仔细研究了一下hook,也许不能称之为研究吧.顶多是让别人的思想拿过来抄袭一遍而已,写点结果也算对得起自己的这几天的苦心了. 1,首先从同事旁边听到了hook,然后看的 ...

  8. [转] 学习HTML/JavaScript/PHP 三者的关系以及各自的作用

    1.What is HTML? When you write a normal document using a word processor like Microsoft Word/Office, ...

  9. Eclipse混淆文件导入Android Studio Gradle编译报input jar file is specified twice

    Eclipse项目中的混淆配置文件 复制到AS中 在混淆的过程中提示如下错误     Error:Execution failed for task ':app:proguardDemoRelease ...

  10. Python之路,Day26-----暂无正在更新中

    Python之路,Day26-----暂无正在更新中