﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-临江仙的技术乐园</title><link>http://www.blogjava.net/release2006/</link><description>学而时习之，不亦乐乎</description><language>zh-cn</language><lastBuildDate>Tue, 28 Apr 2026 12:44:52 GMT</lastBuildDate><pubDate>Tue, 28 Apr 2026 12:44:52 GMT</pubDate><ttl>60</ttl><item><title>js数组</title><link>http://www.blogjava.net/release2006/archive/2009/06/04/280091.html</link><dc:creator>临江仙</dc:creator><author>临江仙</author><pubDate>Thu, 04 Jun 2009 14:44:00 GMT</pubDate><guid>http://www.blogjava.net/release2006/archive/2009/06/04/280091.html</guid><wfw:comment>http://www.blogjava.net/release2006/comments/280091.html</wfw:comment><comments>http://www.blogjava.net/release2006/archive/2009/06/04/280091.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/release2006/comments/commentRss/280091.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/release2006/services/trackbacks/280091.html</trackback:ping><description><![CDATA[<div class="cnt" id="blog_text">
<p style="text-indent: 2em"><font color="#ff0000"><strong>1、数组的创建</strong></font></p>
<p style="text-indent: 2em">var arrayObj = new Array();　//创建一个数组</p>
<p style="text-indent: 2em">var arrayObj = new Array([size]);　//创建一个数组并指定长度，注意不是上限，是长度</p>
<p style="text-indent: 2em">var arrayObj = new Array([element0[, element1[, ...[, elementN]]]]);　创建一个数组并赋值</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; 要说明的是，虽然第二种方法创建数组指定了长度，但实际上所有情况下数组都是变长的，也就是说即使指定了长度为5，仍然可以将元素存储在规定长度以外的，注意：这时长度会随之改变。</p>
<p style="text-indent: 2em"><font color="#ff0000"><strong>2、数组的元素的访问</strong></font></p>
<p style="text-indent: 2em">var testGetArrValue=arrayObj[1]; //获取数组的元素值</p>
<p style="text-indent: 2em">arrayObj[1]= "这是新值"; //给数组元素赋予新的值</p>
<p style="text-indent: 2em"><strong><font color="#ff0000">3、数组元素的添加</font></strong></p>
<p style="text-indent: 2em">arrayObj. push([item1 [item2 [. . . [itemN ]]]]);// 将一个或多个新元素添加到数组结尾，并返回数组新长度</p>
<p style="text-indent: 2em">arrayObj.unshift([item1 [item2 [. . . [itemN ]]]]);// 将一个或多个新元素添加到数组开始，数组中的元素自动后移，返回数组新长度</p>
<p style="text-indent: 2em">arrayObj.splice(insertPos,0,[item1[, item2[, . . . [,itemN]]]]);//将一个或多个新元素插入到数组的指定位置，插入位置的元素自动后移，返回""。</p>
<p style="text-indent: 2em"><strong><font color="#ff0000">4、数组元素的删除</font></strong></p>
<p style="text-indent: 2em">arrayObj.pop(); //移除最后一个元素并返回该元素值</p>
<p style="text-indent: 2em">arrayObj.shift(); //移除最前一个元素并返回该元素值，数组中元素自动前移</p>
<p style="text-indent: 2em">arrayObj.splice(deletePos,deleteCount); //删除从指定位置deletePos开始的指定数量deleteCount的元素，数组形式返回所移除的元素</p>
<p style="text-indent: 2em"><strong><font color="#ff0000">5、数组的截取和合并</font></strong></p>
<p style="text-indent: 2em">arrayObj.slice(start, [end]); //以数组的形式返回数组的一部分，注意不包括 end 对应的元素，如果省略 end 将复制 start 之后的所有元素</p>
<p style="text-indent: 2em">arrayObj.concat([item1[, item2[, . . . [,itemN]]]]); //将多个数组（也可以是字符串，或者是数组和字符串的混合）连接为一个数组，返回连接好的新的数组</p>
<p style="text-indent: 2em"><strong><font color="#ff0000">6、数组的拷贝</font></strong></p>
<p style="text-indent: 2em">arrayObj.slice(0); //返回数组的拷贝数组，注意是一个新的数组，不是指向</p>
<p style="text-indent: 2em">arrayObj.concat(); //返回数组的拷贝数组，注意是一个新的数组，不是指向</p>
<p style="text-indent: 2em"><font color="#ff0000"><strong>7、数组元素的排序</strong></font></p>
<p style="text-indent: 2em">arrayObj.reverse(); //反转元素（最前的排到最后、最后的排到最前），返回数组地址</p>
<p style="text-indent: 2em">arrayObj.sort(); //对数组元素排序，返回数组地址</p>
<p style="text-indent: 2em"><strong><font color="#ff0000">8、数组元素的字符串化</font></strong></p>
<p style="text-indent: 2em">arrayObj.join(separator); //返回字符串，这个字符串将数组的每一个元素值连接在一起，中间用 separator 隔开。</p>
<p style="text-indent: 2em">toLocaleString 、toString 、valueOf：可以看作是join的特殊用法，不常用</p>
<p style="text-indent: 2em"></p>
<p style="text-indent: 2em"><strong><font color="#ff0000">二、数组对象的3个属性</font></strong></p>
<p style="text-indent: 2em"><strong><font color="#ff0000">1、length 属性</font></strong></p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; Length属性表示数组的长度，即其中元素的个数。因为数组的索引总是由0开始，所以一个数组的上下限分别是：0和length-1。和其他大多数语言不同的是，JavaScript数组的length属性是可变的，这一点需要特别注意。当length属性被设置得更大时，整个数组的状态事实上不会发生变化，仅仅是length属性变大；当length属性被设置得比原来小时，则原先数组中索引大于或等于length的元素的值全部被丢失。下面是演示改变length属性的例子：</p>
<p style="text-indent: 2em">var arr=[12,23,5,3,25,98,76,54,56,76];</p>
<p style="text-indent: 2em">//定义了一个包含10个数字的数组</p>
<p style="text-indent: 2em">alert(arr.length); //显示数组的长度10</p>
<p style="text-indent: 2em">arr.length=12; //增大数组的长度</p>
<p style="text-indent: 2em">alert(arr.length); //显示数组的长度已经变为12</p>
<p style="text-indent: 2em"></p>
<p style="text-indent: 2em">alert(arr[8]); //显示第9个元素的值，为56</p>
<p style="text-indent: 2em">arr.length=5; //将数组的长度减少到5，索引等于或超过5的元素被丢弃</p>
<p style="text-indent: 2em">alert(arr[8]); //显示第9个元素已经变为"undefined"</p>
<p style="text-indent: 2em">arr.length=10; //将数组长度恢复为10</p>
<p style="text-indent: 2em">alert(arr[8]); //虽然长度被恢复为10，但第9个元素却无法收回，显示"undefined"</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; 由上面的代码我们可以清楚的看到length属性的性质。但length对象不仅可以显式的设置，它也有可能被隐式修改。JavaScript中可以使用一个未声明过的变量，同样，也可以使用一个未定义的数组元素（指索引超过或等于length的元素），这时，length属性的值将被设置为所使用元素索引的值加1。例如下面的代码：</p>
<p style="text-indent: 2em">var arr=[12,23,5,3,25,98,76,54,56,76];</p>
<p style="text-indent: 2em">alert(arr.length);</p>
<p style="text-indent: 2em">arr[15]=34;</p>
<p style="text-indent: 2em">alert(arr.length);</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; 代码中同样是先定义了一个包含10个数字的数组，通过alert语句可以看出其长度为10。随后使用了索引为15的元素，将其赋值为15，即 arr[15]=34，这时再用alert语句输出数组的长度，得到的是16。无论如何，对于习惯于强类型编程的开发人员来说，这是一个很令人惊讶的特性。事实上，使用new Array()形式创建的数组，其初始长度就是为0，正是对其中未定义元素的操作，才使数组的长度发生变化。</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; 由上面的介绍可以看到，length属性是如此的神奇，利用它可以方便的增加或者减少数组的容量。因此对length属性的深入了解，有助于在开发过程中灵活运用。</p>
<p style="text-indent: 2em"><strong><font color="#ff0000">2、prototype 属性</font></strong></p>
<p style="text-indent: 2em">返回对象类型原型的引用。prototype 属性是 object 共有的。</p>
<p style="text-indent: 2em">objectName.prototype</p>
<p style="text-indent: 2em">objectName 参数是object对象的名称。</p>
<p style="text-indent: 2em">说明：用 prototype 属性提供对象的类的一组基本功能。 对象的新实例&#8220;继承&#8221;赋予该对象原型的操作。</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; 对于数组对象，以以下例子说明prototype 属性的用途。</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; 给数组对象添加返回数组中最大元素值的方法。要完成这一点，声明一个函数，将它加入 Array.prototype， 并使用它。</p>
<p style="text-indent: 2em">function array_max( )</p>
<p style="text-indent: 2em">{</p>
<p style="text-indent: 2em">&nbsp;&nbsp; var i, max = this[0];</p>
<p style="text-indent: 2em">&nbsp;&nbsp; for (i = 1; i &lt; this.length; i++)</p>
<p style="text-indent: 2em">&nbsp;&nbsp; {</p>
<p style="text-indent: 2em">&nbsp;&nbsp; if (max &lt; this[i])</p>
<p style="text-indent: 2em">&nbsp;&nbsp; max = this[i];</p>
<p style="text-indent: 2em">&nbsp;&nbsp; }</p>
<p style="text-indent: 2em">&nbsp;&nbsp; return max;</p>
<p style="text-indent: 2em">}</p>
<p style="text-indent: 2em">Array.prototype.max = array_max;</p>
<p style="text-indent: 2em">var x = new Array(1, 2, 3, 4, 5, 6);</p>
<p style="text-indent: 2em">var y = x.max( );</p>
<p style="text-indent: 2em">该代码执行后，y 保存数组 x 中的最大值，或说 6。</p>
<p style="text-indent: 2em"><strong><font color="#ff0000">3、constructor 属性</font></strong></p>
<p style="text-indent: 2em">表示创建对象的函数。</p>
<p style="text-indent: 2em">object.constructor //object是对象或函数的名称。</p>
<p style="text-indent: 2em">说明：constructor 属性是所有具有 prototype 的对象的成员。它们包括除 Global 和 Math 对象以外的所有 JScript 固有对象。constructor 属性保存了对构造特定对象实例的函数的引用。</p>
<p style="text-indent: 2em">例如：</p>
<p style="text-indent: 2em">x = new String("Hi");</p>
<p style="text-indent: 2em">if (x.constructor == String) // 进行处理（条件为真）。</p>
<p style="text-indent: 2em">或</p>
<p style="text-indent: 2em">function MyFunc {</p>
<p style="text-indent: 2em">// 函数体。</p>
<p style="text-indent: 2em">}</p>
<p style="text-indent: 2em">y = new MyFunc;</p>
<p style="text-indent: 2em">if (y.constructor == MyFunc) // 进行处理（条件为真）。</p>
<p style="text-indent: 2em">对于数组来说：</p>
<p style="text-indent: 2em">y = new Array();</p>
</div>
<br />
原文：http://hi.baidu.com/iron0313/blog/item/5c0182dcde1f3ba9cd116600.html
<img src ="http://www.blogjava.net/release2006/aggbug/280091.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/release2006/" target="_blank">临江仙</a> 2009-06-04 22:44 <a href="http://www.blogjava.net/release2006/archive/2009/06/04/280091.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>js:日期正则表达式及检测</title><link>http://www.blogjava.net/release2006/archive/2009/06/04/280089.html</link><dc:creator>临江仙</dc:creator><author>临江仙</author><pubDate>Thu, 04 Jun 2009 14:36:00 GMT</pubDate><guid>http://www.blogjava.net/release2006/archive/2009/06/04/280089.html</guid><wfw:comment>http://www.blogjava.net/release2006/comments/280089.html</wfw:comment><comments>http://www.blogjava.net/release2006/archive/2009/06/04/280089.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/release2006/comments/commentRss/280089.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/release2006/services/trackbacks/280089.html</trackback:ping><description><![CDATA[这是yyyy-mm-dd hh:mm:ss 的 <br />
/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2}):(\d{2}):(\d{2})$/ ; <br />
这是 yyyy-mm-ddde 的 <br />
/^(\d{4})\-(\d{2})\-(\d{2})$/ <br />
function validateCNDate( strValue ) { <br />
var objRegExp = /^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$/ <br />
<br />
if(!objRegExp.test(strValue)) <br />
return false; <br />
else{ <br />
var arrayDate = strValue.split(RegExp.$1); <br />
var intDay = parseInt(arrayDate[2],10); <br />
var intYear = parseInt(arrayDate[0],10); <br />
var intMonth = parseInt(arrayDate[1],10); <br />
if(intMonth &gt; 12 || intMonth &lt; 1) { <br />
return false; <br />
} <br />
var arrayLookup = { '1' : 31,'3' : 31, '4' : 30,'5' : 31,'6' : 30,'7' : 31, <br />
'8' : 31,'9' : 30,'10' : 31,'11' : 30,'12' : 31} <br />
if(arrayLookup[parseInt(arrayDate[1])] != null) { <br />
if(intDay &lt;= arrayLookup[parseInt(arrayDate[1])] &amp;&amp; intDay != 0) <br />
return true; <br />
} <br />
if (intMonth-2 ==0) { <br />
var booLeapYear = (intYear % 4 == 0 &amp;&amp; (intYear % 100 != 0 || intYear % 400 == 0)); <br />
if( ((booLeapYear &amp;&amp; intDay &lt;= 29) || (!booLeapYear &amp;&amp; intDay &lt;=28)) &amp;&amp; intDay !=0) <br />
return true; <br />
} <br />
} <br />
return false; <br />
} <br />
<br />
原文：http://www.jb51.net/article/9232.htm
<img src ="http://www.blogjava.net/release2006/aggbug/280089.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/release2006/" target="_blank">临江仙</a> 2009-06-04 22:36 <a href="http://www.blogjava.net/release2006/archive/2009/06/04/280089.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JS验证大全（收集自互联网）</title><link>http://www.blogjava.net/release2006/archive/2009/06/04/280088.html</link><dc:creator>临江仙</dc:creator><author>临江仙</author><pubDate>Thu, 04 Jun 2009 14:29:00 GMT</pubDate><guid>http://www.blogjava.net/release2006/archive/2009/06/04/280088.html</guid><wfw:comment>http://www.blogjava.net/release2006/comments/280088.html</wfw:comment><comments>http://www.blogjava.net/release2006/archive/2009/06/04/280088.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/release2006/comments/commentRss/280088.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/release2006/services/trackbacks/280088.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: js验证常用正则表达式集锦            &lt;script&gt;            &nbsp;&nbsp; /*************************************************            *************************************************/            Vali...&nbsp;&nbsp;<a href='http://www.blogjava.net/release2006/archive/2009/06/04/280088.html'>阅读全文</a><img src ="http://www.blogjava.net/release2006/aggbug/280088.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/release2006/" target="_blank">临江仙</a> 2009-06-04 22:29 <a href="http://www.blogjava.net/release2006/archive/2009/06/04/280088.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>自动生成POJO和DAO代码</title><link>http://www.blogjava.net/release2006/archive/2008/03/16/186675.html</link><dc:creator>临江仙</dc:creator><author>临江仙</author><pubDate>Sun, 16 Mar 2008 15:53:00 GMT</pubDate><guid>http://www.blogjava.net/release2006/archive/2008/03/16/186675.html</guid><wfw:comment>http://www.blogjava.net/release2006/comments/186675.html</wfw:comment><comments>http://www.blogjava.net/release2006/archive/2008/03/16/186675.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/release2006/comments/commentRss/186675.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/release2006/services/trackbacks/186675.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 其实在《精通Spring》一书里介绍Hibernate的章节里就有介绍如何根据数据库表自动生成POJO和DAO代码。不过我一直都在用MiddleGen-Hibernate来做这个工作，所以没有尝试过书上讲的方法。直到今天被MiddleGen的一个Exception搞得头晕脑胀以后，才最终决定试试新方法。&nbsp;&nbsp;<a href='http://www.blogjava.net/release2006/archive/2008/03/16/186675.html'>阅读全文</a><img src ="http://www.blogjava.net/release2006/aggbug/186675.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/release2006/" target="_blank">临江仙</a> 2008-03-16 23:53 <a href="http://www.blogjava.net/release2006/archive/2008/03/16/186675.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用MiddleGen生成java代码时出现异常的一种解决方法</title><link>http://www.blogjava.net/release2006/archive/2008/03/16/186645.html</link><dc:creator>临江仙</dc:creator><author>临江仙</author><pubDate>Sun, 16 Mar 2008 11:57:00 GMT</pubDate><guid>http://www.blogjava.net/release2006/archive/2008/03/16/186645.html</guid><wfw:comment>http://www.blogjava.net/release2006/comments/186645.html</wfw:comment><comments>http://www.blogjava.net/release2006/archive/2008/03/16/186645.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/release2006/comments/commentRss/186645.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/release2006/services/trackbacks/186645.html</trackback:ping><description><![CDATA[
		<p>使用MiddleGen根据hbm.xml映射文件生成java代码的时候，可能出现如下错误：<br /></p>BUILD FAILED<br />D:\Middlegen-Hibernate-r5\build.xml:219: Caused by:<br />Caused by:<br />java.lang.NoClassDefFoundError: net/sf/hibernate/MappingException<br />        at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.<br />java:145)<br />        at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java<br />:95)<br />        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)<br />        at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)<br />        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces<br />sorImpl.java:25)<br />        at java.lang.reflect.Method.invoke(Method.java:585)<br />        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav<br />a:105)<br />        at org.apache.tools.ant.Task.perform(Task.java:348)<br />        at org.apache.tools.ant.Target.execute(Target.java:357)<br />        at org.apache.tools.ant.Target.performTasks(Target.java:385)<br />        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)<br />        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)<br />        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe<br />cutor.java:41)<br /><br />这主要是因为MiddleGen中导入的Hibernate包和HibernateTools的包版本不一致。目前HibernateTools的版本是2.0的，不支持Hibernate3.0的包。<br />重新使用Hibernate2的包，再执行一次。问题解决。<img src ="http://www.blogjava.net/release2006/aggbug/186645.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/release2006/" target="_blank">临江仙</a> 2008-03-16 19:57 <a href="http://www.blogjava.net/release2006/archive/2008/03/16/186645.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>struts下汉字乱码的一种解决方法</title><link>http://www.blogjava.net/release2006/archive/2007/01/23/95524.html</link><dc:creator>临江仙</dc:creator><author>临江仙</author><pubDate>Tue, 23 Jan 2007 05:39:00 GMT</pubDate><guid>http://www.blogjava.net/release2006/archive/2007/01/23/95524.html</guid><wfw:comment>http://www.blogjava.net/release2006/comments/95524.html</wfw:comment><comments>http://www.blogjava.net/release2006/archive/2007/01/23/95524.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.blogjava.net/release2006/comments/commentRss/95524.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/release2006/services/trackbacks/95524.html</trackback:ping><description><![CDATA[
		<font style="font-size: 12px;">     最近我们在编码的过程中遇到了用request传参数时中文乱码的问题，花费好几天的时间去解决这个问题。好在偶同学功力深厚，最终还是攻克了这个难题。<br />    解决方法很简单：在tomcat目录下的server.xml配置文件中的&lt;Connector&gt;标签中添加属性URIEncoding，令URIEncoding="GBK"。问题解决~</font>
<img src ="http://www.blogjava.net/release2006/aggbug/95524.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/release2006/" target="_blank">临江仙</a> 2007-01-23 13:39 <a href="http://www.blogjava.net/release2006/archive/2007/01/23/95524.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>用回车实现控件间的切换</title><link>http://www.blogjava.net/release2006/archive/2006/11/26/83623.html</link><dc:creator>临江仙</dc:creator><author>临江仙</author><pubDate>Sun, 26 Nov 2006 08:20:00 GMT</pubDate><guid>http://www.blogjava.net/release2006/archive/2006/11/26/83623.html</guid><wfw:comment>http://www.blogjava.net/release2006/comments/83623.html</wfw:comment><comments>http://www.blogjava.net/release2006/archive/2006/11/26/83623.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/release2006/comments/commentRss/83623.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/release2006/services/trackbacks/83623.html</trackback:ping><description><![CDATA[今天尝试着做了一个用JS控制的实现用回车来切换控件的示例，代码如下：<br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #0000ff">&lt;!</span><span style="COLOR: #ff00ff">DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">html</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">head</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">meta </span><span style="COLOR: #ff0000">http-equiv</span><span style="COLOR: #0000ff">="Content-Type"</span><span style="COLOR: #ff0000"> content</span><span style="COLOR: #0000ff">="text/html; charset=UTF-8"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">title</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">用回车实现控件间的切换—示例</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">title</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><br /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">script </span><span style="COLOR: #ff0000">type</span><span style="COLOR: #0000ff">="text/javascript"</span><span style="COLOR: #ff0000"> for</span><span style="COLOR: #0000ff">="document"</span><span style="COLOR: #ff0000"> event</span><span style="COLOR: #0000ff">="onkeydown"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br /></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;!--</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br />  </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">if</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">(event.keyCode </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">==</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">13</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">)<br />     event.keyCode </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">9</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">;<br /></span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">--&gt;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br /></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">script</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">head</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">body</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br />    姓名：</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">input </span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="input1"</span><span style="COLOR: #ff0000"> type</span><span style="COLOR: #0000ff">="text"</span><span style="COLOR: #0000ff">&gt;&lt;</span><span style="COLOR: #800000">br</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br />    年龄：</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">input </span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="input2"</span><span style="COLOR: #ff0000"> type</span><span style="COLOR: #0000ff">="text"</span><span style="COLOR: #0000ff">&gt;&lt;</span><span style="COLOR: #800000">br</span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000"><br />    性别：</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">select </span><span style="COLOR: #ff0000">size</span><span style="COLOR: #0000ff">="1"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br />            </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">option </span><span style="COLOR: #ff0000">value</span><span style="COLOR: #0000ff">="1"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">男</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">option</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br />            </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">option </span><span style="COLOR: #ff0000">value</span><span style="COLOR: #0000ff">="2"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">女</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">option</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br />            </span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">select</span><span style="COLOR: #0000ff">&gt;&lt;</span><span style="COLOR: #800000">br</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br />    籍贯：</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">input </span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="input3"</span><span style="COLOR: #ff0000"> type</span><span style="COLOR: #0000ff">="text"</span><span style="COLOR: #0000ff">&gt;&lt;</span><span style="COLOR: #800000">br</span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000"><br />    是否毕业：</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">input </span><span style="COLOR: #ff0000">type</span><span style="COLOR: #0000ff">="checkbox"</span><span style="COLOR: #ff0000"> name</span><span style="COLOR: #0000ff">="yes"</span><span style="COLOR: #ff0000"> value</span><span style="COLOR: #0000ff">="1"</span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000">是<br />    </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">input </span><span style="COLOR: #ff0000">type</span><span style="COLOR: #0000ff">="checkbox"</span><span style="COLOR: #ff0000"> name</span><span style="COLOR: #0000ff">="yes"</span><span style="COLOR: #ff0000"> value</span><span style="COLOR: #0000ff">="1"</span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000">否</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">br</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br />    毕业院校: </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">input </span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="input4"</span><span style="COLOR: #ff0000"> type</span><span style="COLOR: #0000ff">="text"</span><span style="COLOR: #0000ff">&gt;&lt;</span><span style="COLOR: #800000">br</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br />    </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">br</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">body</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">html</span><span style="COLOR: #0000ff">&gt;</span></div><br /><br /><img src ="http://www.blogjava.net/release2006/aggbug/83623.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/release2006/" target="_blank">临江仙</a> 2006-11-26 16:20 <a href="http://www.blogjava.net/release2006/archive/2006/11/26/83623.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>AJAX征路1 最简单的浮动框示例</title><link>http://www.blogjava.net/release2006/archive/2006/11/26/83543.html</link><dc:creator>临江仙</dc:creator><author>临江仙</author><pubDate>Sat, 25 Nov 2006 16:18:00 GMT</pubDate><guid>http://www.blogjava.net/release2006/archive/2006/11/26/83543.html</guid><wfw:comment>http://www.blogjava.net/release2006/comments/83543.html</wfw:comment><comments>http://www.blogjava.net/release2006/archive/2006/11/26/83543.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.blogjava.net/release2006/comments/commentRss/83543.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/release2006/services/trackbacks/83543.html</trackback:ping><description><![CDATA[以下代码演示如何使用JS实现浮动框效果。不过太简单了，大家可不要砸鸡蛋哦～ <br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><span style="color: rgb(0, 0, 255);">&lt;!</span><span style="color: rgb(255, 0, 255);">DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">html</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">head</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">meta </span><span style="color: rgb(255, 0, 0);">http-equiv</span><span style="color: rgb(0, 0, 255);">="Content-Type"</span><span style="color: rgb(255, 0, 0);"> content</span><span style="color: rgb(0, 0, 255);">="text/html; charset=UTF-8"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">title</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Insert title here</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">title</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">style </span><span style="color: rgb(255, 0, 0);">type</span><span style="color: rgb(0, 0, 255);">="text/css"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(128, 0, 0); background-color: rgb(245, 245, 245);"><br />        .Parent </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">{</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"><br />            position</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">absolute</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"><br />            height</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">150px</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"> width</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">200px</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"><br />            top</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">0px</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"> left</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">0px</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"><br />            border</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">1px solid #123456</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"><br />            BACKGROUND-COLOR</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);"> #bbbbbb<br />        </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">}</span><span style="color: rgb(128, 0, 0); background-color: rgb(245, 245, 245);"><br />        .Header </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">{</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"><br />            margin</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">2px</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"><br />              padding</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">2px</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"><br />              width</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">194px</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"><br />             color</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">white</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"><br />             background-color</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">navy</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"><br />             font-family</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">宋体</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"><br />              font-size</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">12px</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"><br />        </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">}</span><span style="color: rgb(128, 0, 0); background-color: rgb(245, 245, 245);"><br />        .Content </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">{</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"><br />            color</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">black</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"><br />            font-family</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">宋体</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"><br />            font-size</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">12px</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"><br />        </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">}</span><span style="color: rgb(128, 0, 0); background-color: rgb(245, 245, 245);"><br />    </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">style</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">  <br /><br />    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">script </span><span style="color: rgb(255, 0, 0);">type</span><span style="color: rgb(0, 0, 255);">="text/javascript"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"><br />        </span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">var</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> dx </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">0</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;<br />        </span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">var</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> dy </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">0</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;<br />        </span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">var</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> x </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">0</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;<br />        </span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">var</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> y </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">0</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;<br />        </span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">var</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> isMouseDown </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> </span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">false</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;<br />        </span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">var</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> idNumPre </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">-</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">1</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;<br />        </span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">var</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> root;<br />        <br />        </span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">function</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> mouseMove(idNum) {<br />            </span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">if</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> (isMouseDown) {<br />                </span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">if</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> (idNumPre </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">!=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> idNum) {<br />                    root </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> document.getElementById(</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">Parent</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">+</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> idNum);<br />                    idNumPre </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> idNum;<br />                }<br />                root.style.top </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> event.clientY </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">-</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> dy </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">+</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">px</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;    <br />                root.style.left </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> event.clientX </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">-</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> dx </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">+</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">px</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;<br />                y </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> event.clientY </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">-</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> dy;<br />                x </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> event.clientX </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">-</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> dx;<br />            }<br />        }<br />        <br />        </span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">function</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> mouseDown(idNum) {<br />            dx </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> event.clientX </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">-</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> x;<br />            dy </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> event.clientY </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">-</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> y;<br />            isMouseDown </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> </span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">true</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;<br />        }<br />        <br />        </span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">function</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> mouseUp(idNum) {<br />            isMouseDown </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> </span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">false</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;<br />        }<br />    <br />        </span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">function</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> mouseOut(idNum) {<br />            isMouseDown </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> </span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">false</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;<br />        }<br />    </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">script</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">head</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">body</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">div </span><span style="color: rgb(255, 0, 0);">id </span><span style="color: rgb(0, 0, 255);">= "Parent1"</span><span style="color: rgb(255, 0, 0);"> class</span><span style="color: rgb(0, 0, 255);">='Parent'</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">div </span><span style="color: rgb(255, 0, 0);">id </span><span style="color: rgb(0, 0, 255);">= "header1"</span><span style="color: rgb(255, 0, 0);"> class</span><span style="color: rgb(0, 0, 255);">="Header"</span><span style="color: rgb(255, 0, 0);"> onmouseup</span><span style="color: rgb(0, 0, 255);">="mouseUp('1');"</span><span style="color: rgb(255, 0, 0);"><br />        onmousemove</span><span style="color: rgb(0, 0, 255);">="mouseMove('1');"</span><span style="color: rgb(255, 0, 0);"> onmousedown</span><span style="color: rgb(0, 0, 255);">="mouseDown('1');"</span><span style="color: rgb(255, 0, 0);"><br />        onmouseOut</span><span style="color: rgb(0, 0, 255);">="mouseOut('1');"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">浮动框示例<br />     </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">div</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">div </span><span style="color: rgb(255, 0, 0);">id </span><span style="color: rgb(0, 0, 255);">= "content1"</span><span style="color: rgb(255, 0, 0);"> class</span><span style="color: rgb(0, 0, 255);">="Content"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">release2006@163.com</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">div</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">div</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">body</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">html</span><span style="color: rgb(0, 0, 255);">&gt;</span></div><img src ="http://www.blogjava.net/release2006/aggbug/83543.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/release2006/" target="_blank">临江仙</a> 2006-11-26 00:18 <a href="http://www.blogjava.net/release2006/archive/2006/11/26/83543.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>