Javascript CSS¼ÇÊÂ
×¢£º"elm"´ú±íij¸öDOMÔªËØ£¬"xxx"´ú±íij¸öCSSÊôÐÔ
Ò»¡¢elm.style.xxx Ö»ÄÜ»ñÈ¡ÄÚÁªÑùʽÀïµÄÖµ
ÒªÏë»ñµÃÕýÈ·µÄcssÖµ£º
IE£ºelm.currentStyle[xxx]
W3C±ê×¼£ºdocument.defaultView.getComputedStyle(elm,"")[xxx]
×¢Ò⣺ÓÃIE·½·¨·µ»ØÖµ¿ÉÄܲ»ÊÇÊý×Ö£¬¶øÊÇauto£»ÓÃw3cµÄ·½·¨×ÜÊǻ᷵»ØÊý×Ö+µ¥Î»
Èý¡¢offsetLeft
1.ä¯ÀÀÆ÷ÊÇ·ñ»á°ÑbodyµÄ¸÷¸öÊôÐÔÖµ(margin,padding,border)°üÀ¨ÔÚoffsetLeftÄÚ£¿
IE6/7IE8Firefox
margin-left
·ñ
ÊÇ
ÊÇ
padding-left
ÊÇ
ÊÇ
ÊÇ
border-left
·ñ
ÊÇ
·ñ
2.¸¸ÔªËصÄÊôÐÔÖµÒ²»á°üÀ¨ÔÚoffsetLeftÄÚ
3.¶ÔÓÚÔªËØ×ÔÉíµÄÊôÐÔÖµ£¬Ö»ÓÐmargin-left»á±»°üÀ¨ÔÚoffsetLeftÄÚ
4.ÔÚÔªËØ display:none Çé¿öÏ offsetLeft µÄÖµ£º IE6/7:-1 IE8/Firefox:0
5.visibility:hidden²»»áÓ°ÏìoffsetLeft
6.bodyµÄoffsetLeftÖµ:
A.IE6/7»á°ÑbodyµÄmargin-left°üÀ¨ÔÚÆäoffsetLeftÄÚ
B.ÈôbodyÓпí¶ÈΪxµÄ±ß¿ò(border)£¬ÔÚFirefoxÀïbodyµÄoffsetLeft»á±ä³É-x
ËÄ¡¢offsetTop
Çé¿öÓëoffsetLeftÒ»Ñù
Îå¡¢offsetWidthºÍoffsetHeight
ÔÚËùÓÐÖ÷Á÷ä¯ÀÀÆ÷ÀÕâÁ½¸öÊôÐÔµÄÖµ¶¼ÊÇ£ºborder+padding+width
Ïà¹ØÎĵµ£º
Ϊµ¥¸ö±êÇ©¶¨Ò壺
br{
text-align: center;
color: #000000;
font-family:ËÎÌå;
}
Ϊbr±êÇ©Ö¸¶¨ÁË3¸öÑùʽÊôÐÔ£¬°üº¬¶ÔÆ䷽ʽ¡¢ÎÄ×ÖÑÕÉ«¼°×ÖÌå¡£
ÔÚÍøÒ³ÖÐÒ»¸öÿ¸öIDÖ»ÄÜʹÓÃÒ»´Î£¬È磺
<div id="main"></div>
ÔÚCSSÑùʽ±íÖУ¬IDÑ ......
ͨ¹ýWMIÀ´ÊµÏÖ»ñÈ¡¿Í»§¶Ë¼ÆËã»úÓ²¼þ¼°ÏµÍ³ÐÅÏ¢:
1//ϵͳÐÅÏ¢»ñÈ¡
2function getSysInfo(){
3 var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
4 var service = locator.ConnectServer(".");
5 //CPUÐÅÏ¢
6 var cpu = new Enumerator (service.ExecQuery("SELECT * from Win32_Processor")).item(); ......
js.js
var xmlDoc;
function cleanData(getObj)
{
if(getObj)
{
getObj.options.length = 0;
}
}
function getxmlDoc()
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
......
Õâ¸ö“ä¯ÀÀÆ÷ĬÈÏHTMLµÄCSSÑùʽÊôÐÔ”£¬ÔÚÄãÐèÒª»¹ÔĬÈÏÖµµÄʱºò£¬±È½ÏÓÐÓ᣿ªÊ¼µÄʱºòÓ¦ÓÃͨÅäÑ¡ÔñÆ÷ *
{margin:0;padding:0;}£¬µ±ÐèҪʹÓñ߾àµÄʱºò£¬¾ÍÐèÒª»¹ÔHTMLĬÈÏCSSÖµÁË¡£
µ«Í¨ÅäÑ¡ÔñÆ÷ÔÚ´óÐÍÍøÕ¾µÄ¹¹½¨ÖУ¬Ó°
ÏìÐÔÄÜ£¬¿ÉÒԲο¼52CSS.comµÄÏà¹ØÎÄÕ£¬´ó¼Ò»¹ÊÇÐèÒª½÷É÷һЩ¡£
¡¡¡¡Ò ......