JavaScript Êó±êÍÏק½øÐпìËÙ²úÆ··ÖÀàЧ¹û
´úÂëʾÀý
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>ÎÞ±êÌâÎĵµ</title>
</head>
<mce:style><!--
.man{ float:left; background:#9af; margin:3px; padding:3px; cursor:default}
--></mce:style><style mce_bogus="1">.man{ float:left; background:#9af; margin:3px; padding:3px; cursor:default}</style>
<body>
<div>
δ·ÖÀà
<div style="width:500px; height:30px; border:#69f solid 1px; margin:3px"><input>
<div onmousedown=mdv() class="man">aaa</div>
<div onmousedown=mdv() class="man">bbb</div>
<div onmousedown=mdv() class="man">ccc</div>
</div>
·ÖÀà1£º<div style="width:500px; height:20px; border:#69f solid 1px; margin:3px" ><input></div>
·ÖÀà2£º<div style="width:500px; height:20px; border:#69f solid 1px; margin:3px" ><input></div>
·ÖÀà3£º<div style="width:500px; height:20px; border:#69f solid 1px; margin:3px" ><input></div>
·ÖÀà4£º<div style="width:500px; height:20px; border:#69f solid 1px; margin:3px" ><input></div>
</div>
<div style="width:500px; height:20px; border:#69f solid 1px; margin:3px" ></div>
<input id=tt><a href="">123</a>
<mce:script type="text/javascript"><!--
function getOffset(obj,isLeftOffset)
{
var offsetValue=0;
while(obj!=null)
{
offsetValue+=obj["offset"+(isLeftOffset?"Left":"Top")];
obj=obj.offsetParent
}
return offsetValue
}
function mdv()
{
obj=event.srcElement
obj.style.position="absolute"
if(event.button==2 ||event.button==0) return;
obj.p=obj.parentNode.parentNode.childNodes
obj.nowp=obj.parentNode
obj.nowp.style.background='#faa'
obj.DS_x=25;
obj.DS_y=15;
obj.setCapture();
obj.moving=true;
obj.onmousemove=function()
{
if(event.button==1&obj.moving)
{
var X=obj.style.pix
Ïà¹ØÎĵµ£º
DOMÊÇÕë¶ÔXMLµÄ»ùÓÚÊ÷µÄAPI£¬ËüÓëÓïÑÔÎ޹أ¬ÊµÏÖ·½Ê½ÓкܶàÖÖ£¨¸÷ÓïÑÔ»ù±¾¶¼ÓÐ×Ô¼ºµÄʵÏÖ£©¡£
²»¹ýÎÒÃǾ³£Óõģ¬ÊÇJavaScript ϵÄdomÕë¶ÔxhtmlµÄ²Ù×÷£¬Ö»ÊÇdomµÄÒ»¸ö·ÖÖ§Ó¦Óá£
Ãû´Ê½âÊÍ£º
Dom£ºÎĵµ¶ÔÏóÄ£ÐÍ¡£Document object model
Bom£ºä¯ÀÀÆ÷¶ÔÏóÄ£ÐÍ£¬Ò²¿ÉÒԽд°¿Ú¶ÔÏóÄ£ÐÍ¡££¨window object model.£©
API£ºÓ ......
ʹÓùýajaxµÄ¶¼³£¼ûÕâÑùµÄ´úÂ룺
<a href="javascript:doTest2();void(0);" mce_href="javascript:doTest2();void(0);">here</a>
µ«Õâ¶ùµÄvoid(0)¾¿¾¹ÊǺκ¬ÒåÄØ£¿
JavascriptÖÐvoidÊÇÒ»¸ö²Ù×÷·û£¬¸Ã²Ù×÷·ûÖ¸¶¨Òª¼ÆËãÒ»¸ö±í´ïʽµ«ÊDz»·µ»ØÖµ¡£
void ²Ù×÷·ûÓ÷¨¸ñʽÈçÏ£º
1. javascript:void (expres ......
<a class="bt_3" href="javascript:void(0)" mce_href="javascript:void(0)" id="btnSubmit1" onclick="submitPage()">Ìá½»</a>
submitPage() ÊÇÎÒ¶¨ÒåµÄÒ»¸öº¯Êý£¬ÔÒâÊǵã»÷Õâ¸ö<a>ʱ£¬Ìá½»Ò»¸ö±íµ¥¡£ft, ie6 ¾ÓÈ»²»¿ÉÒÔ£¬ÔõôҲ²»ÄÜÌá½»¡£
¿´À´ÊÇÒòΪ ie6 Ö´ÐÐĬÈ϶¯×÷ÒýÆðÀ´£¬Ä¿Ç°Á½ÖÖ½â¾ö·½·¨£ ......
ÔÚ×Ô¼ºµÄÍøÕ¾ÉϸüÐÂÎÄÕÂʱһ¸ö±È½Ï³£¼ûµÄÎÊÌâÊÇ£ºÎÄÕ²åͼ̫¿í£¬Ê¹Õû¸öÍøÒ³¶¼±äÐÎÁË¡£Èç¹û¶Ôÿ¸ö²åͼ¶¼ÏȽøÐÐËõ·ÅÔÙ²åÈëµÄ»°£¬Ì«Âé·³ÁË¡£
ÎÒÇ°¶Îʱ¼äдµÄһƪÎÄÕ¾ÍÓöµ½¹ýÕâÖÖÊÂÇ飬ºóÀ´ÓÃCSSµÄoverflowºÍmax-widthÊôÐÔÔÝʱ½â¾öÁËÒ³Ãæ±äÐεÄÎÊÌâ¡£ÕâÖÖ·½·¨ºÃ´¦ÊǼòµ¥£¬µ«»µ´¦ÊÇ»áÆÆ»µÄ³Ð©Ï¸½ÚµÄЧ¹û¡£
Èçoverflow£ºhidden ......