zoukankan      html  css  js  c++  java
  • jquery 不同浏览器判断颜色值的方法

    jquery 不同浏览器判断颜色值的方法

    //CSS处理函数
    function mycss(){
       
    if($.browser.msie){    //IE浏览器
    //HOVER事件
    $('#table1 > tbody > tr').hover(function(evt){
     if ($(this).find('td').css("background-color")!='#009fcc'){   
      $(this).find('td').css("background-color","#CCDDFF");
     }
    }, function(evt){
     if ($(this).find('td').css("background-color")!='#009fcc'){   
     $(this).find('td').css("background-color","");
     }
    } );
    }

    if($.browser.mozilla) {    //FF浏览器
    //HOVER事件
    $('#table1 > tbody > tr').hover(function(evt){
     if ($(this).find('td').css("background-color")!='rgb(0, 159, 204)'){   
      $(this).find('td').css("background-color","#CCDDFF");
     }
    }, function(evt){
     if ($(this).find('td').css("background-color")!='rgb(0, 159, 204)'){   
     $(this).find('td').css("background-color","");
     }
    } );
    }

    }

    $(this).find('td').css("background-color") 在不同浏览器下返回的值是不一样的。

    当页面载入式判断浏览器类型,可判断的类型有msie、mozilla、opera、safa

  • 相关阅读:
    Mac配置docker阿里云加速器
    Docker初学笔记
    Mac下载安装Tomcat
    MySQL
    monkey
    Git基本使用
    yaml语法
    PAT_B数素数 (20)
    PAT_B1002数字分类
    PAT基础编程练习
  • 原文地址:https://www.cnblogs.com/fengju/p/6173811.html
Copyright © 2011-2022 走看看