Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavascriptÍÏ×§&ÍÏ·ÅϵÁÐÎÄÕÂ1Ö®offsetParentÊôÐÔ


Õâ¸öϵÁÐÎÄÕÂÖ÷ÒªÊǽ²ÊöʵÏÖJavascriptÍÏ×§¹¦ÄܵĻù´¡ÖªÊ¶£¬²¢½«ÔÚ×îºó¸ø³öÒ»¸öÍêÕûµÄʾÀý¡£Êʺ϶ÔÍÏ×§ÍêÈ«²»¶®µÄÈËÔĶÁ¡£
µÚһƪ¾ÍÏȽ²½²JavascriptÖеÄoffsetParentÊôÐÔ°É¡£
 
 
Ö§³ÖµÄä¯ÀÀÆ÷£ºInternet Explorer 4.0+£¬Mozilla 1.0+£¬Netscape 6.0+£¬Opera 7.0+£¬Safari 1.0+
element.offsetParent
Summary
offsetParent returns a reference to the object which is the closest (nearest in the containment hierarchy) positioned containing element. If the element is non-positioned, the root element (html in standards compliant mode; body in quirks rendering mode) is the offsetParent. offsetParent returns null when the element has style.display set to "none".
Syntax
parentObj = element.offsetParent
 
Parameters
· parentObj is an object reference to the element in which the current element is offset.
Specification
DOM Level 0. Not part of specification.
½ÚÑ¡×ÔMozilla Developer CenterÍøÕ¾
 
·­ÒëÈçÏ£º
element.offsetParent
×ܽá
offsetParentÊôÐÔ·µ»ØÒ»¸ö¶ÔÏóµÄÒýÓã¬Õâ¸ö¶ÔÏóÊǾàÀëµ÷ÓÃoffsetParentµÄÔªËØ×î½üµÄ£¨ÔÚ°üº¬²ã´ÎÖÐ×î¿¿½üµÄ£©£¬²¢ÇÒÊÇÒѽøÐйýCSS¶¨Î»µÄÈÝÆ÷ÔªËØ¡£ Èç¹ûÕâ¸öÈÝÆ÷ÔªËØÎ´½øÐÐCSS¶¨Î», ÔòoffsetParentÊôÐÔµÄȡֵΪ¸ùÔªËØ(ÔÚ±ê×¼¼æÈÝģʽÏÂΪhtmlÔªËØ£»ÔÚ¹ÖÒì³ÊÏÖģʽÏÂΪbodyÔªËØ)µÄÒýÓᣠµ±ÈÝÆ÷ÔªËØµÄstyle.display ±»ÉèÖÃΪ "none"ʱ£¨Òë×¢£ºIEºÍOpera³ýÍ⣩£¬offsetParentÊôÐÔ ·µ»Ø null ¡£
¾ä·¨
parentObj = element.offsetParent
 
±äÁ¿
· parentObj ÊÇÒ»¸öÔªËØµÄÒýÓ㬵±Ç°ÔªËØµÄÆ«ÒÆÁ¿ÔÚÆäÖмÆËã¡£
¹æ·¶
DOM Level 0. ²¢·Ç¹æ·¶µÄÒ»²¿·Ö.
 
²âÊÔ´úÂë1£º
<!DOCTYPE&nb


Ïà¹ØÎĵµ£º

JavaScriptÃæÏò¶ÔÏó ¼Ì³Ð












javascriptÃæÏò¶ÔÏó¼Ì³ÐµÄÈýÖÖ·½·¨£º
<
html xmlns
=
"
http://www.w3.org/1999/xhtml
"
 
>
<
head runat
=
"
server
"
>
    
<
title
>
Untitled Page
</
title ......

javascriptÑ§Ï°Ëæ±Ê(ʹÓÃwindowºÍframe)µÄ¼¼ÇÉ

JavaScriptÔÊÐí´´½¨ºÍ´ò¿ª´ú±íHTMLÎı¾, form¶ÔÏóºÍframeµÄ´°¿Ú. window¶ÔÏóÊÇJavaScript¿Í»§²ã´Î½á¹¹µÄ×î¶¥²ã¶ÔÏó, formÔªËØºÍÈ«²¿JavaScript´úÂë¶¼ÊÇ´æÔÚÓÚÎĵµÖÐ,¶øÎĵµ±»×°Ôؽø´°¿Ú. ΪÁËÀí½â´°¿ÚÔõÑù¹¤×÷,Äã¿ÉÒÔ¿ØÖƲÙ×÷ÕâЩ´°¿Ú.
´ò¿ªºÍ¹Ø±Õ´°¿Ú
µ±Óû§Æô¶¯(launch)Navigatorʱ,½«×Ô¶¯´´½¨Ò»¸ö´°¿Ú.Óû§»¹¿ÉÒÔÊ¹Ó ......

Javascript¼ò½é

¶¨Òå
     JavascriptÊÇÒ»ÖÖ½âÊÍÐԵ쬻ùÓÚ¶ÔÏóµÄ½Å±¾ÓïÑÔ(an interpreted, object-based scripting language)¡£
     HTMLÍøÒ³ÔÚ»¥¶¯ÐÔ·½ÃæÄÜÁ¦½ÏÈõ£¬ÀýÈçÏÂÀ­²Ëµ¥£¬¾ÍÊÇÓû§µã»÷ijһ²Ëµ¥Ïîʱ£¬×Ô¶¯»á³öÏָò˵¥ÏîµÄËùÓÐ×Ӳ˵¥£¬Óô¿HTMLÍøÒ³ÎÞ·¨ÊµÏÖ£»ÓÖÈçÑéÖ¤HTML±íµ¥(F ......

javascriptÃæÏò¶ÔÏóÈ«ÐÂÀíÁ·(ËÄ)

ÀûÓÃÔ­Ðͼ̳еĹؼüÓÐÁ½²½²Ù×÷£º
Ê×ÏÈ´´½¨Ò»¸ö¸¸ÀàµÄʵÀý»¯¶ÔÏó£¬È»ºó½«¸Ã¶ÔÏ󸳸ø×ÓÀàµÄ prototype ÊôÐÔ¡£
ÕâÑù£¬¸¸ÀàÖеÄËùÓй«ÓÐʵÀý³ÉÔ±¶¼»á±»×ÓÀà¼Ì³Ð¡£²¢ÇÒÓà instanceof ÔËËã·ûÅжÏʱ£¬×ÓÀàµÄʵÀý»¯¶ÔÏó¼ÈÊôÓÚ×ÓÀ࣬ҲÊôÓÚ¸¸Àà¡£
È»ºó½«×ÓÀà±¾Éí¸³Öµ¸øËüµÄ prototype µÄ constructor ÊôÐÔ¡££¨×¢Ò⣺ÕâÀ︳ֵµÄʱº ......

JavaScriptÏû³ý×Ö·û´®¿Õ¸ñ

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>js³ýÈ¥×Ö·û´®¿Õ¸ñ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ