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
Ïà¹ØÎĵµ£º
ugmbbc·¢²¼ÓÚ 2009-11-14 09:41:43| 7628 ´ÎÔĶÁ ×ÖÌ壺´ó С ´òÓ¡Ô¤ÀÀ
var ReTitle = '»Ø¸´:Google ÅÅÃûÖÐµÄ 10 ¸ö×îÖøÃûµÄ JavaScript ¿â';
¸ÐлCOMSHARP CMSµÄͶµÝ
ÐÂÎÅÀ´Ô´:tripwiremagazine.com
JavaScript ÊÇ Web ¿ª·¢ÓëÉè¼ÆÖв»¿É»òȱµÄ¶«Î÷£¬²»¹ÜÊÇÒ»¸ö¼òµ¥µÄÍøÒ³»¹ÊÇÒ»¸öרҵµÄÕ¾µã£¬Ò²²»¹ÜÄãÊǸßÊÖ»¹ÊDzËÄñ ......
ÕâÖÖÐÂʽµÄ¼¼Êõ×îÏÈÓÉjQuery¸ã³öÀ´µÄ£¬½Ó×ÅPrototypeÓëmootools¶¼Ö§³ÖÁË¡£Õâ¼¼ÊõÐËÆðµÄÔÒòÊÇä¯ÀÀÆ÷Ðá̽¼¼ÊõÊDz»Ì«¿É¿¿£¬ÈçUserAgentºÜÈÝÒ×±»Î±Ô죬ÈçIE8µÄUserAgent¾Í°ÑÐí¶àä¯ÀÀÆ÷µÄ¹Ø¼ü×Ö°üº¬½øÈ¥£¬Ôì³É±çʶÀ§ÄÑ¡£ÆäËûÒ»Ð©ÖØÒª±çʶÊֶΣ¬ÓÉÓÚä¯ÀÀÆ÷³§É̶Ծɰ汾µÄÉý¼¶Óë²»¶ÏÍÆ½øÐ°汾£¬Ðí¶à¶¼ÎÞЧÁË¡£ÓÉÓÚä¯ÀÀÆ÷ÖÖÀàÔ½À´ ......
ÀûÓÃÔÐͼ̳еĹؼüÓÐÁ½²½²Ù×÷£º
Ê×ÏÈ´´½¨Ò»¸ö¸¸ÀàµÄʵÀý»¯¶ÔÏó£¬È»ºó½«¸Ã¶ÔÏ󸳸ø×ÓÀàµÄ prototype ÊôÐÔ¡£
ÕâÑù£¬¸¸ÀàÖеÄËùÓй«ÓÐʵÀý³ÉÔ±¶¼»á±»×ÓÀà¼Ì³Ð¡£²¢ÇÒÓà instanceof ÔËËã·ûÅжÏʱ£¬×ÓÀàµÄʵÀý»¯¶ÔÏó¼ÈÊôÓÚ×ÓÀ࣬ҲÊôÓÚ¸¸Àà¡£
È»ºó½«×ÓÀà±¾Éí¸³Öµ¸øËüµÄ prototype µÄ constructor ÊôÐÔ¡££¨×¢Ò⣺ÕâÀ︳ֵµÄʱº ......
Jsѧϰ£¨¶þ£©
ÎÒÃÇÓ¦¸ÃÒѾ·¢ÏÖ£¬´´½¨¹«ÓÐʵÀý³ÉÔ±ÆäʵºÜ¼òµ¥£¬Ò»ÖÖ·½Ê½ÊÇͨ¹ýÔÚÀàÖиø this.memberName À´¸³Öµ£¬Èç¹ûÖµÊǺ¯ÊýÖ®ÍâµÄÀàÐÍ£¬ÄǾÍÊǸö¹«ÓÐʵÀý×ֶΣ¬Èç¹ûÖµÊǺ¯ÊýÀàÐÍ£¬ÄǾÍÊǹ«ÓÐʵÀý·½·¨¡£ÁíÍâÒ»ÖÖ·½Ê½ÔòÊÇͨ¹ý¸ø className.prototype.memberName ¸³Öµ£¬¿É¸³ÖµµÄÀàÐ͸ú this.memberName ÊÇÏàͬµÄ¡£
µ½µ×ÊÇ ......
1. jQuery tablesorter
http://tablesorter.com/docs/
2. Table sorting with Prototype
http://tetlaw.id.au/view/blog/table-sorting-with-prototype/
3. Sorttable
http://www.kryogenix.org/code/browser/sorttable/
4. Table Sorting Javascript
http://yoast.com/articles/sortable-table/
5. Sorting Tabl ......