zoukankan      html  css  js  c++  java
  • style.top style.left js

    ie6-ie8可使用可以直接用obj.style.top=100; 但在FireFox和ie9中必须加上单位,变成obj.style.top=100+'px'; style.left同理。

           浏览器的判断:window.navigator.userAgent.indexOf("IE") == -1 // 非IE浏览器  FireFox,Chrome

           FireFox 没有onmouseover和onmouseout,onclick事件,他们的写法为:

           if (window.navigator.userAgent.indexOf("IE") == -1)  {       // FireFox
                  link.addEventListener('mouseover', function(){a = false}, true);
                  link.addEventListener("mouseout",function(){a = true},true)
           } else {       // IE
                  link.attachEvent("onmouseover",function(){a = false});
                  link.attachEvent("onmouseout",function(){a = true});
           }

  • 相关阅读:
    实习笔记day03
    实习笔记day02
    实习笔记day01
    第4章:数组与方法
    栈内存与堆内存的区别
    java数据类型
    保护模式指令
    空描述符
    段描述符
    全局描述符表
  • 原文地址:https://www.cnblogs.com/zifeiyu/p/3198356.html
Copyright © 2011-2022 走看看