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

XHTMLÖÐ JavaScript¸Ä±ä¼°Ð¡¼¼ÇÉ

Çø·ÖXHTMLÓëHTMLµÄ±êÖ¾£º
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > 
Ç°ÕßÊÇXHTML£¬ºóÕßÊÇHTML
ä¯ÀÀÆ÷µÄ¸ßºÍ¿í£º
XHTML£º
document.documentElement.clientWidth;
ocument.documentElement.clientHeight;
HTML£º
document.body.clientWidth;
ocument.body.clientHeight;
asp¿Õ¼äÖУ¬JavaScriptµÄ·½·¨Ó¦·ÅÔÚOnClientClickÖУ¬¶ø²»ÊÇonclick
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/img/login.gif" 
                        OnClientClick="return login()" onclick="ImageButton1_Click" />
²»ÏÔʾä¯ÀÀÆ÷µÄ¹ö¶¯Ìõ£º
<style type="text/css"> 
html

overflow-x:hidden; /*Òþ²Øˮƽ¹ö¶¯Ìõ*/ 
overflow-y:hidden; /*Òþ²Øˮƽ¹ö¶¯Ìõ*/ 

</style>


Ïà¹ØÎĵµ£º

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

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

Javascript»ñµÃ¶ÔÏó¡¢ÊôÐÔ³£ÓÃÓï¾ä

1.»ñµÃÖ¸¶¨idµÄ¶ÔÏó£ºdocument.getElementById ("id")£¬idÐèΨһ£¬name²»±ØΨһ¡£
2.»ñµÃÖ¸¶¨nameµÄ¶ÔÏóÊý×飺document.getElementsByname("name")£¬·ÃÎʾßÌå¶ÔÏóÓÃϱê±íʾ£ºdocument.getElementsByname("name")[0]
3. »ñµÃ´¥·¢Ê¼þµÄ¶ÔÏó£º
function getEventElement(ev){
ev = ev||window.event;//»ñµÃ¶ÔÏó
......

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

/********************
 * È¡´°¿Ú¹ö¶¯Ìõ¸ß¶È
 ******************/
function getScrollTop()
{
    var scrollTop=0;
    if(document.documentElement&&document.documentElement.scrollTop)
    {
        ......

JavascriptÃæÏò¶ÔÏó±à³ÌÏê½â

˽ÓбäÁ¿ ÔÚ¶ÔÏóÄÚ²¿Ê¹ÓÃ'var'¹Ø¼ü×ÖÀ´ÉùÃ÷£¬¶øÇÒËüÖ»Äܱ»Ë½Óк¯ÊýºÍÌØȨ·½·¨·ÃÎÊ¡£
˽Óк¯Êý ÔÚ¶ÔÏóµÄ¹¹Ô캯ÊýÀïÉùÃ÷£¨»òÕßÊÇͨ¹ývar functionName=function(){...}À´¶¨Ò壩£¬ËüÄܱ»ÌØȨº¯Êýµ÷Ó㨰üÀ¨¶ÔÏóµÄ¹¹Ô캯Êý£©ºÍ˽Óк¯Êýµ÷Óá£
ÌØȨ·½·¨ ͨ¹ýthis.methodName=function(){...}À´ÉùÃ÷¶øÇÒ¿ÉÄܱ»¶ÔÏóÍⲿµÄ´úÂëµ ......

JavaScriptÔËÐдúÂë¿ò´úÂë


JavaScriptÔËÐдúÂë¿ò´úÂë
<script language="JavaScript" type="text/JavaScript">
//ÔËÐÐÎı¾Óò´úÂë
function runEx(cod1) {
cod=document.all(cod1)
var code=cod.value;
if (code!=""){
var newwin=window.open(’’,’’,’’); //´ò¿ªÒ»¸ö´°¿Ú²¢¸³¸ø±äÁ¿newwin¡£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ