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

javascript£º»ñÈ¡ÆÁÄ»¸ß¶ÈºÍ¿í¶ÈµÈÐÅÏ¢

ÍøÒ³¿É¼ûÇøÓò¿í£º document.body.clientWidth
ÍøÒ³¿É¼ûÇøÓò¸ß£º document.body.clientHeight
ÍøÒ³¿É¼ûÇøÓò¿í£º document.body.offsetWidth (°üÀ¨±ßÏߵĿí)
ÍøÒ³¿É¼ûÇøÓò¸ß£º document.body.offsetHeight (°üÀ¨±ßÏߵĸß)
ÍøÒ³ÕýÎÄÈ«ÎÄ¿í£º document.body.scrollWidth
ÍøÒ³ÕýÎÄÈ«Îĸߣº document.body.scrollHeight
ÍøÒ³±»¾íÈ¥µÄ¸ß£º document.body.scrollTop
ÍøÒ³±»¾íÈ¥µÄ×ó£º document.body.scrollLeft
ÍøÒ³ÕýÎIJ¿·ÖÉÏ£º window.screenTop
ÍøÒ³ÕýÎIJ¿·Ö×ó£º window.screenLeft
ÆÁÄ»·Ö±æÂʵĸߣº window.screen.height
ÆÁÄ»·Ö±æÂÊµÄ¿í£º window.screen.width
ÆÁÄ»¿ÉÓù¤×÷Çø¸ß¶È£º window.screen.availHeight
ÆÁÄ»¿ÉÓù¤×÷Çø¿í¶È£º window.screen.availWidth
»ñÈ¡ÍøÒ³±»¾íÈ¥µÄ¸ß£¬ÖÆ×÷¸¡¶¯´°Ìå¿ÉÓãº
function GetScrollY()
{       
    if (typeof window.pageYOffset == 'number')
    {
        return window.pageYOffset;
    }
    var CompatMode = window.document.compatMode;
    var DocumentElement = window.document.documentElement;
   
if ((typeof CompatMode == 'string') &&
(CompatMode.indexOf('CSS') >= 0) &&
(DocumentElement) && (typeof
DocumentElement.getAttribute("scrollTop") ==
'number'))
    {
        return DocumentElement.getAttribute("scrollTop");
     }
    var Body = window.document.body ;
    if ((Body) && (typeof Body.getAttribute("scrollTop") == 'number'))
    {
        return Body.getAttribute("scrollTop");
    }
    return 0;
}
ÏÂÃæÊÇ“ÎÞ¶¨Òå HTML µÄ Event ʼþ”µÄ²âÊÔ´úÂ룬·Ö±ðÓà IE ºÍ Firefox ´ò¿ª£¬µã»÷Ò³Ãæ¾Í¿É¿´µ½½á¹û¡£ <html>


Ïà¹ØÎĵµ£º

JavascriptʵÏÖhtml¿éÓï·¨¸ßÁÁ£¨ËÑË÷ºó¹Ø¼ü×Ö¸ßÁÁ£©

dp.SyntaxHighlighter
dp.SyntaxHighlighter£¬ÕⶫÎ÷yahoo¶¼ÔÚÓÃËü£¬Ö§³Ö¶àÖÖÓïÑÔ¡£
Ö»ÐèÒª½«´úÂë·Åµ½<textarea>±êÇ©ÄÚ£¬Ëü¾Í¿ÉÒÔ×Ô¶¯¸ù¾ÝclassÖ¸¶¨µÄÓïÑÔÀ´¶ÔtextareaÄÚÈݽøÐÐ×ÅÉ«£¬»¹ÌṩÁËÐкš¢´òÓ¡µÈ¹¦ÄÜ¡£È磺
Xml´úÂë
<TEXTAREA class=java name=code><br/>    // code here ......

¡¶Îò͸JavaScript¡·Ö® ¸Ê¶ģÐÍ£¨Ð£©


ÔÚÉÏÃæµÄʾÀýÖУ¬ÎÒÃǶ¨ÒåÁËÁ½¸öÓï·¨¸Ê¶£¬Ò»¸öÊÇClass()º¯Êý£¬Ò»¸öÊÇNew()º¯Êý¡£Ê¹ÓÃClass()¸Ê¶£¬ÎÒÃÇÒѾ­¿ÉÒÔÓ÷dz£ÓÅÑŵĸñʽ¶¨ÒåÒ»¸öÀà¡£ÀýÈçÇ°ÀýÖеģº
    
var
 Employee 
=
 Class(Person,    
//
ÅÉÉúÖÁPersonÀà
    
{ ......

Javascript ȡСÊýµãºóÃæNλ

ÓÃJavascriptÈ¡floatÐÍСÊýµãºóÁ½Î»£¬Àý22.127456È¡³É22.13,ÈçºÎ×ö£¿
1. ×µÄ°ì·¨....... [ÎÒ¾ÍÔõô¸ÉµÄ.........]
1function get()
2{
3    var s = 22.127456 + "";
4    var str = s.substring(0,s.indexOf(".") + ......

CºÍPython³ÌÐòÔ±µÄJavaScriptѧϰָÄÏ£¨Ò룩


write by ¾ÅÌìÑãôá(JTianLing) -- blog.csdn.net/vagrxie
ÌÖÂÛÐÂÎÅ×é¼°Îļþ
 Ô­ÎÄÀ´×Ô£º¡¶JavaScript for C & Python programmers
¡·£¬¾­¹ý×÷ÕßCanisÔÊÐíºó·­Ò룬¼´Ê¹×ªÔØÇ븽´ø´ËÁ´½Ó¡£

Ç°ÑÔ£ººÜÉٸɷ­ÒëµÄÊÂÇ飬ÀÛ£¬ÐÁ¿à£¬²»ÄÜ·¢»Ó£¬µäÐ͵ķÑÁ¦²»Ìֺã¬×î½üÎÞÁÄ£¬ÏëÔÚÍøÒ³ÉÏÏÔʾ¶¯»­£¨ÒòΪCSDNÌ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ