Javascript: onresize
ä¯ÀÀÆ÷£ºIE 8¡¢FF 3.6¡¢Chrome 4.0¡¢Safari 4.0¡¢Opera 10.1
½öÓÐIEä¯ÀÀÆ÷Ö§³ÖHTMLElement.onresize£¨±ÈÈçbody.onresize£©
ÆäËüä¯ÀÀÆ÷Ö»Ö§³Öwindow.onresize
ÏÈ˵IEµÄHTMLElement.onresize
ʹÓÃÇ°ÇëÈ·¶¨ÄãµÄÐÄÔ༰ѪѹÕý³££¬Èç¹ûÄ㶨ÒåÁË
body.onresize = function(){……}»òÕßhtml.onresize = obj.fun;
Äã²Â²ÂthisÖ¸ÕëÊÇË£¿²»ÊÇbody£¬²»ÊÇhtml£¬²»ÊÇobj£¬¶øÊÇwindow£¡
ÕâÑùÇå¿öÏÂÈç¹û£º
function fun(){
……
};
html.onresize = fun;
body.onresize = fun;
document.getElementById("id").onresize = fun;
ÒÔÉÏ´úÂëÍêÈ«¿ÉÓã¬Ö»ÊÇfunÖ´ÐÐʱ£¬Äã¸ù±¾²»ÖªµÀÊÇÄĸöÔªËؼ¤·¢µÄ¡£Ê²Ã´£¿Äã˵event¶ÔÏñÀï»á²»»áÓм¤·¢µÄÔªËØ£¿¿Ï¶¨µÄ˵£ºÃ»ÓУ¡
ºÃÁË£¬ÎÒÃÇ·ÅÇáËÉ£¬Ã»°ì·¨¾Íû°ì·¨°É¡£´ó²»ÁËÎҾͲ»¹ÜÊÇ˼¤·¢µÄÈ«¶¼´¦ÀíÒ»±é¡£²»¹ý»¹ÊÇÏÈ¿´ÏÂÃæµÄ´úÂ룺
function addresize(element){
element.onresize = function(){
……
};
};
addresize(body);
addresize(html);
addresize(#id);
Äã²Â²ÂÔÚonresizeÖ´ÐÐʱµÄthisÊÇË£¿±ðÏëÁË£¬»¹ÊÇwindow£¡
ÁéÒìµÄÊÂÇé·¢ÉúÁË£¬ÔÚÊ¡ÂԺŵĴúÂëÖÐÄã¿ÉÒÔʹÓÃelement±äÁ¿£¡Ò²¾ÍÊÇaddresizeµÄ²ÎÊý£¬Õâ¸ö²ÎÊýÊÇʼþ¼¤·¢ÔªËØ¡£
ΪÕâ¸öÊÂÎÒÔÎÁ˺ü¸Ì죬µ½ÏÖÔÚ¶¼Ã»ÏëÃ÷°×Õâ¸öÓï·¨¹æÔò£¬µ±×÷Ò»¸öÌØÊâÓ÷¨°É¡£
ÏÂÃæ˵window.onresize
ÔÚIEÖÐÕâ¸öʼþºÜºÃÓ㬵±´°¿ÚÈÝÁ¿´óС·¢Éú±ä»¯Ê±¾Í»á¼¤·¢£¡£¨×¢ÒâºÚÌå×Ö£©
ÔÚÆäËüä¯ÀÀÆ÷ÖоÍÓÐÎÊÌâÁË£¬Ëü½öÔÚ´°¿Ú´óС·¢Éú±ä»¯Ê±¼¤·¢¡£
ÕâÀï¾ÍÓÐÇø±ðÁË£º
µ±ÎÒÏëÈÃij¸öÔªËسäÂúÕû¸ö´°¿Ú£¬ÕâÑùµÄ»°ÔÚwindow.onresizeʱ¾ÍÐèÒª¸Ä±äËüµÄstyle.width/height
ÔÚIEÖÐûÓÐÈκÎÎÊÌ⣬ÆäËüÓÎÀÀÆ÷ÔÚËõСʱ¾Í³öÏÖÎÊÌâÁË£º
Õû¸öʼþµÄÁ÷³ÌÊÇÕâ¸öÑù×ӵģº
1¡¢window¸Ä±ä´óС£¬ÕâÀïÌØÖ¸ËõС¡£
2¡¢ä¯ÀÀÆ÷·¢ÏÖÈÝÄɲ»ÏÂÄÚÈÝ£¬¸øhtmlÌí¼ÓÁ˹ö¶¯Ìõ£¬¿ÉÊÓÇøÓò¸üСÁË¡£
3¡¢ä¯ÀÀÆ÷¼¤·¢ÁËwindow.onresizeʼþ´úÂë¡£ÄãÔÚÕâÀï¸ü¸ÄÁËÔªËصĴóС¡£
4¡¢ä¯ÀÀÆ÷·¢ÏÖ¿ÉÒÔÈÝÄÉÏÂÄÚÈÝÁË£¬È¡ÏûÁ˹ö¶¯Ìõ¡£
5¡¢IEÔÚ´ËʱÔٴμ¤·¢onresize¡¢ÆäËüä¯ÀÀÆ÷ÂÔ¹ý´Ë²½
Õâʱ³ýIEÍ⣬ÄãµÄÔªËØ»áÉÙÒ»¸ö¹ö¶¯ÌõµÄ´óС¡£
½â¾ö·½°¸£º
³ýÁËIEÖ®ÍâµÄä¯ÀÀÆ÷ÇëÁ¬ÐøÉèÖÃÁ½´Î´óС¡£Ã¿´Î¶¼ÊÇÈ¡body.client/offset´óС¾ÍÐÐÁË¡£
Ïà¹ØÎĵµ£º
Ò»¡¢Ê²Ã´ÊÇ¿ò¼Ü
¡¡¡¡¿ò¼ÜFrames×îÖ÷Òª¹¦ÓÃÊÇ"·Ö¸î"ÊÓ´°£¬Ê¹Ã¿¸ö"СÊÓ´°"ÄÜ
ÏÔʾ²»Í¬µÄHTM
LÎļþ£¬²»Í¬¿ò¼ÜÖ®¼ä¿ÉÒÔ»¥¶¯(interact)£¬Õâ¾ÍÊÇ˵²»Í¬¿ò¼ÜÖ®¼ä¿ÉÒÔ½»»»Ñ¶Ï¢Óë×ÊÁÏ¡£ÀýÈç:¼ÙÉèÄú¿ªÁËÁ½¸öframes£¬µÚÒ»¸öframe¿ÉÏÔ
ʾÊéµÄĿ¼£¬µÚ¶þ¸öframeÔòÏÔʾÕ½ڵľßÌåÄÚÈÝ¡£
¡¡¡¡¿ò¼Ü¿ÉÒÔ½«ÆÁÄ»·Ö¸î ......
/***************************by
garcon1986********************************/
Java is to
JavaScript what Car is to Carpet
ÂÛ̳½»Á÷£º´óÐ͵Äweb¿ª·¢ÉçÇø
http://www.webdeveloper.com/forum/index.php
W3CschoolsÖÐÎÄÕ¾£º¿ª·¢ÕßµÄʵÓÃ+ѧϰÍøÕ¾
http://www.w3school.com.cn/js/index.asp
javascript³ ......
//×Ô´øµÄ´òÓ¡Ô¤ÀÀ WebBrowser.ExecWB(1,1) ´ò¿ª
Web.ExecWB(2,1) ¹Ø±ÕÏÖÔÚËùÓеÄIE´°¿Ú£¬²¢´ò¿ªÒ»¸öд°¿Ú
Web.ExecWB(4,1) ±£´æÍøÒ³
Web.ExecWB(6,1) ´òÓ¡
Web.ExecWB(7,1) ´òÓ¡Ô¤ÀÀ
Web.ExecWB(8,1) ´òÓ¡Ò³ÃæÉèÖÃ
Web.ExecWB(10,1) ²é¿´Ò ......
JavaScript½âÎö¶ÁÈ¡XMLÎļþ£¬Ö÷Òª¾ÍÊǼÓÔز¢½âÎöXMLÎļþ£¬È»ºó¾Í¿ÉÒÔ²âÊÔ½âÎöµÄXMLÎļþµÄÄÚÈÝ£¬´òÓ¡Êä³öÀ´¡£
±àдÁËÒ»¸öJavaScriptµÄÀàÀ´ÊµÏÖ¶ÁÈ¡Ò»¸öXMLÎļþÖеÄÊý¾Ý£¬ÊµÏÖ´úÂëÈçÏÂËùʾ£º
<mce:script type="text/javascript"><!--
/**
* @author Shirdrn
*/
function XMLDoc(){}; // ¶¨ÒåÒ»¸öXM ......