﻿<?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-每日E读-随笔分类-JavaScript</title><link>http://www.blogjava.net/hexuzhong/category/14490.html</link><description>HexUzHoNG</description><language>zh-cn</language><lastBuildDate>Wed, 28 Feb 2007 17:16:39 GMT</lastBuildDate><pubDate>Wed, 28 Feb 2007 17:16:39 GMT</pubDate><ttl>60</ttl><item><title>js自动滚屏功能</title><link>http://www.blogjava.net/hexuzhong/archive/2006/08/25/65820.html</link><dc:creator>HexUzHoNG</dc:creator><author>HexUzHoNG</author><pubDate>Fri, 25 Aug 2006 08:10:00 GMT</pubDate><guid>http://www.blogjava.net/hexuzhong/archive/2006/08/25/65820.html</guid><wfw:comment>http://www.blogjava.net/hexuzhong/comments/65820.html</wfw:comment><comments>http://www.blogjava.net/hexuzhong/archive/2006/08/25/65820.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hexuzhong/comments/commentRss/65820.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hexuzhong/services/trackbacks/65820.html</trackback:ping><description><![CDATA[
		<p>最近发现爱上了 <a href="http://oneboy.org/?p=70"><strong>这种</strong></a> js编写方式，现在写了个js自动滚屏功能的东东。网页看文章篇幅较多时，双击自动向下滚屏，点击右键停止滚屏。</p>
		<p>
				<font red="">在线演示：</font>
				<a href="http://oneboy.org/demo/cmp/autoScroll.html" target="_blank">http://oneboy.org/demo/cmp/autoScroll.html</a>
		</p>
		<p>引用方式（导入必要的js文件，添加一DIV，内含ex.impl=”as”属性）：<br /></p>
		<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">
				<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				<span style="COLOR: #000000">&lt;</span>
				<span style="COLOR: #000000">script type</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">text/javascript</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> src</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">./js/prototype-1.4.0.js</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">&gt;&lt;/</span>
				<span style="COLOR: #000000">script</span>
				<span style="COLOR: #000000">&gt;</span>
				<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span>
				<span style="COLOR: #000000">&lt;</span>
				<span style="COLOR: #000000">script type</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">text/javascript</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> src</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">./js/autoscroll.js</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">&gt;&lt;/</span>
				<span style="COLOR: #000000">script</span>
				<span style="COLOR: #000000">&gt;</span>
				<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />  <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span>
				<span style="COLOR: #000000">&lt;</span>
				<span style="COLOR: #000000">div ex.impl</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">as</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> ex.delay</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">50</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">&gt;&lt;/</span>
				<span style="COLOR: #000000">div</span>
				<span style="COLOR: #000000">&gt;</span>
				<span style="COLOR: #000000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				</span>
		</div>
		<p>
				<code>ex.delay</code>属性是可选的，默认值是50毫秒。指定下向滚屏的速度。</p>
		<p>代码请直接看源文件 <img height="19" src="http://www.blogjava.net/Emoticons/regular_smile.gif" width="19" border="0" /></p>
<img src ="http://www.blogjava.net/hexuzhong/aggbug/65820.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hexuzhong/" target="_blank">HexUzHoNG</a> 2006-08-25 16:10 <a href="http://www.blogjava.net/hexuzhong/archive/2006/08/25/65820.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>再来一个js widget，离开数据编辑页面自动提示（不改变原有值不提示）</title><link>http://www.blogjava.net/hexuzhong/archive/2006/08/25/65819.html</link><dc:creator>HexUzHoNG</dc:creator><author>HexUzHoNG</author><pubDate>Fri, 25 Aug 2006 08:08:00 GMT</pubDate><guid>http://www.blogjava.net/hexuzhong/archive/2006/08/25/65819.html</guid><wfw:comment>http://www.blogjava.net/hexuzhong/comments/65819.html</wfw:comment><comments>http://www.blogjava.net/hexuzhong/archive/2006/08/25/65819.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hexuzhong/comments/commentRss/65819.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hexuzhong/services/trackbacks/65819.html</trackback:ping><description><![CDATA[
		<p>网上找到的自动提示功能是不管有没有改变原有数据都提示，不是很人性化。。<br />现在写了个只有在改变了原有数据的情况下才提示数据有改变，是否真的离开此页面的操作。如果没改变就不提示。。</p>
		<p>老规矩，先看demo（页面很丑，发现自已没美术细胞 <img class="wp-smiley" alt=":)" src="http://oneboy.org/wp-includes/images/smilies/icon_smile.gif" /> ）：<a href="http://oneboy.org/demo/cmp/autoPrompt.html" target="_blank">http://oneboy.org/demo/cmp/autoPrompt.html</a></p>
		<p>引用方式（添加必要的js文件，在body中加入ex.impl=”ap”属性，设置一js变量，用来指示当提交表单时不进行数据是否改变校验）<br /><br /></p>
		<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">
				<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000"> 导入必要的js文件 </span>
				<span style="COLOR: #008000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				</span>
				<span style="COLOR: #000000">   </span>
				<span style="COLOR: #000000">&lt;</span>
				<span style="COLOR: #000000">script type</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">text/javascript</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> src</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">./js/prototype-1.4.0.js</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">&gt;&lt;/</span>
				<span style="COLOR: #000000">script</span>
				<span style="COLOR: #000000">&gt;</span>
				<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span>
				<span style="COLOR: #000000">&lt;</span>
				<span style="COLOR: #000000">script type</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">text/javascript</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> src</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">./js/bag.js</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">&gt;&lt;/</span>
				<span style="COLOR: #000000">script</span>
				<span style="COLOR: #000000">&gt;</span>
				<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span>
				<span style="COLOR: #000000">&lt;</span>
				<span style="COLOR: #000000">script type</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">text/javascript</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> src</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">./js/autoprompt.js</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">&gt;&lt;/</span>
				<span style="COLOR: #000000">script</span>
				<span style="COLOR: #000000">&gt;</span>
				<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000"> 设置一js变量，用来指示当提交表单时不进行数据是否改变校验 </span>
				<span style="COLOR: #008000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				</span>
				<span style="COLOR: #000000">    </span>
				<span style="COLOR: #000000">&lt;</span>
				<span style="COLOR: #000000">script type</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">text/javascript</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">&gt;</span>
				<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    window._isSubmit </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #0000ff">false</span>
				<span style="COLOR: #000000">; <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000"> 这个操作只要你在表单提交时调用就行了，我是为form添加&lt;form onsubmit="beforeSubmit()" <img src="http://www.blogjava.net/images/dot.gif" />&gt;实现的 </span>
				<span style="COLOR: #008000">
						<br />
						<img id="Codehighlighter1_444_485_Open_Image" onclick="this.style.display='none'; Codehighlighter1_444_485_Open_Text.style.display='none'; Codehighlighter1_444_485_Closed_Image.style.display='inline'; Codehighlighter1_444_485_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" />
						<img id="Codehighlighter1_444_485_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_444_485_Closed_Text.style.display='none'; Codehighlighter1_444_485_Open_Image.style.display='inline'; Codehighlighter1_444_485_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top" />
				</span>
				<span style="COLOR: #000000">    </span>
				<span style="COLOR: #0000ff">function</span>
				<span style="COLOR: #000000"> beforeSubmit() </span>
				<span id="Codehighlighter1_444_485_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
						<img src="http://www.blogjava.net/images/dot.gif" />
				</span>
				<span id="Codehighlighter1_444_485_Open_Text">
						<span style="COLOR: #000000">{ <br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />        window._isSubmit </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #0000ff">true</span>
						<span style="COLOR: #000000">; <br /><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />    }</span>
				</span>
				<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span>
				<span style="COLOR: #000000">&lt;/</span>
				<span style="COLOR: #000000">script</span>
				<span style="COLOR: #000000">&gt;</span>
				<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />  <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000"> 修改body，为body添中ex.impl="ap"属性 </span>
				<span style="COLOR: #008000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				</span>
				<span style="COLOR: #000000">   </span>
				<span style="COLOR: #000000">&lt;</span>
				<span style="COLOR: #000000">body ex.impl</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">ap</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">&gt;</span>
				<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />  <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000"> 表单提交时改变_isSubmit的值，指示组件当是表单提交时不去校验数据是否改变 </span>
				<span style="COLOR: #008000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				</span>
				<span style="COLOR: #000000">   </span>
				<span style="COLOR: #000000">&lt;</span>
				<span style="COLOR: #000000">form action</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">#</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> onsubmit</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">beforeSubmit()</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">&gt;</span>
				<span style="COLOR: #000000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				</span>
		</div>
		<br />关于代码，如果要源码的话，去demo页面复制，主要想到应该没什么人会去用，就懒得打包放上来了。<img src ="http://www.blogjava.net/hexuzhong/aggbug/65819.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hexuzhong/" target="_blank">HexUzHoNG</a> 2006-08-25 16:08 <a href="http://www.blogjava.net/hexuzhong/archive/2006/08/25/65819.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>