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

  • 相关阅读:
    100-days: twenty-four
    100-days: twenty-three
    100-days: twenty-two
    100-days: twenty-one
    100-days: twenty
    [NOI 2016]循环之美
    [NOI 2015]寿司晚宴
    [BZOJ 2655]calc
    [Codeforces 888G]Xor-MST
    [BZOJ 2839]集合计数
  • 原文地址:https://www.cnblogs.com/fengju/p/6173811.html
Copyright © 2011-2022 走看看