zoukankan      html  css  js  c++  java
  • onmousewheel跟onscroll的区别

    研习DOM中的事件方法,发现一些细微差别,百度一下没有类似的解答,随手记下来。

    onmousewheel事件 

    以下摘自http://help.dottoro.com/ljmracjb.php

    Browser support:

    IE,火狐,opera,sarafi,chrome

    Occurs when the mouse wheel rolls.
    In Firefox, use the DOMMouseScroll event and the detail event property instead.
    Note: the onmousewheel and DOMMouseScroll events are also fired on elements that have no scrollbar or when the contents are not scrolled. If you would like to receive a notification when the contents of an element are scrolled, use the onscroll event.
     
    翻译:该事件发生在鼠标滚轮滚动时,火狐中,使用DOMMouseScroll跟其细节事件(参看http://help.dottoro.com/ljrxdxdw.php及http://www.feiesoft.com/html/events/onmousewheel.html)代替。注意:onmousewheel和DOMMouseScroll事件,在没有滚动条或者内容没有被滚动的时候也会发生,意思是只要鼠标动不管页面动不动。如果你是想一个元素内容滚动后接受一个通知的话,使用onscroll事件。
     
    onscroll事件
     
    Browser support:
    IE,火狐,opera,sarafi,chrome
    Occurs when the contents of an element have been scrolled.
    This event is only fired on elements that have a scrollbar. Use the overflow style property to create scrollbars for an element.
     
    翻译:事件发生在元素内容滚动的时候,也包括键盘上下键,载入也可触发。事件仅仅在有滚动条时发生,使用overflow属性为元素创建一个滚动条。
     
    ok,就这样。
     
  • 相关阅读:
    ios 常见性能优化
    ios Standard Framework和Umbrella Framework
    lua 中容易忘记的细节
    python md5
    lua table 排序
    centos 图形模式与命令行模式设置
    python 中关于 json 的一些相关操作
    python3 入门基础
    lua 函数
    sublime 自定义配置python开发环境
  • 原文地址:https://www.cnblogs.com/jiangtian/p/onmousewheel-onscroll.html
Copyright © 2011-2022 走看看