2013年5月15日

figure element size using javascript

摘要: 1 //get element size 2 3 function getElementLeft(element) { 4 var actualLeft = element.offsetLeft; 5 var current = element.offsetParent; 6 7 while (current !== null) { 8 actualLeft += current.offsetLeft; 9 current = current.offsetParent;10 ... 阅读全文

posted @ 2013-05-15 21:05 雷音 阅读(185) 评论(0) 推荐(0) 编辑

check plugin in browser

摘要: 1 //invalid in IE 2 function hasPlugin(name) { 3 name = name.toLowerCase(); 4 for (var i = 0; i < navigator.plugins.length; i++) { 5 if (navigator.plugins[i].name.toLowerCase().indexOf(name) > -1) { 6 return true; 7 } 8 } 9 10 ... 阅读全文

posted @ 2013-05-15 17:04 雷音 阅读(151) 评论(0) 推荐(0) 编辑

userAgent string detection in javascript

摘要: 1 var client = function () { 2 3 //browser engine 4 var engine = { 5 ie: 0, 6 gecko: 0, 7 webkit: 0, 8 khtml: 0, 9 opera: 0, 10 //full version 11 ver: null 12 }; 13 14 //br... 阅读全文

posted @ 2013-05-15 16:36 雷音 阅读(203) 评论(0) 推荐(0) 编辑

导航