Fire my passion

Anything with my most passion……
数据加载中……
JQuery学习笔记(五)
六、实用函数

1、JQuery的标记
$.browser
<b>msie</b>—Set to true if the user agent header identifies the browser as Microsoft

Internet
Explorer.
mozilla—Set to true if the user agent header identifies the browser as any Mozillabased
browser. This includes browsers such as Firefox, Camino, and Netscape.
safari—Set to true if the user agent header identifies the browser as Safari or any
Safari-based browser such as OmniWeb.
opera—Set to true if the user agent header identifies the browser as Opera.
version—Set to the version number of the rendering engine for the browser.

version并不是浏览器的版本号,而是浏览器核心的版本号

用这个标记,主要适用于在不同浏览器的方法相同,但是参数类型,或参数个数不同的情况

$.boxModel

结果返回true代表是W3C兼容的盒子模型,反之为IE的模型
主要可以体现在strict mode和quirks mode的差异
关于IE quirks mode的一个经典再现
元素的width指的是“内容的width” + padding的width + border的width,而W3C模式中,指明

元素的width应该仅仅是“内容的width”

可以在网页开头声明DOCTYPE来显示设置成strict mode

$.styleFloat

这个标记主要是为了兼容IE和其他浏览器对style中的float的差异进行处理的
在IE中,style的float应为 styleFloat,在其他浏览器中为 cssFloat
例如
element.style[$.styleFloat] = 'left';

posted on 2008-02-25 16:46 everx 阅读(57) 评论(0)  编辑 收藏 网摘 所属分类: JavaScript


标题  
姓名  
主页
Email (博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
Google站内搜索

China-pub 计算机图书网上专卖店!6.5万品种 2-8折!
近千种 9-95 新二手计算图书火热销售中!
开发者征途系统新作:《设计模式——基于C#的工程化实现及扩展》



相关文章:

相关链接: