JavascriptÍøÒ³´òÓ¡´óÈ«£¨×ª£©
JavascriptÍøÒ³´òÓ¡´óÈ«
2010-04-09 09:30
ÆÕͨ´òÓ¡£¨ÕûÒ³´ò£© ´òÓ¡ÍøÒ³ÄÚ²¿·ÖÄÚÈÝ£¨×Ô¶¨Ò壩 ´òÓ¡È¥µô/Ìí¼Óҳüҳ½Å ʹÓÃÍⲿ¿Ø¼þ/·½·¨ÊµÏֶ๦ÄÜ´òÓ¡ ´òÓ¡±³¾°
ÒÔÉÏΪ´úÂë¿ØÖÆ
ÉèÖÓҳÃæÉèÖÔʵÏÖ´òÓ¡²ÎÊýÉèÖã¨WindowϵͳͼÎİ棩
Ò»¡¢ÆÕͨ´òÓ¡£¨ÕûÒ³´ò£©
Õâ¸ö²»Óöà˵£¬Ö±½ÓÓÃ
ÒýÓÃ:
window.print();
¶þ¡¢´òÓ¡ÍøÒ³ÄÚ²¿·ÖÄÚÈÝ£¨×Ô¶¨Ò壩
·ÖÈýÖÖ·½·¨ÊµÏÖ
1¡¢ÓÃcss¿ØÖÆ
ÒýÓÃ:
@media print
.a {display:block}
.b {display:hidden}
°ÑÄã²»Ïë´òÓ¡µÄ²¿·ÖclassÉèΪb
Ê×ÏÈÔÚÍøÒ³ÖÐÌí¼Ó£º
ÒýÓÃ:
<OBJECT id="WebBrowser" height="0" width="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"
VIEWASTEXT>
</OBJECT>
È»ºó¾Í¿ÉÒÔÒÀ´Î¼ÓÈ빦ÄÜ°´Å¥ÁË£º
ÒýÓÃ:
<input type="button" value="´òÓ¡"> <input type="button" value="Ö±½Ó´òÓ¡">
<input type="button" value="Ò³ÃæÉèÖÃ">
<input type="button" value="´òÓ¡Ô¤ÀÀ"> <INPUT type="button" value="¹Ø±Õ´°¿Ú" >
½«ÕâÁ½¿é¶«Î÷·Åµ½<center class=noprint></center>¾Í²»»á´òÓ¡ÕâЩ°´Å¥ÁË¡£µ±È»Òª¶¨ÒånoprintÁË£º
<style media="print">.Noprint { DISPLAY: none }</style>Ö»Òª°Ñ²»Ïë´òÓ¡µÄ¶«Î÷µÄcssÉèÖóÉnoprint¾Í¿ÉÒÔÁË¡£
ÏÖÔÚ¾ÍʵÏÖÁË»ù±¾µÄweb´òÓ¡£¬ÐèҪעÒâµÄÇé¿öÈçÏ£º
a. ±ØÐ뽫ieµÄinternetÑ¡ÏîµÄ°²È«ÉèÖÃÖжÔÓÚûÓбê¼ÇΪ°²È«µÄActiveX¿Ø¼þ½øÐÐ...ÉèÖóÉÌáʾ»òÕßÆôÓ㬷ñÔò»á±¨´í£¬µ¼Ö²»¿ÉÓá£
b. Èç¹ûÔÚvs.net±à¼»·¾³Ï±༸ÃÒ³Ã棬Ëü¾³£×Ô¶¯µÄ¸øobjectÌí¼Ó¶àÓàµÄ²ÎÊý£¬ÓÐÁËÕâЩ¶«Î÷£¬´òÓ¡¾Í»á³ö´í£¬ËùÒÔÒª¼ÇµÃ×îºó±£´æµÄʱºòɾ³ýËüÃÇ¡£
2¡¢ÓÃjavascript´òÓ¡¹Ì¶¨±êÇ©ÄÚµÄÄÚÈÝ
a¡¢ÔÚÒ³ÃæµÄ´úÂëÍ·²¿´¦¼ÓÈëJavaScript£º
ÒýÓÃ:
<script language=javascript>
function doPrint() {
bdhtml=wind
Ïà¹ØÎĵµ£º
javascriptÖÐsetTimeout()º¯Êý
´ó¼Ò¶¼ÖªµÀjavascriptÖеÄsetTimeput()º¯ÊýµÄ×÷Óã¬Ò»°ã»áÓÃËûÀ´´¦ÀíһЩÁ¬ÐøµÄÊÂÇ飬ÃÇÏÈ¿´Ò»¸öÀý×Ó£º
<head>
<script>
function init()
  ......
JavaScript²»Çø·Öµ¥¸ö×Ö·ûºÍ×Ö·û´®£¬ÈκÎ×Ö·û»ò×Ö·û´®¿ÉÒÔÓÃË«ÒýºÅ»òµ¥ÒýºÅÒýÆðÀ´¡£Èç¹û×Ö·û´®±¾Éíº¬ÓÐË«ÒýºÅ£¬ÔòӦʹÓõ¥ÒýºÅ½«×Ö·û´®À¨ÆðÀ´£»Èç¹û×Ö·û´®±¾Éíº¬Óе¥ÒýºÅ£¬ÔòӦʹÓÃË«ÒýºÅ½«×Ö·û´®ÒýÆðÀ´£¬Á½Õß¿ÉÒÔǶÌ×ʹÓᣠ......
½ñÌìÔÚѧϰBomʱÓöµ½ÁËÒ»¸ö´íÎó£º
Static overflow at 7
´íÎóÔÒò£º×Ô¶¨ÒåÁËÒ»¸ö scrollTo()£¬Óëϵͳwindow.scrollTo()³åÍ»£¬ÒÔÖÂÒýÆðËÀÑ»·£¬´Ë´íÎóÔÚµ¯³ö´íÎó¿ò£¬¶øÔÚFFÏÂûÓз´Ó¦£¬µ«functionÒ²²»Ö´ÐС£ÁíÍâ<img src="" onerror=""/>Ò²¿ÉÄܳöÏÖÕâÖÖÇé¿ö¡£ÏêϸÇë²Î¿¼£ºhttp://www.cnblogs.com/S.Sams/archive/200 ......
תÔØ×Ô£ºhttp://www.ruanyifeng.com/blog/2009/09/find_element_s_position_using_javascript.html
Áíһƪ£ºhttp://blog.csdn.net/ivan820819/archive/2009/09/03/4515122.aspx
ÖÆ
×÷
ÍøÒ³µÄ¹ý³ÌÖУ¬ÄãÓÐʱºòÐèÒªÖªµÀij¸öÔªËØÔÚÍøÒ³ÉϵÄÈ·ÇÐλÖá£
ÏÂÃæµÄ½Ì³Ì×ܽáÁËJavascriptÔÚÍøÒ³¶¨Î»·½ÃæµÄÏà¹ØÖª
ʶ¡£
Ò»¡¢ÍøÒ³µ ......