<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>EragonJ - A humble navigator &#187; Javascript</title>
	<atom:link href="http://eragonj.hax4.in/blog/category/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://eragonj.hax4.in/blog</link>
	<description></description>
	<lastBuildDate>Thu, 05 Jan 2012 12:33:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>[Javascript] Solve conflicts when using jQuery blockUI and datepicker</title>
		<link>http://eragonj.hax4.in/blog/javascript-solve-conflicts-when-using-jquery-blockui-and-datepicker.html</link>
		<comments>http://eragonj.hax4.in/blog/javascript-solve-conflicts-when-using-jquery-blockui-and-datepicker.html#comments</comments>
		<pubDate>Fri, 01 Jul 2011 14:10:50 +0000</pubDate>
		<dc:creator>EragonJ</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[blockUI]]></category>
		<category><![CDATA[conflict]]></category>
		<category><![CDATA[datepicker]]></category>
		<category><![CDATA[dropdown]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://eragonj.hax4.in/?p=1065</guid>
		<description><![CDATA[Tweet Image Credit 最近在開發專案的時候，因為大量用到 blockUI 及 datepicker，所以好死不死終於遇到了一個很神奇的 bug，這個 bug 會發生在你使用 modal dialog ，而該 dialog 內還包含一個 datepicker 的元素，這樣就會造成那個 datepicker 在選取年、月的下拉式選單（dropdown）時無法觸發。 但是這個很怪，沒有道理 DOM 都是正確的（年、月的 option 數目都是對的）但是卻打不開 dropdown，不過當我設定 option 內的 showOverlay 為 true 的時候，一切都正常了，因此判斷一切都和那個 showOverlay 的參數有關，所以去 Trace 了blockUI 的 source code ，最後終於發現了問題所在 &#8230; 原來在 blockUI 運行的過程中，有這麼一段程式碼會綁定 mousedown / mouseup / keydown / keypress 的事件，這樣就會使得 datepicker 的點擊行為無法發生，這就是為什麼會有這個 bug 的出現。 [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Feragonj.hax4.in%2Fblog%2Fjavascript-solve-conflicts-when-using-jquery-blockui-and-datepicker.html&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://eragonj.hax4.in/blog/javascript-solve-conflicts-when-using-jquery-blockui-and-datepicker.html"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://eragonj.hax4.in/blog/javascript-solve-conflicts-when-using-jquery-blockui-and-datepicker.html"  data-text="[Javascript] Solve conflicts when using jQuery blockUI and datepicker" data-count="horizontal" data-via="EragonJ">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p align="right"><a href="http://welcometorsicom.provisiondata.net/blog/wp-content/uploads/2009/01/bug11.jpg" target="_blank">Image Credit</a></p>
<p><img src="http://eragonj.hax4.in/blog/wp-content/uploads/2011/07/bug.jpeg" alt="" title="bug" width="400" height="300" class="aligncenter size-full wp-image-1069" /></p>
<p>最近在開發專案的時候，因為大量用到 blockUI 及 datepicker，所以好死不死終於遇到了<a href="http://phorum.study-area.org/index.php?topic=60151.0;" target="_blank">一個很神奇的 bug</a>，這個 bug 會發生在你使用 <a href="http://jquery.malsup.com/block/#dialog">modal dialog</a> ，而該 dialog 內還包含一個 datepicker 的元素，這樣就會造成那個 datepicker 在選取年、月的下拉式選單（dropdown）時無法觸發。</p>
<p align="center"><img src="http://eragonj.hax4.in/blog/wp-content/uploads/2011/07/blockUI.png" alt="" title="blockUI" width="373" height="325" class="aligncenter size-full wp-image-1066" /></p>
<p>但是這個很怪，沒有道理 DOM 都是正確的（年、月的 option 數目都是對的）但是卻打不開 dropdown，不過當我設定 option 內的 showOverlay 為 true 的時候，一切都正常了，因此判斷一切都和那個 showOverlay 的參數有關，所以去 Trace 了blockUI 的 source code ，最後終於發現了問題所在 &#8230;</p>
<p><script src="https://gist.github.com/1058564.js?file=gistfile1.js"></script></p>
<p>原來在 blockUI 運行的過程中，有這麼一段程式碼會綁定 mousedown / mouseup / keydown / keypress 的事件，這樣就會使得 datepicker 的點擊行為無法發生，這就是為什麼會有這個 bug 的出現。</p>
<p>所以目前比較好的做法，一個是設定 <span style="color: red;">showOverlay : false</span> （這會拿掉漸層背景，不過這通常都不會是我們想要的解法），另一個就是設定 <span style="color: red;">bindEvents : false</span> （讓 blockUI 不要 suppress 我們的點擊 event ），這樣就可以解決這個問題了。</p>
]]></content:encoded>
			<wfw:commentRss>http://eragonj.hax4.in/blog/javascript-solve-conflicts-when-using-jquery-blockui-and-datepicker.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[JS] Facebook Blocker</title>
		<link>http://eragonj.hax4.in/blog/js-facebook-blocker.html</link>
		<comments>http://eragonj.hax4.in/blog/js-facebook-blocker.html#comments</comments>
		<pubDate>Sun, 13 Mar 2011 10:34:40 +0000</pubDate>
		<dc:creator>EragonJ</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Extension]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Facebook Blocker]]></category>

		<guid isPermaLink="false">http://eragonj.hax4.in/?p=925</guid>
		<description><![CDATA[Tweet 應該有很多人像我一樣已經厭倦了 Facebook 上面一堆無聊的心理測驗或是騙人氣的按讚論壇，所以身為 Chrome 的愛好者及 Javascript 的初心者，我就為 Chrome 寫了一個小小的擴充功能，名為「Facebook Blocker」。 Facebook Blocker 可以讓你設定自己的「樣式」，然後它會自動在你下次進入 Facebook 的時候讀取樣式並分析當下的頁面，凡是符合該「樣式」的訊息就會自動被隱藏起來，讓你以後再也不用看到那些惱人的廣告。 其實如果你上 Chrome Extensions 看的話，已經有很多名為 「Facebook Blocker」的 Extension 了，但是經過一陣搜尋之後，發現那些 Extension 大多和我想要做的事情都不太一樣，不是太過痴肥要不然就是功能不同，讓我久久不能自己。 所以經過幾天的研究之後，已經寫好了 Facebook Blocker 的雛型了，而且基本的 Hot Key 也在剛剛 1.0.2 版的時候新增上去了。心中還有很多有趣的功能還沒實作，雖然 UI 也有點難看，不過至少在使用上沒有太大的問題，總要留些東西放在後面更新，才不會有人說我在打混（好的不學都在學這個 &#8230;） 如果有什麼想要增加的功能或是意見都可以留言給我（在這或是在 Extension 的頁面都可以），我會一一回覆的。 Enjoy blocking δ Facebook Blocker 在 Chrome Extension 上的載點與步設定步驟的教學圖]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Feragonj.hax4.in%2Fblog%2Fjs-facebook-blocker.html&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://eragonj.hax4.in/blog/js-facebook-blocker.html"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://eragonj.hax4.in/blog/js-facebook-blocker.html"  data-text="[JS] Facebook Blocker" data-count="horizontal" data-via="EragonJ">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p><a href="http://eragonj.hax4.in/blog/wp-content/uploads/2011/03/FacebookBlocker.png"><img src="http://eragonj.hax4.in/blog/wp-content/uploads/2011/03/FacebookBlocker.png" alt="" title="FacebookBlocker" width="400" height="320" class="aligncenter size-full wp-image-926" /></a></p>
<p>應該有很多人像我一樣已經厭倦了 Facebook 上面一堆無聊的心理測驗或是騙人氣的按讚論壇，所以身為 Chrome 的愛好者及 Javascript 的初心者，我就為 Chrome 寫了一個小小的擴充功能，名為「Facebook Blocker」。</p>
<p>Facebook Blocker 可以讓你設定自己的「樣式」，然後它會自動在你下次進入 Facebook 的時候讀取樣式並分析當下的頁面，凡是符合該「樣式」的訊息就會自動被隱藏起來，讓你以後再也不用看到那些惱人的廣告。</p>
<p>其實如果你上 Chrome Extensions 看的話，已經有很多名為 「Facebook Blocker」的 Extension 了，但是經過一陣搜尋之後，發現那些 Extension 大多和我想要做的事情都不太一樣，不是太過痴肥要不然就是功能不同，讓我久久不能自己。</p>
<p>所以經過幾天的研究之後，已經寫好了 Facebook Blocker 的雛型了，而且基本的 Hot Key 也在剛剛 1.0.2 版的時候新增上去了。心中還有很多有趣的功能還沒實作，雖然 UI 也有點難看，不過至少在使用上沒有太大的問題，總要留些東西放在後面更新，才不會有人說我在打混（好的不學都在學這個 &#8230;）</p>
<p>如果有什麼想要增加的功能或是意見都可以留言給我（在這或是在 Extension 的頁面都可以），我會一一回覆的。</p>
<p>Enjoy blocking <img src='http://eragonj.hax4.in/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>δ <a href="https://chrome.google.com/extensions/detail/ieohahnnccniajelojoanhpfppgincod?hl=zh_tw" target="_blank">Facebook Blocker 在 Chrome Extension 上的載點與步設定步驟的教學圖</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://eragonj.hax4.in/blog/js-facebook-blocker.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[JS] plurkable &#8211; lightweight jQuery plugin for your own Plurk widget</title>
		<link>http://eragonj.hax4.in/blog/js-plurkable-lightweight-jquery-plugin-for-your-own-plurk-widget.html</link>
		<comments>http://eragonj.hax4.in/blog/js-plurkable-lightweight-jquery-plugin-for-your-own-plurk-widget.html#comments</comments>
		<pubDate>Mon, 07 Feb 2011 17:09:14 +0000</pubDate>
		<dc:creator>EragonJ</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[plurk]]></category>
		<category><![CDATA[plurkable]]></category>

		<guid isPermaLink="false">http://eragonj.hax4.in/?p=852</guid>
		<description><![CDATA[Tweet Demo、載點與解說 好吧，我真的是過年太無聊才在那邊用 Javascript 寫一個輕量級的 plugin 讓你可以客制化自己的 widget，其實使用方式在 github 及 demo page 上面都寫的很詳細了，這邊就不多談（或是參考下面的 js code）。 現在開始愈來愈覺得 javascript 非常的 powerful，只要有 browser 就可以跟著老師帶你上天堂，也不用做什麼煩雜的設定，再加上自身對 JSON 格式的 support 及 browser 間內建的 functions 就可以很輕易的完成自己的需求，然後現在這幾年又出現了改變世界的 jQuery，更是把入門的門檻拉低了許多（至少解決了很多問題，雖然也產生了一些問題 xD），不過愈是如此，Javascript 就愈讓人覺得深不可測 &#8230; 而且現在又有許多好用的工具像是 PhoneGap 可以幫助我們來實作 mobile applications，而之後也會有許多的 desktop applications 可以用 Javascript 來實作，整個就是拉近了平台間的距離了呀。 ㄜ &#8230; 這篇應該是要介紹 plurkable ，但是我好像一直離題呀 &#8230; 管他的 xD ~ 祝大家新年快樂啦（????）]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Feragonj.hax4.in%2Fblog%2Fjs-plurkable-lightweight-jquery-plugin-for-your-own-plurk-widget.html&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://eragonj.hax4.in/blog/js-plurkable-lightweight-jquery-plugin-for-your-own-plurk-widget.html"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://eragonj.hax4.in/blog/js-plurkable-lightweight-jquery-plugin-for-your-own-plurk-widget.html"  data-text="[JS] plurkable &#8211; lightweight jQuery plugin for your own Plurk widget" data-count="horizontal" data-via="EragonJ">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p align="center"><a href="https://github.com/EragonJ/plurkable/raw/master/snap/plurkable.png"><img width="679px" height="400px" src="https://github.com/EragonJ/plurkable/raw/master/snap/plurkable.png" alt=""/></a></p>
<p align="right"><a href="http://eragonj.hax4.in/toys/Plurkable/demo.html">Demo</a>、<a href="https://github.com/EragonJ/plurkable">載點與解說</a></p>
<p>好吧，我真的是過年太無聊才在那邊用 Javascript 寫一個輕量級的 plugin 讓你可以客制化自己的 widget，其實使用方式在 github 及 demo page 上面都寫的很詳細了，這邊就不多談（或是參考下面的 js code）。<br />
<script src="https://gist.github.com/814690.js?file=gistfile1.js"></script></p>
<p>現在開始愈來愈覺得 javascript 非常的 powerful，只要有 browser 就可以跟著老師帶你上天堂，也不用做什麼煩雜的設定，再加上自身對 JSON 格式的 support 及 browser 間內建的 functions 就可以很輕易的完成自己的需求，然後現在這幾年又出現了改變世界的 jQuery，更是把入門的門檻拉低了許多（至少解決了很多問題，雖然也產生了一些問題 xD），不過愈是如此，Javascript 就愈讓人覺得深不可測 &#8230;</p>
<p>而且現在又有許多好用的工具像是 <a href="http://www.phonegap.com/">PhoneGap</a> 可以幫助我們來實作 mobile applications，而之後也會有許多的 desktop applications 可以用 Javascript 來實作，整個就是拉近了平台間的距離了呀。 </p>
<p>ㄜ &#8230; 這篇應該是要介紹 plurkable ，但是我好像一直離題呀 &#8230; 管他的 xD ~ 祝大家新年快樂啦（????）</p>
]]></content:encoded>
			<wfw:commentRss>http://eragonj.hax4.in/blog/js-plurkable-lightweight-jquery-plugin-for-your-own-plurk-widget.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>[Note] Useful tools for F2E</title>
		<link>http://eragonj.hax4.in/blog/note-useful-tools-for-f2e.html</link>
		<comments>http://eragonj.hax4.in/blog/note-useful-tools-for-f2e.html#comments</comments>
		<pubDate>Wed, 26 Jan 2011 09:48:29 +0000</pubDate>
		<dc:creator>EragonJ</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[F2E]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[note]]></category>
		<category><![CDATA[obfuscator]]></category>

		<guid isPermaLink="false">http://eragonj.hax4.in/?p=810</guid>
		<description><![CDATA[Tweet 這篇用來整理一下與 F2E 相關的 tool，以供日後參考用（持續更新）： Javscript &#124; CSS Compressor（壓縮器） YUI compressor 好用的 YUI compressor ，支援 JS &#124; CSS 的壓縮，使用說明、載點 Obfuscator（混淆器） jjencode 可自訂混淆用變數且極度複雜，使用說明+載點 aaencode 和上者類似，不過是以表情符號來做混淆，使用說明+載點 Test（測試） Qunit Javascript 單元測試的 Framework，適用於 jQuery plugin，使用說明、載點]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Feragonj.hax4.in%2Fblog%2Fnote-useful-tools-for-f2e.html&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://eragonj.hax4.in/blog/note-useful-tools-for-f2e.html"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://eragonj.hax4.in/blog/note-useful-tools-for-f2e.html"  data-text="[Note] Useful tools for F2E" data-count="horizontal" data-via="EragonJ">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>這篇用來整理一下與 F2E 相關的 tool，以供日後參考用（持續更新）：</p>
<h1>Javscript | CSS Compressor（壓縮器）</h1>
<ul>
<li>YUI compressor</li>
<li style="list-style-type:none;">
<blockquote><p>好用的 YUI compressor ，支援 JS | CSS 的壓縮，<a href="http://developer.yahoo.com/yui/compressor/#using">使用說明</a>、<a href="http://yuilibrary.com/downloads/#yuicompressor">載點</a></p></blockquote>
</li>
</ul>
<h1>Obfuscator（混淆器）</h1>
<ul>
<li>jjencode</li>
<li style="list-style-type:none;">
<blockquote><p>可自訂混淆用變數且極度複雜，<a href="http://utf-8.jp/public/jjencode.html">使用說明+載點</a></p></blockquote>
</li>
<li>aaencode</li>
<li style="list-style-type:none;">
<blockquote><p>和上者類似，不過是以表情符號來做混淆，<a href="http://utf-8.jp/public/aaencode.html">使用說明+載點</a></p></blockquote>
</li>
</ul>
<h1>Test（測試）</h1>
<ul>
<li>Qunit</li>
<li style="list-style-type:none;">
<blockquote><p>Javascript 單元測試的 Framework，適用於 jQuery plugin，<a href="http://docs.jquery.com/Qunit">使用說明</a>、<a href="https://github.com/jquery/qunit">載點</a> </p></blockquote>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://eragonj.hax4.in/blog/note-useful-tools-for-f2e.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Notes] Interesting animation in jQuery</title>
		<link>http://eragonj.hax4.in/blog/notes-interesting-animation-in-jquery.html</link>
		<comments>http://eragonj.hax4.in/blog/notes-interesting-animation-in-jquery.html#comments</comments>
		<pubDate>Tue, 28 Dec 2010 17:29:57 +0000</pubDate>
		<dc:creator>EragonJ</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[banner scrolling]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[tzangms]]></category>
		<category><![CDATA[捲動]]></category>

		<guid isPermaLink="false">http://eragonj.hax4.in/?p=745</guid>
		<description><![CDATA[Tweet 剛剛意外再次看到tzangms的部落格，沒想到已經過了幾年的時間了！因為這段日子對javascript開始有了一些研究，所以對它的Banner scrolling 的特效很感興趣，就順手研究了一下它的 js code，沒想到這麼簡單就能做到，不知道該說 jQuery 太厲害了，還是想到這種實作方法的人太聰明呢:P 上面這張是他網站的截圖，光是版面的配置以及使用的自製圖案來看，其實就看得出小巧精美的一面，不過今天的重點是那個Banner，我對於他可以做到捲動的效果感到很好奇，而實際做法其實也就是想像中這麼容易，只是他利用了一個CSS background-position的特性，原來當div的background設定成無限延展的時候（預設），就可以利用把position拉到無限遠的地方並搭配 Timer（jQuery可以用animate）設定好一個時間差，然後讓頁面在這個時間內一直偏移position的值來完成捲動的特效。 最後附上測試用程式碼，而圖檔的部分則是以tzangms的banner為例。]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Feragonj.hax4.in%2Fblog%2Fnotes-interesting-animation-in-jquery.html&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://eragonj.hax4.in/blog/notes-interesting-animation-in-jquery.html"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://eragonj.hax4.in/blog/notes-interesting-animation-in-jquery.html"  data-text="[Notes] Interesting animation in jQuery" data-count="horizontal" data-via="EragonJ">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>剛剛意外再次看到tzangms的部落格，沒想到已經過了幾年的時間了！因為這段日子對javascript開始有了一些研究，所以對它的Banner scrolling 的特效很感興趣，就順手研究了一下它的 js code，沒想到這麼簡單就能做到，不知道該說 jQuery 太厲害了，還是想到這種實作方法的人太聰明呢:P</p>
<p><a href="http://eragonj.hax4.in/blog/wp-content/uploads/2010/12/tzangms.png"><img src="http://eragonj.hax4.in/blog/wp-content/uploads/2010/12/tzangms-300x176.png" alt="" title="tzangms" width="300" height="176" class="aligncenter size-medium wp-image-746" /></a></p>
<p>上面這張是他網站的截圖，光是版面的配置以及使用的自製圖案來看，其實就看得出小巧精美的一面，不過今天的重點是那個Banner，我對於他可以做到捲動的效果感到很好奇，而實際做法其實也就是想像中這麼容易，只是他利用了一個CSS background-position的特性，原來當div的background設定成無限延展的時候（預設），就可以利用把position拉到無限遠的地方並搭配 Timer（jQuery可以用animate）設定好一個時間差，然後讓頁面在這個時間內一直偏移position的值來完成捲動的特效。</p>
<p>最後附上測試用程式碼，而圖檔的部分則是以tzangms的banner為例。<br />
<script src="https://gist.github.com/757436.js?file=gistfile1.html"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://eragonj.hax4.in/blog/notes-interesting-animation-in-jquery.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[JS] jquery.zoomImg.js 1.0</title>
		<link>http://eragonj.hax4.in/blog/js-jquery-zoomimg-js-1-0.html</link>
		<comments>http://eragonj.hax4.in/blog/js-jquery-zoomimg-js-1-0.html#comments</comments>
		<pubDate>Sun, 15 Aug 2010 14:36:44 +0000</pubDate>
		<dc:creator>EragonJ</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[1.0]]></category>
		<category><![CDATA[1.4.2]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery.zoomImg.js]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[zoomImg]]></category>
		<category><![CDATA[自由軟體]]></category>

		<guid isPermaLink="false">http://eragonj.hax4.in/?p=489</guid>
		<description><![CDATA[Tweet 原本我一直不認為Javascript是一個很特別的Script Language，但是直到最近因為工作的因素所以逼不得以要去維護相關的Javascript的程式，結果沒想到Javascript竟然是如此的博大精深，甚至目前的Desktop application或是 Mobile application都開始使用Javascript來做開發。 直到最近剛結束的Coscup，我想效法一些朋友對自由軟體的態度來激勵自己，一來可以為這個世界盡一份心力，二來也可以訓練自己的能力，就當打怪練功吧:P 這個jquery.zoomImg.js 1.0是因為想要先寫好放著，等之後要做Blog的Image特效時使用的XD，不過既然有這個想法，那就打鐵趁熱，先把基本的功能刻出來，以後再做整理並加強功能吧。 這個plugin是在jquery-1.4.2.min.js的環境下開發的，不過我並沒有用到1.4才特有的一些寫法，所以應該在1.3也還能夠使用。jquery.zoomImg.js In Github]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Feragonj.hax4.in%2Fblog%2Fjs-jquery-zoomimg-js-1-0.html&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://eragonj.hax4.in/blog/js-jquery-zoomimg-js-1-0.html"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://eragonj.hax4.in/blog/js-jquery-zoomimg-js-1-0.html"  data-text="[JS] jquery.zoomImg.js 1.0" data-count="horizontal" data-via="EragonJ">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>原本我一直不認為Javascript是一個很特別的Script Language，但是直到最近因為工作的因素所以逼不得以要去維護相關的Javascript的程式，結果沒想到Javascript竟然是如此的博大精深，甚至目前的Desktop application或是 Mobile application都開始使用Javascript來做開發。</p>
<p>直到最近剛結束的Coscup，我想效法一些朋友對自由軟體的態度來激勵自己，一來可以為這個世界盡一份心力，二來也可以訓練自己的能力，就當打怪練功吧:P</p>
<p>這個jquery.zoomImg.js 1.0是因為想要先寫好放著，等之後要做Blog的Image特效時使用的XD，不過既然有這個想法，那就打鐵趁熱，先把基本的功能刻出來，以後再做整理並加強功能吧。</p>
<p>這個plugin是在jquery-1.4.2.min.js的環境下開發的，不過我並沒有用到1.4才特有的一些寫法，所以應該在1.3也還能夠使用。<a href="http://github.com/EragonJ/zoomImg">jquery.zoomImg.js In Github</a></p>
<p><a href="http://eragonj.hax4.in/blog/wp-content/uploads/2010/08/demo1.png"><img src="http://eragonj.hax4.in/blog/wp-content/uploads/2010/08/demo1-1024x602.png" alt="" title="demo1" width="512" height="301" class="aligncenter size-large wp-image-490" /></a></p>
<p><a href="http://eragonj.hax4.in/blog/wp-content/uploads/2010/08/demo2.png"><img src="http://eragonj.hax4.in/blog/wp-content/uploads/2010/08/demo2-1024x602.png" alt="" title="demo2" width="512" height="301" class="aligncenter size-medium wp-image-494" /></a></p>
<p><a href="http://eragonj.hax4.in/blog/wp-content/uploads/2010/08/demo3.png"><img src="http://eragonj.hax4.in/blog/wp-content/uploads/2010/08/demo3-1024x602.png" alt="" title="demo3" width="512" height="301" class="aligncenter size-medium wp-image-495" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://eragonj.hax4.in/blog/js-jquery-zoomimg-js-1-0.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[JS] jQuery.css() problem when using Firefox</title>
		<link>http://eragonj.hax4.in/blog/js-jquery-css-problem-when-using-firefox.html</link>
		<comments>http://eragonj.hax4.in/blog/js-jquery-css-problem-when-using-firefox.html#comments</comments>
		<pubDate>Wed, 11 Aug 2010 11:14:58 +0000</pubDate>
		<dc:creator>EragonJ</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[left]]></category>
		<category><![CDATA[top]]></category>
		<category><![CDATA[visibility]]></category>

		<guid isPermaLink="false">http://eragonj.hax4.in/?p=476</guid>
		<description><![CDATA[Tweet 最近在公司開發JS的程式的時候，很多時候都會利用到快速又方便的jQuery Library，而這次就很剛好的遇到了Bug，花了很多時間才解出來，以下為測試環境（FF 3.59 , 3.6 ）： 假設我現在有一個DOM的元素，是一個img，當我設定其CSS為「display:none;」時，在FF上就會沒辦法利用 「jQuery.css(&#8216;left&#8217;) or jQuery.css(&#8216;top&#8217;)」來把這個值取出。就算你已經設定好left或是top的值，都只會抓到0px。 範例程式碼： 所以為了要解決在元素被hidden時不能取值的問題，就只能用比較髒的手段來抓到這個值，就是利用「visibility」。 什麼是visibility？它和display不同的地方在於說，display:none會直接不顯示這個元素並不佔用空間；而visibilty:hidden則是不顯示這個元素但是卻仍存在並佔用空間。 所以這個很Tricky的方法可以參考下面： 這樣就可以成功的取到left的值（top亦同）而不會影響UI的部分了，算是這次遇到最無言的Bug吧。 下次見囉。 δ 2011/01/20： 又開始繼續維護這個專案，其實對 FF 3.6.8 來說（不確定其他版本是否也會有相同問題），就算是最新版本的 jQuery 1.4.* 都無法從 display:none 的元素中利用 .css() 來取得特定的屬性值，因此我利用 jsfiddle 寫了一組完整測試，包含 display:none 及 visibility:hidden 元素的各種可能，請自己用你的瀏覽器來測試一下吧。]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Feragonj.hax4.in%2Fblog%2Fjs-jquery-css-problem-when-using-firefox.html&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://eragonj.hax4.in/blog/js-jquery-css-problem-when-using-firefox.html"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://eragonj.hax4.in/blog/js-jquery-css-problem-when-using-firefox.html"  data-text="[JS] jQuery.css() problem when using Firefox" data-count="horizontal" data-via="EragonJ">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>最近在公司開發JS的程式的時候，很多時候都會利用到快速又方便的jQuery Library，而這次就很剛好的遇到了Bug，花了很多時間才解出來，以下為測試環境（FF 3.59 , 3.6 ）：</p>
<p>假設我現在有一個DOM的元素，是一個img，當我設定其CSS為「display:none;」時，在FF上就會沒辦法利用<br />
「jQuery.css(&#8216;left&#8217;) or jQuery.css(&#8216;top&#8217;)」來把這個值取出。就算你已經設定好left或是top的值，都只會抓到0px。</p>
<p>範例程式碼：<br />
<script src="http://gist.github.com/518809.js?file=gistfile1.html"></script></p>
<p>所以為了要解決在元素被hidden時不能取值的問題，就只能用比較髒的手段來抓到這個值，就是利用「visibility」。 </p>
<p>什麼是visibility？它和display不同的地方在於說，display:none會直接不顯示這個元素並不佔用空間；而visibilty:hidden則是不顯示這個元素但是卻仍存在並佔用空間。</p>
<p>所以這個很Tricky的方法可以參考下面：<br />
<script src="http://gist.github.com/518819.js?file=gistfile1.html"></script></p>
<p>這樣就可以成功的取到left的值（top亦同）而不會影響UI的部分了，算是這次遇到最無言的Bug吧。</p>
<p>下次見囉。</p>
<p>δ 2011/01/20： 又開始繼續維護這個專案，其實對 FF 3.6.8 來說（不確定其他版本是否也會有相同問題），就算是最新版本的 jQuery 1.4.* 都無法從 display:none 的元素中利用 .css() 來取得特定的屬性值，因此我利用 jsfiddle 寫了<a href="http://jsfiddle.net/Fybn3/3/">一組完整測試</a>，包含 display:none 及 visibility:hidden 元素的各種可能，請自己用你的瀏覽器來測試一下吧。</p>
]]></content:encoded>
			<wfw:commentRss>http://eragonj.hax4.in/blog/js-jquery-css-problem-when-using-firefox.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[JS] Image preload</title>
		<link>http://eragonj.hax4.in/blog/js-image-preload.html</link>
		<comments>http://eragonj.hax4.in/blog/js-image-preload.html#comments</comments>
		<pubDate>Mon, 07 Dec 2009 18:44:00 +0000</pubDate>
		<dc:creator>EragonJ</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[prload]]></category>

		<guid isPermaLink="false">http://eragonj.hax4.in/?p=37</guid>
		<description><![CDATA[Tweet The way a browser normally works, images are loaded only after an HTTP request is sent for them, either passively via an tag or actively through a method call. 所以這就是為什麼圖片都會有Delay抓不到的情況&#8230;因為他通常是被觸發時才會自動去抓src的圖。可是如果真的是這樣的話，那就要想個辦法來避免這個問題。不過該怎麼辦咧? The simplest way to preload an image is to instantiate a new Image() object in JavaScript and pass it the URL of the image [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="border:1px solid #808080;background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Feragonj.hax4.in%2Fblog%2Fjs-image-preload.html&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://eragonj.hax4.in/blog/js-image-preload.html"></g:plusone>
			</div>
			<div style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://eragonj.hax4.in/blog/js-image-preload.html"  data-text="[JS] Image preload" data-count="horizontal" data-via="EragonJ">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><blockquote><p>The way a browser normally works, images are loaded only after an HTTP request is sent for them, either passively via an <img /> tag or actively through a method call.</p></blockquote>
<p>所以這就是為什麼圖片都會有Delay抓不到的情況&#8230;因為他通常是被觸發時才會自動去抓src的圖。可是如果真的是這樣的話，那就要想個辦法來避免這個問題。不過該怎麼辦咧?</p>
<blockquote><p>The simplest way to preload an image is to instantiate a new Image() object in JavaScript and pass it the URL of the image you want preloaded , and load it simultaneously to the page with the onLoad() event handler:</p></blockquote>
<p>哦酷哦，直覺上的想法就是要讓頁面load完時就先onload 一個function，這樣就可以把執行時間提前，因此只要寫個function包起來讓onload去讀就可以了。</p>
<p>DEMO CODE:<br /><script src="http://gist.github.com/251380.js?file=gistfile1.js"></script>
<div style="text-align: right;"><a href="http://articles.techrepublic.com.com/5100-10878_11-5214317.html">Source</a></div>
]]></content:encoded>
			<wfw:commentRss>http://eragonj.hax4.in/blog/js-image-preload.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

