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

javascript »ñÈ¡¹ö¶¯Ìõ¸ß¶È+³£ÓÃjsÒ³Ãæ¿í¶ÈÓë¸ß¶È

/********************
 * È¡´°¿Ú¹ö¶¯Ìõ¸ß¶È
 ******************/
function getScrollTop()
{
    var scrollTop=0;
    if(document.documentElement&&document.documentElement.scrollTop)
    {
        scrollTop=document.documentElement.scrollTop;
    }
    else if(document.body)
    {
        scrollTop=document.body.scrollTop;
    }
    return scrollTop;
}
/********************
 * È¡´°¿Ú¿ÉÊÓ·¶Î§µÄ¸ß¶È
 *******************/
function getClientHeight()
{
    var clientHeight=0;
    if(document.body.clientHeight&&document.documentElement.clientHeight)
    {
        var clientHeight = (document.body.clientHeight<document.documentElement.clientHeight)?document.body.clientHeight:document.documentElement.clientHeight;       
    }
    else
    {
        var clientHeight = (document.body.clientHeight>document.documentElement.clientHeight)?document.body.clientHeight:document.documentElement.clientHeight;   
    }
    return clientHeight;
}
/********************
 * È¡ÎĵµÄÚÈÝʵ¼Ê¸ß¶È
 *******************/
function getScrollHeight()
{
    return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
}
////////////////////////////////////////////////////
ÔÚIEÖУº
document.body.clientWidth ==> BODY¶ÔÏó¿í¶È
document.body.clientHeight ==> BODY¶ÔÏó¸ß¶È
document.documentElement.clientWidth ==> ¿É¼ûÇøÓò¿í¶È
document.documentElement.clientHeight ==> ¿É¼ûÇøÓò¸ß¶È
ÔÚFireFoxÖУº
document.body.clientWidth ==> BODY¶ÔÏó¿í¶È
d


Ïà¹ØÎĵµ£º

JavaScript »ñÈ¡¶ÔÏóµÄ¸ß¶ÈºÍ¿í¶ÈÏêϸ˵Ã÷

scrollHeight: »ñÈ¡¶ÔÏóµÄ¹ö¶¯¸ß¶È¡£
scrollLeft:ÉèÖûò»ñȡλÓÚ¶ÔÏó×ó±ß½çºÍ´°¿ÚÖÐÄ¿Ç°¿É¼ûÄÚÈݵÄ×î×ó¶ËÖ®¼äµÄ¾àÀë
scrollTop:ÉèÖûò»ñȡλÓÚ¶ÔÏó×¶ËºÍ´°¿ÚÖпɼûÄÚÈݵÄ×¶ËÖ®¼äµÄ¾àÀë
scrollWidth:»ñÈ¡¶ÔÏóµÄ¹ö¶¯¿í¶È
offsetHeight:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓɸ¸×ø±ê offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¸ß¶È
offsetL ......

ÉÏÏßÇ°Óà JSMin ѹËõÄãµÄ JavaScript µµ°¸


ÔÚÍøÒ³Öж¯Ì¬ÔØÈëµÄ JavaScript ¶ÔÓÚÒ³ÃæÏÔʾµÄËÙ¶ÈÓ°ÏìÉõ¶à£¬²»µÃ²»×¢Ò⣡
ÓÈÆäÊǺܶàÈËÏ°¹ß°Ñ JavaScript include дÔÚ <head> Çø¿éÖУ¬ÕâÑùÒ»À´×î´óµÄÎÊÌâ¾ÍÊÇ Browser ±ØÐëÒªµÈµ½ JavaScript È«²¿¶ÁÍêºó²Å»á¿ªÊ¼ÏÔʾÍøÒ³£¬Èç¹ûÄãÏñÐÅÒå·¿ÎÝÕâÑù£¬¶ÁÒ»¸öÊ×Ò³ÒªÏÂÔØ 18 ¸ö JavaScript ÍⲿµµÇÒ¡¸Ã»ÓдóƵ¿í¡¹µÄ» ......

JavaScript ÉèΪÖ÷Ò³Óë¼ÓÈëÊÕ²Ø

//ÉèÖõ±Ç°Ò³ÃæΪÓû§µÄÊ×Ò³
function setHomepage()
{
   document.body.style.behavior='url(#default#homepage)';
   document.body.setHomePage(window.location.href);
   event.returnValue=false;
   return;
}
//¼ÓÈëÊÕ²Ø
function addFavorite()
{
 &nb ......

javascriptƴͼÓÎÏ·

ƴͼÓÎÏ·£¬ÔÚie7 £¬»ðºü£¬¹È¸è ²âÊÔͨ¹ý¡£
HTML code
<!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 runat="server">
    <title> ......

dz̸JavaScript¿ò¼ÜÉè¼Æ


ÔÚÕâ¸öjs¿ò¼ÜËæ´¦ÂÒÅܵÄʱ´ú£¬ÄãÊÇ·ñ¿¼Âǹýдһ¸ö×Ô¼ºµÄ¿ò¼Ü£¿ÏÂÃæµÄÄÚÈÝÒ²Ðí»áÓеã°ïÖú¡£
Ò»¸ö¿ò¼ÜÓ¦¸Ã°üº¬ÄÄЩÄÚÈÝ£¿
1.ÓïÑÔÀ©Õ¹    
¡¡¡¡´ó²¿·ÖÏÖÓеĿò¼Ü¶¼ÌṩÁËÕⲿ·ÖÄÚÈÝ£¬ÓïÑÔÀ©Õ¹Ó¦µ±ÊÇÒÔECMAScriptΪ»ù´¡½øÐеģ¬²»Ó¦µ±ÒÀÀµÈκÎËÞÖ÷»·¾³£¬Ò²¾ÍÊÇ˵£¬×÷Ϊһ¸ö¿ò¼ÜµÄÉè¼ÆÕߣ¬ÄãÓ¦µ±±£Ö¤Ä ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ