jquery 不同浏览器判断颜色值的方法
2010-03-09 15:29
288 查看
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
//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
相关文章推荐
- jquery 不同浏览器判断颜色值的方法
- jquery实现不同大小浏览器使用不同的css样式表的方法
- js/jquery判断浏览器类型的方法小结
- 浅析jQuery中调用ajax方法时在不同浏览器中遇到的问题
- 浅析jQuery中调用ajax方法时在不同浏览器中遇到的问题
- jquery 判断浏览器方法
- js/jquery判断浏览器的方法小结
- 判断浏览器canvas支持与否中jquery和getContext()方法的之间的调用问题
- js/jquery判断浏览器的方法小结
- js/jquery判断浏览器的方法大全
- js/jquery判断浏览器的方法小结
- js/jquery判断浏览器的方法小结
- js/jquery判断浏览器的方法总结
- 使用JQuery 区分判断 不同内核的浏览器
- jQuery判断网页是否已经滚动到浏览器底部的实现方法
- jquery判断浏览器后退时候弹出消息的方法
- js/jquery判断浏览器类型的方法小结
- JQuery 判断不同浏览器
- jQuery javaScript js 判断浏览器的类型、版本的方法
- jQuery判断浏览器并动态调整select宽度的方法