<?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>5509(+1.1)</title>
	<atom:link href="http://5509.me/feed" rel="self" type="application/rss+xml" />
	<link>http://5509.me</link>
	<description>Output the knowledge</description>
	<lastBuildDate>Mon, 23 Aug 2010 07:41:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>jQueryでbackgroundPositionを取得するときの注意</title>
		<link>http://5509.me/log/get-css-background-position-with-jquer</link>
		<comments>http://5509.me/log/get-css-background-position-with-jquer#comments</comments>
		<pubDate>Mon, 23 Aug 2010 07:41:08 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[memo]]></category>

		<guid isPermaLink="false">http://5509.me/?p=3040</guid>
		<description><![CDATA[					$(&#8216;hoge&#8217;).css(&#8216;backgroundPosition&#8217;)だとIEで値が取れないんですね、不便か。
					XとYを別々に取得したい
					値の [...]]]></description>
			<content:encoded><![CDATA[					<p><strong>$(&#8216;hoge&#8217;).css(&#8216;backgroundPosition&#8217;)</strong>だとIEで値が取れないんですね、不便か。</p>
					<h2>XとYを別々に取得したい</h2>
					<h3>値の検証</h3>
					<pre>var bgPosDef = $('#hoge').css('backgroundPosition');</pre>
<h4>IE8まで（9は未検証）</h4>
<pre>console: null（空）</pre>
					<h4>Firefox, Chrome, Safari, Operaなど</h4>
					<pre>console: 50px 50px</pre>
<p>IEは返されるデータがない！こういうところがみんなが嫌いな所以ですかね。IEはbackgroundPositionではなくて、<strong>backgroundPositionXのようにXかYを指定</strong>して個別に引き抜きます。</p>
<pre>var bgPosX = $('#hoge').css('backgroundPositionX');
var bgPosY = $('#hoge').css('backgroundPositionY');</pre>
					<h3>XとYを取得する</h3>
					<p>計算を行う場合は、数値にしておく必要があるのでついでに。</p>
					<pre>var bgPos = bgPosDef.split(' '), // 半スペで分ける
// bgPos[0] == X, bgPos[1] == Y
bgPosX = bgPosY = 0;
bgPosX = bgPos[0].replace('px', '');
bgPosY = bgPos[1].replace('px', '');
// pxを削除する</pre>
					<p>IEはpxを削るだけです。</p>
					<pre>bgPosX = $('#hoge').css('backgroundPositionX').replace('px', '');
bgPosY = $('#hoge').css('backgroundPositionY').replace('px', '');</pre>
					<h3>条件分岐で分ける</h3>
					<pre>var bgPosDef = $('#hoge').css('backgroundPosition'),
&nbsp;&nbsp;bgPosX = bgPosY = 0;
if ( bgPosDef ) { // backgroundPositionの値が取れた場合
&nbsp;&nbsp;var bgPos = bgPosDef.split(' '),
&nbsp;&nbsp;bgPosX = bgPos[0].replace('px', '');
&nbsp;&nbsp;bgPosY = bgPos[1].replace('px', '');
} else { // 取れなかった場合
&nbsp;&nbsp;bgPosX = $('#hoge').css('backgroundPositionX').replace('px', '');
&nbsp;&nbsp;bgPosY = $('#hoge').css('backgroundPositionY').replace('px', '');
}</pre>
					<p>これくらいはjQueryで対応してくれてもいいような気がしないでもない。。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/get-css-background-position-with-jquer/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitterの@Anywhereを使ってつぶやけるだけのクライアントを作る</title>
		<link>http://5509.me/log/creating-twitter-client-with-anywhere</link>
		<comments>http://5509.me/log/creating-twitter-client-with-anywhere#comments</comments>
		<pubDate>Thu, 19 Aug 2010 01:20:33 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[tuts]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://5509.me/?p=2998</guid>
		<description><![CDATA[					
					どんだけ話題に乗り遅れてるねんっていう話なんですけど、いまさら@Anywhereを使ってみました。
					つぶやけるだけのTwitterクライアント &#8211; Only tweet
			 [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://onlytweet.5509.me/"><img src="http://5509.me/wp-content/uploads/2010/08/onlytweet.png" alt="" title="onlytweet" width="450" class="alignnone size-full wp-image-3001" /></a></p>
					<p>どんだけ話題に乗り遅れてるねんっていう話なんですけど、いまさら<a href="http://dev.twitter.com/anywhere">@Anywhere</a>を使ってみました。</p>
					<p><a href="http://onlytweet.5509.me/">つぶやけるだけのTwitterクライアント &#8211; Only tweet</a></p>
					<p>きっかけは、つぶやけるだけの俺俺クライアントがほしくて、<a href="http://rewish.org/javascript/twitter_anywhere">Twitterの機能をJSで簡単に導入できる「@Anywhere」の使い方メモ &#8211; Rewish</a>でなんとなく出来ることは読んでいた@Anywhereで十分やんじゃあつくれるな、という理由です。</p>
					<p>はっきり言ってChrome(Windowsだけ)のアプリケーション登録がないとまったく使えないしょうもないやつです。でもアプリケーション登録すればキャプチャみたいに使えます。結構便利。</p>
					<p>JavaScriptだけで作れるので、JavaScriptしかわからないけどちょっとやってみたい人にはちょうどいい感じかもです。<br />
					<span id="more-2998"></span></p>
					<h2>開発環境を整える</h2>
					<p>開発と言っても@AnywhereはJavaScriptだけで使えるので、用意するものは、テキストエディタとTwitterのAPIキーだけです。</p>
					<p>APIキーの発行と、読み込むソースまでは、Rewishの<a href="http://rewish.org/javascript/twitter_anywhere"><br />
					Twitterの機能をJSで簡単に導入できる「@Anywhere」の使い方メモ &#8211; Rewish</a>を見てもらえば分かると思いますし、<del datetime="2010-08-19T01:22:47+00:00">面倒くさいので</del>省略します。</p>
					<p>アクセス権限については、<a href="http://dev.twitter.com/apps">http://dev.twitter.com/apps</a>で変更できるようになってるので、Read &#038; Writeにしておきます。</p>
					<h2>@Anywhereの基礎知識</h2>
					<pre>twttr.anywhere(function(twitter) {
&nbsp;&nbsp;// 引数のtwitterがデータを持っているため
&nbsp;&nbsp;// ここで@Anywhereの機能が使える
});</pre>
					<p>@Anywhereの機能を使いたいときは上記のように<strong>twttr.anywhere(function(twitter){ });</strong>の中に記述します。</p>
					<h2>サインインとサインアウトなど機能の実装</h2>
					<h3>サインイン</h3>
					<pre>twitter.signIn()</pre>
<p>を使うかRewishでも紹介されている</p>
<pre>connectButton()</pre>
					<p>を使います。connectButtonは以下のように引数でオプションを指定することができます。</p>
					<pre>twitter("#hoge").connectButton({
&nbsp;&nbsp;authComplete: function() {
&nbsp;&nbsp;&nbsp;&nbsp;// 認証が完了した後の処理
&nbsp;&nbsp;},
&nbsp;&nbsp;signOut: function() {
&nbsp;&nbsp;&nbsp;&nbsp;// サインアウトした後の処理
&nbsp;&nbsp;}
});</pre>
					<p>が、今回はtwitter.signIn()を利用しました。一番簡単な方法は指定した要素のonclickで実行するだけです。超簡単ですね。</p>
					<pre>document.getElementById("signIn").onclick = function() {
&nbsp;&nbsp;twitter.signIn();
&nbsp;&nbsp;return false;
}</pre>
					<p>signIn()を実行すると、TwitterのOAuthウィンドウが開いてそちらで認証後に元のアプリケーションに返されます。返ってきたときに何か実行したい場合は、authCompleteというトリガーを使います。</p>
					<p>↓のようにjQueryみたいにトリガーをbindすることができます。トリガーにbindするfunctionは2つ引数を持っていて、イベントハンドラのeと、@Anywhereから渡されるuserです。userには、サインインしたユーザーの情報が入っているので、2つ目の引数は必ず受け取りましょう。</p>
					<pre>twitter.bind("authComplete", function(e, user) {
&nbsp;&nbsp;// hogehoge
});</pre>
					<p>Only Tweetでは、サインイン後に</p>
					<ul>
					<li>ユーザー名を表示</li>
					<li>ユーザー名の後ろにサインアウトリンクを表示</li>
					<li>使い方をTweetボックスに置き換え</li>
					</ul>
					<p>というように置き換えています。</p>
					<h4>受け取ったuserの使い方</h4>
					<p>user.data(プロパティ)でscreen_nameやアイコン画像などを表示できます。</p>
					<pre>sign.innerHTML = [
&nbsp;&nbsp;'&lt;p&gt;Logged in as : &lt;a href="http://twitter.com/' + user.data('screen_name') + '"&gt;',
&nbsp;&nbsp;&nbsp;&nbsp;user.data('screen_name'),
&nbsp;&nbsp;'&lt;/a&gt; (&lt;a href="javascript:void(0)" onclick="twttr.anywhere.signOut();"&gt;Sign out&lt;/a&gt;)&lt;/p&gt;',
].join('');</pre>
					<h3>サインアウト</h3>
					<p>サインアウトアクション自体は任意の要素でtwttr.anywhere.signOut()を実行するだけです。HTMLに入れる場合は、アンカーのonclickにでも入れておけばいいと思います。</p>
					<pre>&lt;a href="javascript:void(0)" onclick="twttr.anywhere.signOut();"&gt;Sign out&lt;/a&gt;</pre>
<p>サインアウト後に何か実行したいときはautoCompleteと同じように、signOutというトリガーにfunctionをbindします。</p>
<pre>twitter.bind("signOut", function(e) {
&nbsp;&nbsp;// hogehoge
});</pre>
					<h3>アクセス時のサインイン判定</h3>
					<p>アプリケーションにアクセスしたときに、すでにサインインしているかどうかで表示する内容を変えたい場合</p>
					<pre>twitter.isConnected()</pre>
<p>を利用します。既にサインインしていればtrue、そうでない場合はfalseが返されます。</p>
<pre>if ( twitter.isConnected() ) {
&nbsp;&nbsp;// サインインしている場合
} else {
&nbsp;&nbsp;// サインインしていない場合
}</pre>
					<h3>Tweetボックス（つぶやくやつ）の表示</h3>
					<p>サインインしているとき、指定したIDの要素にTweetボックスを表示します。これには文字数カウントやらつぶやくボタンやら含まれているので、表示すればそのままつぶやくことができます。ただしこのTweetボックスはiframeで書き出されるので動作の微調整とかは行えません。むーん不便。。</p>
					<pre>twitter("hoge").tweetBox({
&nbsp;&nbsp;label: /* いまなにしてる？のところ */,
&nbsp;&nbsp;defaultContent: /* 予め表示しておく文言 */,
&nbsp;&nbsp;onTweet: function(e) { // Tweet後のコールバック
&nbsp;&nbsp;&nbsp;&nbsp; // hogeking
&nbsp;&nbsp;}
});</pre>
					<h2>つぶやけるだけのTwitterクライアントの実装</h2>
					<p>サインイン前<br />
					<img src="http://5509.me/wp-content/uploads/2010/08/onlytweet3-e1282179789539.png" alt="" title="onlytweet3" width="450" height="271" class="alignnone size-full wp-image-3003" /></p>
					<p>サインイン後<br />
					<img src="http://5509.me/wp-content/uploads/2010/08/onlytweet.png" alt="" title="onlytweet" width="450" class="alignnone size-full wp-image-3001" /></p>
					<p>CSSは置いておくとして、用意したHTMLはこんなのです。</p>
					<pre>&lt;div id=&quot;wrap&quot;&gt;
&nbsp;&nbsp;&lt;div id=&quot;header&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;h1&gt;&lt;a href=&quot;./&quot;&gt;Only tweet&lt;/a&gt;&lt;/h1&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;p id=&quot;sign&quot;&gt;&lt;/p&gt;
&nbsp;&nbsp;&lt;/div&gt;
&nbsp;&nbsp;&lt;p class=&quot;desc&quot;&gt;つぶやけるだけのTwitterクライアント&lt;/p&gt;
&nbsp;&nbsp;&lt;div id=&quot;tweetBox&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;ol id=&quot;step&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;em&gt;HOP&lt;/em&gt;: Connect with Twitterボタンを押す&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;em&gt;STEP&lt;/em&gt;: OAuth認証画面でconnectを押す&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;em&gt;JUMP&lt;/em&gt;: つぶやく&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ol&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;p id=&quot;attention&quot;&gt;Tweeted&lt;/p&gt;
&nbsp;&nbsp;&lt;/div&gt;

&nbsp;&nbsp;&lt;div id=&quot;footer&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;small&gt;Powered by &lt;a href=&quot;http://twitter.com/&quot;&gt;Twitter&lt;/a&gt;. | &lt;a href=&quot;./about.html&quot;&gt;about&lt;/a&gt; | &lt;a href=&quot;http://twitter.com/5509&quot;&gt;5509&lt;/a&gt;&lt;/small&gt;
&nbsp;&nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;loadingBg&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;loading&quot;&gt;&lt;p&gt;Connecting @anywhere...&lt;/p&gt;&lt;/div&gt;</pre>
					<p>なんかソース的に微妙なところもあると思いますけど、俺俺クライアントなので放っておきましょう。JSで追加すればいいやんなところも書いてあったりしますし。</p>
					<h3>仕様を決める</h3>
					<ul>
					<li>authCompleteでp#signをSigned inに書き換え、div#tweetBoxもつぶやけるように書き換え</li>
					<li>アクセス時にサインインしていなければ、p#signはサインインボタンを表示</li>
					<li>アクセス時にサインインしていれば、authCompleteと同じ状態にする</li>
					<li>待ち時間が発生するような箇所ではローディングのくるくるを表示</li>
					<li>Tweetが成功したら、成功したよ！的な文言を表示する</li>
					</ul>
					<h3>使いそうなものを変数に、機能を関数にしておく</h3>
					<pre>var d = document;
var $d = function(id) { return d.getElementById(id); };
var sign = $d("sign");
var tweetBox = $d("tweetBox");
var step = $d("step");
var loadingBg = $d("loadingBg");
var loading = $d("loading");
var attention = $d("attention");</pre>
					<p>だいたい2回以上使うようなものは変数にいれときます。使ってなくても気にしない。</p>
					<pre>// ローディングの表示
function showLoading() {
&nbsp;&nbsp;loadingBg.style.display = "block";
&nbsp;&nbsp;loading.style.display = "block";
}
// ローディングの非表示
function hideLoading() {
&nbsp;&nbsp;loadingBg.style.display = "none";
&nbsp;&nbsp;loading.style.display = "none";
}
// サインインの表示、サインインクリック時は一旦ローディングを表示する
function addConnect(T) {
&nbsp;&nbsp;sign.innerHTML = &quot;&lt;a href='javascript:void(0);' id='signIn'&gt;&lt;img src='img/connect.gif' alt='Connect with Twitter'&gt;&lt;/a&gt;&quot;;
&nbsp;&nbsp;d.getElementById(&quot;signIn&quot;).onclick = function() {
&nbsp;&nbsp;&nbsp;&nbsp;showLoading();
&nbsp;&nbsp;&nbsp;&nbsp;T.signIn();
&nbsp;&nbsp;&nbsp;&nbsp;return false;
&nbsp;&nbsp;}
&nbsp;&nbsp;hideLoading();
}</pre>
					<p>やっぱり2回以上使いそうなものはfunctionにしておきます。使ってなくても気にならない。</p>
					<h3>@Anywhereを利用して実装する</h3>
					<pre>twttr.anywhere(function(twitter) {
&nbsp;&nbsp;// 基本的に処理はここに書く
});</pre>
					<p>サインイン時にHTMLを入れ替えるfunctionを定義しておく。</p>
					<pre>var addHTML = function(User) {
&nbsp;&nbsp;sign.innerHTML = [
&nbsp;&nbsp;&nbsp;&nbsp;'&lt;p&gt;Logged in as : &lt;a href=&quot;http://twitter.com/' + User.data('screen_name') + '&quot;&gt;',
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;User.data('screen_name'),
&nbsp;&nbsp;&nbsp;&nbsp;'&lt;/a&gt; (&lt;a href=&quot;javascript:void(0)&quot; onclick=&quot;twttr.anywhere.signOut();&quot;&gt;Sign out&lt;/a&gt;)&lt;/p&gt;',
&nbsp;&nbsp;].join('');
&nbsp;&nbsp;
&nbsp;&nbsp;twitter("#tweetBox").tweetBox({
&nbsp;&nbsp;&nbsp;&nbsp;label: "Tweet, tweet, tweet, tweet and tweet",
&nbsp;&nbsp;&nbsp;&nbsp;defaultContent: "",
&nbsp;&nbsp;&nbsp;&nbsp;onTweet: function(e) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;attention.style.display = "block";
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setTimeout(function() {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;attention.style.display = "none";
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}, 2000);
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;});
&nbsp;&nbsp;hideLoading();
}</pre>
					<p>アクセスしたときにサインインしているか、いないかで行う処理を変える</p>
					<pre>if ( !twitter.isConnected() ) {
&nbsp;&nbsp;// サインインしていない場合は、addConnectでサインインリンクを表示
&nbsp;&nbsp;addConnect(twitter);
} else {
&nbsp;&nbsp;// サインインしている場合はstepを非表示にして、tweetBoxを表示する
&nbsp;&nbsp;var User = twitter.currentUser;
&nbsp;&nbsp;step.style.display = "none";
&nbsp;&nbsp;addHTML(User);
&nbsp;&nbsp;hideLoading();
}</pre>
					<p>最後にauthCompleteとsignOut時にコールバックをbindする。</p>
					<pre>twitter.bind("authComplete", function(e, user) {
&nbsp;&nbsp;// ステップを非表示にしてtweetBoxを表示後ローディングを隠す
&nbsp;&nbsp;step.style.display = "none";
&nbsp;&nbsp;addHTML(user);
&nbsp;&nbsp;hideLoading();
});
twitter.bind("signOut", function(e) {
&nbsp;&nbsp;// サインアウトが完了するまでローディングを表示する
&nbsp;&nbsp;// #signを空にして、tweetBoxを削除して、addConnectを実行する
&nbsp;&nbsp;showLoading();
&nbsp;&nbsp;sign.innerHTML = "";
&nbsp;&nbsp;tweetBox.removeChild(tweetBox.getElementsByTagName("iframe")[0]);
&nbsp;&nbsp;addConnect(twitter);
&nbsp;&nbsp;step.style.display = "block";
});</pre>
					<h2>完成ソースコード</h2>
					<p>ちなみにJavaScriptは全て&lt;/body&gt;直前に書いてるので、window.onload的なやつは必要ないです。そのまま実行しましょう。</p>
					<pre>&lt;script src=&quot;http://platform.twitter.com/anywhere.js?id=r3awJe8TS1nZhH4hUxtk4w&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;//&lt;![CDATA[
var d = document;
var $d = function(id) { return d.getElementById(id); };
var sign = $d(&quot;sign&quot;);
var tweetBox = $d(&quot;tweetBox&quot;);
var step = $d(&quot;step&quot;);
var loadingBg = $d(&quot;loadingBg&quot;);
var loading = $d(&quot;loading&quot;);
var attention = $d(&quot;attention&quot;);

function showLoading() {
&nbsp;&nbsp;loadingBg.style.display = &quot;block&quot;;
&nbsp;&nbsp;loading.style.display = &quot;block&quot;;
}
function hideLoading() {
&nbsp;&nbsp;loadingBg.style.display = &quot;none&quot;;
&nbsp;&nbsp;loading.style.display = &quot;none&quot;;
}
function addConnect(T) {
&nbsp;&nbsp;sign.innerHTML = &quot;&lt;a href='javascript:void(0);' id='signIn'&gt;&lt;img src='img/connect.gif' alt='Connect with Twitter'&gt;&lt;/a&gt;&quot;;
&nbsp;&nbsp;d.getElementById(&quot;signIn&quot;).onclick = function() {
&nbsp;&nbsp;&nbsp;&nbsp;showLoading();
&nbsp;&nbsp;&nbsp;&nbsp;T.signIn();
&nbsp;&nbsp;&nbsp;&nbsp;return false;
&nbsp;&nbsp;}
&nbsp;&nbsp;hideLoading();
}
twttr.anywhere(function(twitter) {
&nbsp;&nbsp;//addConnect(twitter);
&nbsp;&nbsp;var addHTML = function(User) {
&nbsp;&nbsp;&nbsp;&nbsp;sign.innerHTML = [
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'&lt;p&gt;Logged in as : &lt;a href=&quot;http://twitter.com/' + User.data('screen_name') + '&quot;&gt;',
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;User.data('screen_name'),
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'&lt;/a&gt; (&lt;a href=&quot;javascript:void(0)&quot; onclick=&quot;twttr.anywhere.signOut();&quot;&gt;Sign out&lt;/a&gt;)&lt;/p&gt;',
&nbsp;&nbsp;&nbsp;&nbsp;].join('');
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;twitter(&quot;#tweetBox&quot;).tweetBox({
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;label: &quot;Tweet, tweet, tweet, tweet and tweet&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;defaultContent: &quot;&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;onTweet: function(e) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;attention.style.display = &quot;block&quot;;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setTimeout(function() {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;attention.style.display = &quot;none&quot;;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}, 2000);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;&nbsp;&nbsp;hideLoading();
&nbsp;&nbsp;}
&nbsp;&nbsp;if ( !twitter.isConnected() ) {
&nbsp;&nbsp;&nbsp;&nbsp;addConnect(twitter);
&nbsp;&nbsp;} else {
&nbsp;&nbsp;&nbsp;&nbsp;var User = twitter.currentUser;
&nbsp;&nbsp;&nbsp;&nbsp;step.style.display = &quot;none&quot;;
&nbsp;&nbsp;&nbsp;&nbsp;addHTML(User);
&nbsp;&nbsp;&nbsp;&nbsp;hideLoading();
&nbsp;&nbsp;}
&nbsp;&nbsp;twitter.bind(&quot;authComplete&quot;, function(e, user) {
&nbsp;&nbsp;&nbsp;&nbsp;step.style.display = &quot;none&quot;;
&nbsp;&nbsp;&nbsp;&nbsp;addHTML(user);
&nbsp;&nbsp;&nbsp;&nbsp;hideLoading();
&nbsp;&nbsp;});
&nbsp;&nbsp;twitter.bind(&quot;signOut&quot;, function(e) {
&nbsp;&nbsp;&nbsp;&nbsp;showLoading();
&nbsp;&nbsp;&nbsp;&nbsp;sign.innerHTML = &quot;&quot;;
&nbsp;&nbsp;&nbsp;&nbsp;tweetBox.removeChild(tweetBox.getElementsByTagName(&quot;iframe&quot;)[0]);
&nbsp;&nbsp;&nbsp;&nbsp;addConnect(twitter);
&nbsp;&nbsp;&nbsp;&nbsp;step.style.display = &quot;block&quot;;
&nbsp;&nbsp;});
});
//]]&gt;&lt;/script&gt;</pre>
					<p><a href="http://onlytweet.5509.me/">つぶやけるだけのTwitterクライアント &#8211; Only tweet</a></p>
					<p>あとはTwitter APIのJSONPからscreen_nameでTLとか取得すればなんとなくTwitterっぽいのもできるので、興味がある人はぜひ。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/creating-twitter-client-with-anywhere/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>今までに公開したjQueryプラグイン</title>
		<link>http://5509.me/log/jquery-plugins-have-been-published</link>
		<comments>http://5509.me/log/jquery-plugins-have-been-published#comments</comments>
		<pubDate>Thu, 12 Aug 2010 04:48:41 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[memo]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://5509.me/?p=2945</guid>
		<description><![CDATA[					
					はじめに、この記事は役に立つリンク集ではないです。
					ブログを初めて2年ちょっとが過ぎ、半年くらいやるやる言ってやらなかったexValidationもようやく公開できたのもあって、自分の中で [...]]]></description>
			<content:encoded><![CDATA[					<p><img src="http://5509.me/wp-content/uploads/2010/08/jquery.png" alt="" title="jquery" width="400" height="150" class="alignnone size-full wp-image-2986" /></p>
					<p>はじめに、この記事は役に立つリンク集ではないです。</p>
					<p>ブログを初めて2年ちょっとが過ぎ、半年くらいやるやる言ってやらなかったexValidationもようやく公開できたのもあって、自分の中で一段落したので、今まで公開したプラグインの振り返り等も兼ねて書きました。</p>
					<p>そもそもは誰かの役に立てばいいなと思って始めたブログなので（ほとんど役に立たないものだと思いますけど）もしかするともしかしてどこかで誰かの役に立てるものもあるかもしれません。</p>
					<p>ところで最初のプラグインを公開したときは、（JavaScript的な意味で）それはもう何も知りませんでした。そんな感じで今でも恥ずかしいコードなんですけど、最初の頃はもっと恥ずかしいコードなんですね。だから見ないで…<br />
					<span id="more-2945"></span></p>
					<h2>いままで公開したjQueryぷるぎんたち</h2>
					<h3><a href="http://5509.me/log/datesupport">プルダウンで日付を入力(選択)するイライラを解消するDateSupport.js</a></h3>
					<p><img src="http://5509.me/wp-content/uploads/2010/08/datesupport.png" alt="" title="datesupport" width="400" height="150" class="alignnone size-full wp-image-2965" /></p>
					<p><a href="http://5509.me/sample/dateSupport/index.html">サンプル</a></p>
					<p>この頃は些細な生年月日の日付選択にもイライラしてました。。そんなことはさておいて、ただのしがないコーダーだったこの頃の僕にとってjQueryの存在はかなり大きかったです。</p>
					<p>JavaScriptというよりプログラミングの基礎知識も何もなしに、とりあえずやってみよう的な感じで始めて最初にできたプラグインがこのDateSupportでした。記念すべき（？）最初のプラグインなのにまったく懐かしくないのはなぜだろう…</p>
					<h3><a href="http://5509.me/log/prefsupport">プルダウンで都道府県などを入力(選択)するイライラを解消するPrefSupport.js</a></h3>
					<p><img src="http://5509.me/wp-content/uploads/2010/08/prefsupport.png" alt="" title="prefsupport" width="400" height="150" class="alignnone size-full wp-image-2967" /></p>
					<p><a href="http://5509.me/sample/prefSupport/index.html">サンプル</a></p>
					<p>DateSupportでHTMLを取得してDOMを操る技術（？）を身につけて（？）調子に乗った（！）のか、あの鬱陶しい都道府県のプルダウンも展開しました。</p>
					<p>今思えばどうしてタイトルに「jQuery」「プラグイン」の2つが入っていないのか。。これもやっぱり懐かしく思えないのはなぜ…</p>
					<h3><a href="http://5509.me/log/realtimeformvalidation">リアルタイムフォームバリデーション jQuery.validation.js</a></h3>
					<p><img src="http://5509.me/wp-content/uploads/2010/08/jqueryvalidation.png" alt="" title="jqueryvalidation" width="400" height="150" class="alignnone size-full wp-image-2969" /></p>
					<p><a href="http://5509.me/sample/validation/">サンプル</a></p>
					<p><span style="display: none">確か国産のバリデーションプラグインがなかった、という理由で作ったjquery.validation.jsですが、正直実装方法が全く分からず、正規表現やcallback、書き方などその他もろもろ色々勉強になったやつですこいつ。最初に叩きで書いたバリデーションエンジンを<a href="http://twitter.com/akkun_choi">@akkun_choi</a>に書き直してもらって、今でも基盤として使ってます。書き直してもらったコードは当時全く意味が分かりませんでした。ありがとう…</span>このプラグインは利用してくれた方のコメント（要望）を元に、徐々にバージョンアップして最終的に色んなバリデーションを行えるようになりました。最終バージョンでは開発当初は絶対書けなかったようなことまで書けるようになってました。</p>
					<p>このプラグインは人生を少なからず変えた重要なやつかもしれないです。</p>
					<h3><a href="http://5509.me/log/jqueryselectable">selectボックスをシンプルなプルダウンに拡張するjQselectable(jQuery.selectable.js)</a></h3>
					<p><img src="http://5509.me/wp-content/uploads/2010/08/selectable.png" alt="" title="selectable" width="400" height="150" class="alignnone size-full wp-image-2970" /></p>
					<p><a href="http://jqselectable.googlecode.com/svn/trunk/index.html">サンプル</a></p>
					<p>何ヶ月か前に作ったDateSupportとPrefSupportを元に作りなおしたのがこのselectableでした。今は書き直して色々仕様も変わったりしていますが、公開当初はそれはもう色々ひどかったような気がします。</p>
					<p>個人的には最高のユーザー体験じゃろ、って思ってるんですけどね。どうなんでしょう。</p>
					<h3><a href="http://5509.me/log/jqueryslidescrolljs">スライドスクロールページ内リンク jQuery.slideScroll.js</a></h3>
					<p><a href="http://5509.me/sample/slidescroll/">サンプル</a></p>
					<p>JavaScriptを始めたきっかけはするんするんスクロールだったので、ちゃんと内容を理解してこれを書けたっていうのはなんだか前へ進めた気がしてうれしかったですね。</p>
					<h3><a href="http://5509.me/log/page-scrolling-with-jqueryeasing">ひと味違ったページ内スクロールをjQuery Easingプラグインで実装する jQuery.easing.scroll.js</a></h3>
					<p><a href="http://5509.me/sample/easingScroll/">サンプル</a></p>
					<p>せっかくするするスクロールを書いたのに、jQueryを使うと数行でもっとすごい動きを実装できるといういい例でした。easing使ったほうがきれいにスクロールするんです。これは使わなくていいので、easingを使いましょうよ。</p>
					<h3><a href="http://5509.me/log/preview_default_url_shorten_by_bitly">bit.lyで短縮された元のURLをプレビューする jQueryプラグイン</a></h3>
					<p><img src="http://5509.me/wp-content/uploads/2009/05/prebitly.gif"></p>
					<p><a href="http://5509.me/sample/prebitly/">サンプル</a></p>
					<p>思い入れが全然ないなこれ…</p>
					<h3><a href="http://5509.me/log/tangohokanjs">入力補助でユーザーの負担を減らそう 予約語を表示するtangoHokan.js</a></h3>
					<p><img src="http://5509.me/wp-content/uploads/2010/08/tangohokan.png" alt="" title="tangohokan" width="399" height="150" class="alignnone size-full wp-image-2973" /></p>
					<p><a href="http://5509.me/sample/tangohokan/">サンプル</a></p>
					<p>たしかこの辺は管理画面を使いやすくしたくて作ってました。</p>
					<h3><a href="http://5509.me/log/editableselect">セレクトボックスに新しいオプションを追加していけるスクリプト</a></h3>
					<p><img src="http://5509.me/wp-content/uploads/2010/08/editable.png" alt="" title="editable" width="400" height="150" class="alignnone size-full wp-image-2974" /></p>
					<p><a href="http://5509.me/sample/editableselect/">サンプル</a></p>
					<p>なんかちょっと斬新なことがしたくて、作ってみたものの使いどころはまったくありませんでした。一番微妙なやつですねこいつは。</p>
					<h3><a href="http://5509.me/log/hintmask">パスワード入力欄の最後の文字列をヒントとして表示するjQueryプラグイン</a></h3>
					<p><img src="http://5509.me/wp-content/uploads/2010/08/hint.png" alt="" title="hint" width="401" height="151" class="alignnone size-full wp-image-2975" /></p>
					<p><a href="http://5509.me/sample/hintmask/">サンプル</a><br />
					iPhoneのUIみたいなのが作りたくて、でもロジックが分からなくて逃げたらこういう形になりました。公開したら、まさにiPhoneのやつみたいなのを海外で公開した人がいて、ロジックみたら僕には無理やったなっていう結果でした。</p>
					<h3><a href="http://5509.me/log/twitter-float-tip">TwitterのHover Cardを実装するjQueryプラグイン twttrFloatTip</a></h3>
					<p><img src="http://5509.me/wp-content/uploads/2010/08/hovercard.png" alt="" title="hovercard" width="400" height="148" class="alignnone size-full wp-image-2976" /></p>
					<p><a href="http://twitter-float-tip.googlecode.com/svn/trunk/index.html">サンプル</a></p>
					<p>@anywhereが公開されるちょっと前くらいに、HoverCardを使いたいなと思って書いたんですけど、数ヵ月後に案の定@anywhereでHoverCardが実装できるようになったので、不要になったかわいそうなやつです。</p>
					<h3><a href="http://5509.me/log/whatinout">ありそうでなかった？要素をふわっと表示させるjQueryプラグイン whatInOut</a></h3>
					<p><a href="http://5509.me/sample/whatinout/">サンプル</a></p>
					<p>斬新なタイトルで注目を集めた（嘘）whatInOutはWindows7のウィンドウを開くときみたいな、ふんわりとしたアニメーションがほしくて書きました。今さらというか、今だからというか、whatInとwhatOutはほとんど使い物にならなくて、whatSlideInとwhatSlideOutがいい感じですね。</p>
					<h3><a href="http://5509.me/log/exvalidation">どんなフォームにも使えるjQueryのフォームバリデーション exValidation</a></h3>
					<p><img src="http://5509.me/wp-content/uploads/2010/08/exvalidation.png" alt="" title="exvalidation" width="400" height="150" class="alignnone size-full wp-image-2977" /></p>
					<p><a href="http://ex-validation.googlecode.com/svn/trunk/index.html">サンプル</a></p>
					<p>ずっと書き直したかったjQuery.validation.jsを仕様変更などして書き直したものです。やりたいようにやっていったら「<a href="http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/">jquery Inline Form Validation Engine</a>」にかなり近いものになってしまったのですけど、jQselectableと一緒に使えるとかexValidationにしかないようなオプションとかもあるしこれでいいか、で公開しました。</p>
					<h2>ふりかえり</h2>
					<p>僕は別にJavaScriptの知識が豊富なわけでもないし、すごいコードを書けるわけでもないですが、その時できる範囲内でたまに出来ないことが必要になったりして、聞いたりしてちょっとずつ理解して今ではなーんとなく理解できるようになりました。</p>
					<p>本当にしがないコーダーだった頃に比べると、できることは増えていて、それもこれもjQueryのおかげだったりするんですけど、jQueryにばっかり頼っていてもできることは増えないのでJavaScriptはもっと理解したい。</p>
					<p>プラグインとかは特に誰に向けて書いてるわけではないですけど、コメントとかTwitterで反応があるとうれしいです。コメントの返事さぼったりしてすみません。これからもさぼったりすると思いますけど、コメント本当にうれしいです。</p>
					<p>そんなわけで、これからもぼちぼち書いていけたらいいなとか思いながらも、そろそろ次のステップに進まないとなぁと思っているわけで、次の言語をどうしようと重たい腰が一向にあがらない毎日です。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/jquery-plugins-have-been-published/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>どんなフォームにも使えるjQueryのフォームバリデーション exValidation</title>
		<link>http://5509.me/log/exvalidation</link>
		<comments>http://5509.me/log/exvalidation#comments</comments>
		<pubDate>Fri, 06 Aug 2010 01:15:12 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[validation]]></category>
		<category><![CDATA[フォーム]]></category>
		<category><![CDATA[ユーザビリティ]]></category>

		<guid isPermaLink="false">http://5509.me/?p=2864</guid>
		<description><![CDATA[					
					jquery.validation.jsというフォームバリデーションプラグインを公開していますが、使える場面が割と限定されてしまうような作りだったので、より幅広く使えるようにexValidation [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://ex-validation.googlecode.com/svn/trunk/index.html"><img src="http://5509.me/wp-content/uploads/2010/08/validation.png" alt="" title="validation" width="450" height="202" class="alignnone size-full wp-image-2872" /></a></p>
					<p><a href="http://5509.me/log/realtimeformvalidation">jquery.validation.js</a>というフォームバリデーションプラグインを公開していますが、使える場面が割と限定されてしまうような作りだったので、<strong>より幅広く使えるようにexValidationという名前で新しいjQueryプラグインとして作り直しました。</strong>伴って仕様や使い方が異なる部分も多いので、ドキュメントとして書いておきます。ただし前半のバリデーションルール周りは同じエンジンを使ってるので、ほぼ同じです。ちなみにすごい長いです。。</p>
					<p>validation.jsにはあったけど、exValidationにはない機能はだいたい省いたものなので、こちらでの実装は基本的には行いません。それないと不便、、な機能があれば随時追加拡張していく予定なのでコメントでください。全ての要望には応えられませんので、、それだけ了承ください。</p>
					<ul>
					<li><a href="http://ex-validation.googlecode.com/svn/trunk/index.html">サンプル1: エラーを右上に表示</a></li>
					<li><a href="http://ex-validation.googlecode.com/svn/trunk/index2.html">サンプル2: エラーを下に表示</a></li>
					</ul>
					<p><span id="more-2864"></span></p>
					<h2>トピックス</h2>
					<ul>
					<li><a href="#download">ダウンロード</a></li>
					<li><a href="#install">使い方</a>
					<ul>
					<li><a href="#install1">1. JSファイルを読み込む</a></li>
					<li><a href="#install2">2. 基本バリデーションルール</a></li>
					<li><a href="#install3">3. select, checkbox、radio、複数項目の場合</a></li>
					<li><a href="#install4">4. select要素を対象にする場合</a></li>
					<li><a href="#install5">5. 再入力をチェックする場合</a></li>
					<li><a href="#install6">6. 入力文字数をチェックする場合</a></li>
					<li><a href="#install7">7. アクティベート</a></li>
					<li><a href="#install8">8. アクティベート（ここでルールを指定する場合）</a></li>
					</ul>
					</li>
					<li><a href="#options">オプション</a>
					<ul>
					<li><a href="#sample1">サンプル1のパターンで実行する</a></li>
					<li><a href="#sample2">サンプル2のパターンで実行する</a></li>
					<li><a href="#errfocus">errFocusを使う</a></li>
					<li><a href="#ajaxpost">Ajaxでポストする</a></li>
					<li><a href="#custombind">任意の要素にバリデーションをbindする</a></li>
					<li><a href="#customError">エラー時に関数を実行する、エラーがない場合に関数を実行する、スクロール位置を固定する</a>
					<ul>
					<li><a href="#customAddError">エラー時に関数を実行する</a></li>
					<li><a href="#customClearError">エラーがない場合に関数を実行する</a></li>
					<li><a href="#customScrollAdjust">スクロール位置を固定する</a></li>
					</ul>
					</li>
					</li>
					</li>
					</ul>
					<li><a href="#api">API</a>
					<ul>
					<li><a href="#selectable">jQselectableとの併用</a></li>
					</ul>
					<li><a href="#reg">バリデーションルール</a></li>
					<li><a href="#other">その他</a></li>
					</li>
					</ul>
					<h2 id="download">ダウンロード</h2>
					<dl>
					<dt>バリデーションエンジン </dt>
					<dd><a href="http://ex-validation.googlecode.com/svn/trunk/js/exvalidation.js">exValidation.js</a><br />
					<a href="http://ex-validation.googlecode.com/svn/trunk/js/exvalidation.min.js">exValidation.min.js</a></dd>
					<dt>バリデーションルール</dt>
					<dd><a href="http://ex-validation.googlecode.com/svn/trunk/js/exchecker-ja.js">exChecker-ja.js</a></dd>
					<dt>サンプルファイル</dt>
					<dd><a href="http://5509.me/sample/archive/exvalidation.zip">exValidation.zip</a></dd>
					</dl>
					<h2 id="install">使い方</h2>
					<h3 id="install1">1. JS・CSSファイルを読み込む</h3>
					<p>exValidaitonに必要なファイルは<strong>「exvalidation.css」「jQuery」「exvalidation.js」「exchecker-ja.js」</strong>の4つです。</p>
					<pre>&lt;link type=&quot;text/css&quot; rel=&quot;stylesheet&quot; href=&quot;css/exvalidation.css&quot; /&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://www.google.com/jsapi&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;google.load(&quot;jquery&quot;, &quot;1.4.2&quot;);&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/exvalidation.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/exchecker-ja.js&quot;&gt;&lt;/script&gt;</pre>
					<p>「exchecker-ja.js」は基本的なバリデーションルールを記述したファイルなので、これを読み込むことで以下に記述する最低限のバリデーションを行うことができます。</p>
					<h3 id="install2">2. 基本バリデーションルール</h3>
					<p>exchecker-ja.jsに基本のバリデーションルールを記述しています。下記のclassをフォーム要素（グループの場合はspanなどの要素）に割り振るか実行時にrulesというプロパティで指定すること（実行時のプロパティでバリデーションルールを指定する）でルールを決めることができます。</p>
					<ul>
					<li>required &#8211; 必須項目</li>
					<li>select &#8211; select要素用の必須項目</li>
					<li>radio &#8211; radioボタン（いずれかひとつ、グループ分けの親要素必須</li>
					<li>checkbox &#8211; checkbox（いずれかひとつ、グループ分けの親要素必須</li>
					<li>group &#8211; 複数の項目をまとめる場合（詳しくは後述</li>
					<li>retype-対象にするID &#8211; 再入力チェック</li>
					<li>email &#8211; メールアドレスチェック（*@*.*）</li>
					<li>hankaku &#8211; 全角禁止</li>
					<li>zenkaku &#8211; 全角のみ</li>
					<li>hiragana &#8211; ひらがなのみ</li>
					<li>katakana &#8211; カタカナのみ</li>
					<li>furigana &#8211; ふりがな（ひらがな、数字、アルファベット、〜、ー、()）</li>
					<li>tel &#8211; 電話番号(形式チェックはなし)</li>
					<li>numonly &#8211; 数字のみ</li>
					<li>nocaps &#8211; 英数字（小文字）のみ</li>
					<li>zip &#8211; 郵便番号(形式チェックはなし)</li>
					<li>url &#8211; URL（http(s)://）</li>
					<li>minX &#8211; X文字以下</li>
					<li>maxX &#8211; X文字以上</li>
					</ul>
					<p>また、適用させる項目はrequiredとhankakuは他の項目と同時に含めることが出来ます。例えば下記のようにクラスにemail, hankaku, requiredを指定した場合は</p>
					<pre>&lt;input type=&quot;text&quot; name=&quot;mail&quot; id=&quot;mail&quot; value=&quot;&quot; class=&quot;email hankaku required&quot; /&gt;</pre>
<p>必須項目・メールアドレスチェック・全角禁止になります。またクラスに記述する順序は任意で構いません。ところでバリデーションを行う<strong>input要素には固有のidが必須</strong>になります。</p>
<h4>特殊なタイプのチェック形式は以下のようになります。カッコ内はあってもなくても可</h4>
<p>メールアドレス：*@*.*<br />
電話番号：*(-)*(-)*<br />
郵便番号：***(-)****</p>
<h3 id="install3">3. checkbox、radio、複数項目のバリデーション</h3>
<p>checkbox、radio、複数項目をチェックする場合は<br />
<strong>spanなどのインライン要素<a href="#note1">(*1)</a>でグループを明示した上で</strong>ここではspan要素としますが span要素にid、classを割り当てます。</p>
<p>例えば、メールアドレスを@前と後で分ける場合は</p>
<pre>&lt;input type=&quot;text&quot; name=&quot;mail2&quot; id=&quot;mail2&quot; value=&quot;&quot; class=&quot;&quot; /&gt;
@
&lt;input type=&quot;text&quot; name=&quot;mai3&quot; id=&quot;mail3&quot; value=&quot;&quot; class=&quot;&quot; /&gt;</pre>
					<p>といったように分けるのが一般的なのでこれをチェックする場合は以下のようになります。</p>
					<pre>&lt;span class=&quot;group required hankaku email&quot; id=&quot;groupmail&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;mail3&quot; id=&quot;mail3&quot; value=&quot;&quot; class=&quot;&quot; /&gt;
@
&lt;input type=&quot;text&quot; name=&quot;mail2&quot; id=&quot;mail2&quot; value=&quot;&quot; class=&quot;&quot; /&gt;&lt;/span&gt;</pre>
					<p>ポイントは上にも記述していますが、<strong>複数のinput要素をまとめるspanを用意してそのspan要素にid、classを割り当てます</strong>。</p>
					<p><strong>classはgroupが必須になり、あとはinput単体で指定するものが使えます</strong>。なので今回の場合はclassには <strong>group, required, hankaku, email</strong> が入ることになります。</p>
					<p>以下はradioボタンの例です。</p>
					<pre>&lt;ul class=&quot;radio&quot; id=&quot;radioarray&quot;&gt;
&nbsp;&nbsp;&lt;li&gt;&lt;label for=&quot;radio1&quot;&gt;&lt;input type=&quot;radio&quot; name=&quot;radio&quot; id=&quot;radio1&quot; value=&quot;&quot; /&gt; 男&lt;/label&gt;&lt;/li&gt;
&nbsp;&nbsp;&lt;li&gt;&lt;label for=&quot;radio2&quot;&gt;&lt;input type=&quot;radio&quot; name=&quot;radio&quot; id=&quot;radio2&quot; value=&quot;&quot; /&gt; 女&lt;/label&gt;&lt;/li&gt;
&lt;/ul&gt;</pre>
					<p>radio、checkboxは例外になり、必須項目としてしかチェック出来ないので<strong>classにrequiredは必要ありません</strong>。</p>
					<p>上記の例ではグループ化がspan要素ではなくul要素になっていますがCSSでinline指定<a href="#note1">(*1)</a>すれば大丈夫です。要はdisplayプロパティがinline(inline-blockでも可)であればなんでも大丈夫です。</p>
					<p id="note1" class="attention"><strong>*1) 幅を持たせたブロック要素でも可ブロック要素は幅初期値が親に対して100%になるので エラーチップが画面から見切れることがあります。</strong></p>
					<h3 id="install4">4. select要素を対象にする場合</h3>
					<p>select要素を対象にする場合は</p>
					<pre>&lt;select name=&quot;sex&quot; id=&quot;sex&quot; class=&quot;required&quot;&gt;
&nbsp;&nbsp;&lt;option value=&quot;&quot; selected=&quot;selected&quot;&gt;選択してください&lt;/option&gt;
&nbsp;&nbsp;&lt;option value=&quot;male&quot;&gt;男&lt;/option&gt;
&nbsp;&nbsp;&lt;option value=&quot;female&quot;&gt;女&lt;/option&gt;
&lt;/select&gt;</pre>
					<p>のようにvalueが空のoption要素を含めます。value属性を指定しないとvalidationは行われません。初期値には<strong>必ず空のvalue属性を指定してください</strong>。(初期値にはselected属性を指定することが<a href="http://w3g.jp/xhtml/dic/option#selected">推奨</a>されています)<br />
					select要素は選択されているoptionが変わった場合にvalidationが行われます。</p>
					<h3 id="install5">5. 再入力をチェックする場合</h3>
					<p>メールアドレスやパスワードなど再入力を促す項目がある場合、それもvalidationの対象にすることができます。たとえば、</p>
					<pre>&lt;input type=&quot;text&quot; id=&quot;mail&quot; name=&quot;mail&quot; value=&quot;&quot; class=&quot;email hankaku required&quot; /&gt;</pre>
<p>の後に</p>
<pre>&lt;input type=&quot;text&quot; id=&quot;remail&quot; name=&quot;remail&quot; value=&quot;&quot; class=&quot;&quot; /&gt;
</pre>
					<p>といった再入力項目があるとします。この項目は<strong>先のメールアドレス入力項目 input#mail と同じものを入力してもらう</strong>ので</p>
					<pre>&lt;input type=&quot;text&quot; id=&quot;remail&quot; name=&quot;remail&quot; value=&quot;&quot; class=&quot;retype-mail required&quot; /&gt;</pre>
<p>のようにクラスに <strong>retype-対象にする項目のID</strong> を含めます。今回は<strong>対象にする項目(メールアドレス入力項目)のIDはmailとなっているので retype-mail</strong> としています。</p>
<p>再入力チェックは複数項目の場合も有効で、単純に3と組み合わせるだけです。</p>
<pre>&lt;span class=&quot;group required hankaku email&quot; id=&quot;groupmail&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;mail2&quot; id=&quot;mail2&quot; value=&quot;&quot; class=&quot;&quot; /&gt;
@
&lt;input type=&quot;text&quot; name=&quot;mail3&quot; id=&quot;mail3&quot; value=&quot;&quot; class=&quot;&quot; /&gt;&lt;/span&gt;</pre>
					<p>の再入力項目は</p>
					<pre>&lt;span class=&quot;group required retype-groupmail&quot; id=&quot;regroupmail&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;remail2&quot; id=&quot;remail3&quot; value=&quot;&quot; class=&quot;&quot; /&gt;
@
&lt;input type=&quot;text&quot; name=&quot;remail3&quot; id=&quot;remail3&quot; value=&quot;&quot; class=&quot;&quot; /&gt;&lt;/span&gt;</pre>
					<p>となります。</p>
					<h3 id="install6">6. 入力文字数をチェックする場合</h3>
					<p>パスワードなどの項目に入力文字数の制限をかけたいときは</p>
					<pre>&lt;input type=&quot;password&quot; id=&quot;pass&quot; name=&quot;pass&quot; value=&quot;&quot; class=&quot;required min6 max12&quot; /&gt;</pre>
<p>のようにclassに</p>
<ul>
<li>minX</li>
<li>maxX (Xはともに任意の数字)</li>
</ul>
<p>を含ませます。もちろんmin・maxどちらか一方だけを指定でき、また他のすべてのチェックと併用することができます。<br />
ただし複数項目のメールアドレスは 文字列に@を含めるので1文字多く数えられます。(メールアドレスに入力文字数制限を使うことはないと思うのでそのままにしてます。)</p>
<h3 id="install7">7. アクティベート</h3>
<p>最後に任意のJSファイルで以下のように実行します。</p>
<pre>$(function(){
&nbsp;&nbsp;$(&quot;form&quot;).validation();
});</pre>
					<h3 id="install8">8. アクティベート（ここでルールを指定する場合）</h3>
					<p>input要素に直接ルール（class）を指定しなくても、実行時に指定することができます。<strong>この方法のほうがHTMLを極力汚さないのでおすすめ</strong>です。（ちょっとだけ処理遅いですが）</p>
					<pre>$("form")
&nbsp;&nbsp;.exValidation({
&nbsp;&nbsp;&nbsp;&nbsp;rules: {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: "required",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kana: "required katakana",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;email: "required email hankaku group",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pass: "required min6 max12",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;repass: "required retype-pass",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;radio: "radio",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;checkbox: "checkbox"
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;});</pre>
					<p>上記のように、rulesというオプションで指定します。値はそれぞれ [id: rules] となります。</p>
					<h2 id="options">オプション</h2>
					<p>exValidationは汎用性を持たせるために色々なオプションがあります。</p>
					<table class="lftable">
					<tr>
					<th>オプション項目</th>
					<th>値</th>
					</tr>
					<tr>
					<td>rules</td>
					<td>classではなく、実行時に指定する場合 rules: { id, rules, &#8230; }</td>
					</tr>
					<tr>
					<td>errInsertPos</td>
					<td>エラーの挿入位置。デフォルトはbody直下、他に対象要素の前(before)と後ろ(after)</td>
					</tr>
					<tr>
					<td>err</td>
					<td>エラー時に実行するカスタム処理 function(target, id, message) {}</td>
					</tr>
					<tr>
					<td>ok</td>
					<td>処理が通ったときに実行するカスタム処理 funtion(target, id) {}</td>
					</tr>
					<tr>
					<td>errFocus</td>
					<td>エラーが表示されているとき、そのinput要素にfocusすると他のエラーにfadeOutというclassを付与する。デフォルトはfalse</td>
					</tr>
					<tr>
					<td>errHoverHide</td>
					<td>エラーにカーソルを乗せると非表示にする</td>
					</tr>
					<tr>
					<td>stepValidation</td>
					<td>複数個のエラーがある場合、ひとつひとつ処理する。デフォルトはfalse</td>
					</tr>
					<tr>
					<td>scrollToErr</td>
					<td>エラーがある場合、画面一番上のエラーまでスクロールする。デフォルトはtrue</td>
					</tr>
					<tr>
					<td>scrollDuration</td>
					<td>スクロールのduration</td>
					</tr>
					<tr>
					<td>scrollAdjust</td>
					<td>スクロール量の微調整。デフォルトは-10</td>
					</tr>
					<tr>
					<td>customScrollAdjust</td>
					<td>スクロール位置の指定。デフォルトはfalseで、<strong>数値または数値を返すfunctionを指定</strong></td>
					</tr>
					<tr>
					<td>errPosition</td>
					<td>errInsertPosがbodyならabsolute、before(after)ならfixedを指定する。デフォルトはabsolute</td>
					</tr>
					<tr>
					<td>errTipPos</td>
					<td>エラーの表示位置。errPositionがabsoluteのときのみ。左か右か。デフォルトはright</td>
					</tr>
					<tr>
					<td>errTipCloseBtn</td>
					<td>エラーに閉じるボタンを表示するかしないか。デフォルトはtrue</td>
					</tr>
					<tr>
					<td>errTipCloseLabel</td>
					<td>閉じるボタンのラベル。</td>
					</tr>
					<tr>
					<td>errZIndex</td>
					<td>エラーのzIndex。指定があるときのみ。デフォルトは500</td>
					</tr>
					<tr>
					<td>errMsgPrefix</td>
					<td>エラーメッセージの頭に付ける文字</td>
					</tr>
					<tr>
					<td>customAddError</td>
					<td>エラーがあるとき、スクロール前に実行する関数</td>
					</tr>
					<tr>
					<td>customClearError</td>
					<td>エラーがないとき、Submit前に実行する関数</td>
					</tr>
					<tr>
					<td>customSubmit</td>
					<td>デフォルトのポストバックをキャンセルして実行する。Ajaxで通信を行う場合は、ここで指定する</td>
					</tr>
					<tr>
					<td>customListener</td>
					<td>input要素などにbindするlistenerを変更できる</td>
					</tr>
					<tr>
					<td>customBind</td>
					<td>2つのボタンにbindする場合、もう一方はこちらで指定 { object: $(), listener: &#8216;hoge&#8217;, callback: function }</td>
					</tr>
					<tr>
					<td>customGetErrHeight</td>
					<td>その内追記します</td>
					</tr>
					<tr>
					<td>firstValidate</td>
					<td>デフォルトはfalseで、送信ボタンを押すまで実行しない。trueにすると、入力毎にバリデーションを行う</td>
					</tr>
					</table>
					<p>使い方は見てるだけだと分からないと思うので、具体的なサンプルを2つ用意してます。</p>
					<ul>
					<li><a href="http://ex-validation.googlecode.com/svn/trunk/index.html">サンプル1: エラーを右上に表示</a></li>
					<li><a href="http://ex-validation.googlecode.com/svn/trunk/index2.html">サンプル2: エラーを下に表示</a></li>
					</ul>
					<h3 id="sample1">サンプルのパターン1</h3>
					<p><img src="http://5509.me/wp-content/uploads/2010/08/validation.png" alt="" title="validation" width="450" height="202" class="alignnone size-full wp-image-2872" /></p>
					<p><a href="http://ex-validation.googlecode.com/svn/trunk/index.html">サンプル1</a>の形式で実行する場合は以下のようにします。（サンプルではrulesをオプションで指定しています）</p>
					<pre>$("form")
&nbsp;&nbsp;.exValidation({
&nbsp;&nbsp;&nbsp;&nbsp;rules: {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: "required",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kana: "required katakana",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;email: "required email hankaku group",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pass: "required min6 max12",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;repass: "required retype-pass",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;radio: "radio",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;checkbox: "checkbox"
&nbsp;&nbsp;&nbsp;&nbsp;},
&nbsp;&nbsp;&nbsp;&nbsp;stepValidation: true
&nbsp;&nbsp;}); </pre>
					<h3 id="sample2">サンプルのパターン2</h3>
					<p><img src="http://5509.me/wp-content/uploads/2010/08/validation21.png" alt="" title="validation2" width="450" height="201" class="alignnone size-full wp-image-2935" /></p>
					<p><a href="http://ex-validation.googlecode.com/svn/trunk/index2.html">サンプル2</a>の形式で実行する場合は以下の通りです。errInsertPosとerrPositionを指定することでサンプル2のような形のエラー表示にすることができます。</p>
					<pre>$("form")
&nbsp;&nbsp;.exValidation({
&nbsp;&nbsp;&nbsp;&nbsp;rules: {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: "required",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kana: "required katakana",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;email: "required email hankaku group",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pass: "required min6 max12",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;repass: "required retype-pass",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;radio: "radio",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;checkbox: "checkbox"
&nbsp;&nbsp;&nbsp;&nbsp;},
&nbsp;&nbsp;&nbsp;&nbsp;errInsertPos: 'after',
&nbsp;&nbsp;&nbsp;&nbsp;errPosition: 'fixed'
&nbsp;&nbsp;});</pre>
					<h3 id="errfocus">errFocusを使う</h3>
					<p>errFocusを使うとエラーが出ている状態で対象要素にフォーカスすると、エラーチップ以外に[<strong>fadeOut</strong>]というclassを付与します。デフォルトでは<strong> .fadeOut { opacity: .2 } </strong>を指定しているので他のエラーが透ける感じですね。(ただしIEでは動作しません。。)</p>
					<p><img src="http://5509.me/wp-content/uploads/2010/08/validation3.png" alt="" title="validation3" width="450" height="200" class="alignnone size-full wp-image-2936" /></p>
					<p><a href="http://ex-validation.googlecode.com/svn/trunk/index4.html">errFocusのサンプル</a></p>
					<h3 id="ajaxpost">Ajaxでポストする</h3>
					<p>exValidationでは<strong>通常のポストバックに加え、customSubmitというオプションを使うことでAjaxによるポストや、その他独自のポストを行うことができます</strong>。customSubmit実行時は通常のポストバックはキャンセルされます。</p>
					<pre>$("form")
&nbsp;&nbsp;.exValidation({
&nbsp;&nbsp;&nbsp;&nbsp;customSubmit: function() {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$.ajax({
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;url: "data.php",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type: "POST",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dataType: "json",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data: {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: $("#name").val()
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;success: function(data) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;console.log(data);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;});</pre>
					<p>下記のサンプルで、エラーがない状態でポストすると、コンソールログにObjectが表示されます。（コンソールがある環境で確認してください）</p>
					<p><a href="http://5509.media-track.biz/project/validation/">Ajaxポストのサンプル</a></p>
					<h3 id="custombind">任意の要素にバリデーションをbindする</h3>
					<p>customBindを使うと<strong>任意のボタンぽい要素（例えばアンカーとか）にポスト時のバリデーションを付加</strong>することができます。ポスト内容はcallbackで設定します。</p>
					<pre>customBind: {
&nbsp;&nbsp;object: $(任意のhoge),
&nbsp;&nbsp;listener: '任意のpiyo',
&nbsp;&nbsp;callback: function() { /*実行したいfuga*/ }
}
</pre>
					<p>例えば、日記を書くフォームがあったとして、<strong>通常のボタンに通常Ajaxポスト、プレビューボタンにはcustomBindでAjaxポスト、などのように使うことができます</strong>。</p>
					<pre>$("form")
&nbsp;&nbsp;.exValidation({
&nbsp;&nbsp;&nbsp;&nbsp;customBind: {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;object: $('#submit'),
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;listener: 'click',
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;callback: function() {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert('Fake POST');
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;});</pre>
					<p>サンプルではただのアンカー要素にcustomBindしています。</p>
					<p><a href="http://ex-validation.googlecode.com/svn/trunk/index5.html">customBindのサンプル</a></p>
					<h3 id="customError">エラー時に関数を実行する、エラーがない場合に関数を実行する、スクロール位置を固定する</h3>
					<h4 id="customAddError">エラー時に関数を実行する</h4>
					<p>エラーがあったときに関数を実行したい場合は<strong>customAddError</strong>を指定します。指定した関数はスクロール前に実行されます。</p>
					<h4 id="customClearError">エラーがない場合に関数を実行する</h4>
					<p>エラーがないときに関数を実行した場合は<strong>customClearError</strong>を指定します。指定した関数はsubmitやcustomSubmit前に実行されます。</p>
					<h4 id="customScrollAdjust">スクロール位置を固定する</h4>
					<p>スクロール位置を固定したい場合は、<strong>customScrollAdjust</strong>を指定します。customScrollAdjustはデフォルトはfalseになっていますが、<strong>数値または数値を返す関数を指定</strong>できます。</p>
					<p>この3つを一連の流れで実装したサンプルがありますので確認してください。</p>
					<pre>var validation = $("form")
&nbsp;&nbsp;.exValidation({
&nbsp;&nbsp;&nbsp;&nbsp;rules: {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: "required",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kana: "required katakana",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;email: "required email hankaku group",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pass: "required min6 max12",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;repass: "required retype-pass",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;radio: "radio",
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;checkbox: "checkbox"
&nbsp;&nbsp;&nbsp;&nbsp;},
&nbsp;&nbsp;&nbsp;&nbsp;errInsertPos: 'after',
&nbsp;&nbsp;&nbsp;&nbsp;errPosition: 'fixed',
&nbsp;&nbsp;&nbsp;&nbsp;customAddError: function() {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( $("#alert").length&lt;1 ) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$("p.attention").before("&lt;div id=\"alert\"&gt;&lt;strong&gt;入力内容に誤りがあります。&lt;/strong&gt;&lt;/div&gt;");
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;},
&nbsp;&nbsp;&nbsp;&nbsp;customClearError: function() {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$("#alert").remove();
&nbsp;&nbsp;&nbsp;&nbsp;},
&nbsp;&nbsp;&nbsp;&nbsp;customScrollAdjust: function() {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return $("#alert").offset().top;
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;});</pre>
					<p>ポイントは<strong>customScrollAdjustではcustomAddErrorで表示した追加エラー分のポジションを取得して返している</strong>ところでしょう。</p>
					<p><a href="http://ex-validation.googlecode.com/svn/trunk/index6.html">スクロール位置の固定やエラー時の追加関数のサンプル</a></p>
					<h2 id="api">API</h2>
					<p>実行時にインスタンスを指定しておくと、APIを利用することができます。</p>
					<pre>var validation = $('form').exValidation();</pre>
<table class="lftable">
<tr>
<td>API</td>
<td>値</td>
</tr>
<tr>
<td>laterCall</td>
<td>function(id) {}<br />任意のinput要素に対してバリデーションを任意のタイミングで行う</td>
</tr>
</table>
<h3>laterCall</h3>
<p>laterCallを使うと<strong>任意のタイミングで指定したフォーム要素をバリデーション</strong>できます。</p>
<pre>var validation = $('form').exValidation();
$('#button').click(function() {
&nbsp;&nbsp;validation.laterCall('#name');
});</pre>
					<p><a href="http://ex-validation.googlecode.com/svn/trunk/index3.html">laterCallのサンプル</a></p>
					<h3 id="selectable">jQselectableとの併用</h3>
					<p>laterCallを利用すると<a href="http://5509.me/log/jqueryselectable">jQselectable</a>と併用することができます。具体例は<a href="http://ex-validation.googlecode.com/svn/trunk/index.html">サンプル</a>を確認してください。</p>
					<pre>var validation = $("form").exValidation();
var selectable = $('#pref').selectable({
&nbsp;&nbsp;callback: function() {
&nbsp;&nbsp;&nbsp;&nbsp;validation.laterCall('#pref');
&nbsp;&nbsp;}
});</pre>
					<h2 id="reg">バリデーションルール</h2>
					<p><a href="http://ex-validation.googlecode.com/svn/trunk/js/exchecker-ja.js">exChecker-ja.js</a>を読みこめば基本的なバリデーションは行えますが、独自のルールを使いたいときは、exChecker-ja.jsを修正、追記するか、新しいバリデーションルールを書いたファイルを読み込みます。バリデーションルールは以下のように定義します。</p>
					<pre>(function($) {
&nbsp;&nbsp;// Extend validation rules
&nbsp;&nbsp;$.extend(validationRules, {
&nbsp;&nbsp;&nbsp;&nbsp;retype: [
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'&#20837;&#21147;&#20869;&#23481;&#12364;&#30064;&#12394;&#12426;&#12414;&#12377;',
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function(txt, t) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var elm = $('#'+$(t).attr('class').split('retype\-')[1].split(/\b/)[0]);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( elm.hasClass('group') ) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var chktxt = $('input', elm), txt = $('input', t);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for ( var i=0, flag=false; i&lt;chktxt.length; i++ ) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( chktxt[i].value==txt[i].value ) flag = true;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else flag = false;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( flag ) return true;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return elm.val() == txt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;],
&nbsp;&nbsp;&nbsp;&nbsp;email: [
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'&#27491;&#12375;&#12356;&#12513;&#12540;&#12523;&#12450;&#12489;&#12524;&#12473;&#12398;&#24418;&#24335;&#12434;&#20837;&#21147;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;',
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/^[^\@]+?@[A-Za-z0-9_\.\-]+\.+[A-Za-z\.\-\_]+$/
&nbsp;&nbsp;&nbsp;&nbsp;]
&nbsp;&nbsp;});
})(jQuery);</pre>
					<p>exValidation側で用意している<strong>validationRules</strong>をextendする形でルールを記述します。バリデーションはclass名で行うので</p>
					<pre>class: [
&nbsp;&nbsp;"エラーメッセージ",
&nbsp;&nbsp;/RegExp/ or function(txt, t) {}
]</pre>
					<p>のようにハッシュのプロパティの中にメッセージとルールを配列として記述します。単純に正規表現だけでチェックするときは、<strong>Array[1]には/RegExp/</strong>、その中でさらに分岐などの条件を含む複雑なバリデーションルールの場合は、<strong>Array[1]にfunction(受け取るテキスト, 対象フォーム要素のid: 省略可) {}</strong>で記述します。</p>
					<h2 id="other">その他</h2>
					<p>たぶんバグとか潜んでるので、あればコメントやTwitterで教えてください。前のvalidation.jsもそうでしたが、利用してる人の支えで安定していくので、、よろしくお願いします。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/exvalidation/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>[訂正:間違い] formのaction先が異なる文字コードのときに文字化けさせない</title>
		<link>http://5509.me/log/form-encoding</link>
		<comments>http://5509.me/log/form-encoding#comments</comments>
		<pubDate>Mon, 02 Aug 2010 12:10:00 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[memo]]></category>
		<category><![CDATA[文字コード]]></category>
		<category><![CDATA[文字化け]]></category>

		<guid isPermaLink="false">http://5509.me/?p=2847</guid>
		<description><![CDATA[					10.08.03追記：この記事を見てくれた方へごめんなさい、以下の内容は検索エンジン側が &#038;charset=UTF-8 でパラメータを受け付けるときのみに有効な方法でした。つまり間違いです。
				 [...]]]></description>
			<content:encoded><![CDATA[					<p class="attention" style="border: 2px solid rgb(226, 154, 27); padding: 5px 10px; background: none repeat scroll 0% 0% rgb(255, 255, 255);"><strong>10.08.03追記：この記事を見てくれた方へ</strong><br />ごめんなさい、以下の内容は<em>検索エンジン側が &#038;charset=UTF-8 でパラメータを受け付けるときのみに有効</em>な方法でした。つまり間違いです。</p>
					<p>サイトの検索で外部検索エンジンを使うときなど、<strong>サイトはUTF-8なのに用意された検索エンジンはShift_JIS、、のようにサイトと検索エンジン側の文字コードが違う</strong>、というのはよくある話で、そうすると文字化けを起こします。</p>
					<h2>hiddenパラメータで文字コードを送る</h2>
					<p>そういうときはhiddenパラメータで<strong>サイト側の文字コード</strong>を埋め込んでおくといいです。</p>
					<pre>&lt;input type="hidden" name="charset" value="UTF-8" /&gt;</pre>
<p>以下のようにform要素に入れておきます。</p>
<pre>&lt;form action="hogehoge"&gt;
&nbsp;&nbsp;&lt;input type="hidden" name="charset" value="UTF-8" /&gt;
&nbsp;&nbsp;&lt;input type="text" name"text" value="" /&gt;
&nbsp;&nbsp;&lt;input type="submit" value="submit" /&gt;
&lt;/form&gt;</pre>
					<h2>accept-charset属性</h2>
					<p>formのaccept-charsetという属性で<strong>検索エンジン側の文字コードを指定する</strong>ことでも回避できるようですが、IEが未対応なようで、実用的ではないです。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/form-encoding/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>リンクが一斉に捕まえてごらーんな状態になるブックマークレット</title>
		<link>http://5509.me/log/runaway-bookmarklet</link>
		<comments>http://5509.me/log/runaway-bookmarklet#comments</comments>
		<pubDate>Thu, 01 Jul 2010 03:49:55 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Bookmarklet]]></category>
		<category><![CDATA[dt]]></category>
		<category><![CDATA[ネタ]]></category>

		<guid isPermaLink="false">http://5509.me/?p=2820</guid>
		<description><![CDATA[					先日公開したリンクが逃げ回るjDTRunAwayをブックマークレットにしました。ブログやサイトの地雷リンクにいかがですか？鬱陶しいこと間違いないです。
					
					概要など
					リンクがマウスカ [...]]]></description>
			<content:encoded><![CDATA[					<p>先日公開したリンクが逃げ回る<a href="http://5509.me/log/jdtrunaway">jDTRunAway</a>をブックマークレットにしました。<strong>ブログやサイトの地雷リンクにいかがですか？</strong>鬱陶しいこと間違いないです。<br />
					<span id="more-2820"></span></p>
					<h2>概要など</h2>
					<p>リンクがマウスカーソルから逃げ回ります。それだけです。</p>
					<h3>注意とか</h3>
					<ul>
					<li>捕まえにくいやつもいれば簡単に捕まえられるやつもいます</li>
					<li>小さいやつは逃げ足が速いです注意。</li>
					<li>リンクが多ければ多いほど重くなります。</li>
					<li>IEだとだいたい重いです。</li>
					<li>Chromeでさくさく。</li>
					</ul>
					<h3>使い方</h3>
					<p>以下のリンクをブックマークバーにドラッグして、ブックマークバーからクリックするだけです。また、サイトのリンクに埋め込むことで、自分のサイトで使うこともできます。</p>
					<p><a href="javascript:(function(){var s=document.createElement('script');s.charset='UTF-8';s.src='http://5509.me/sample/bookmarklet/runaway.js'; document.body.appendChild(s)})();">つかまえてごらーん</a></p>
					<p>どんなものか分からない方は、とりあえず上のリンクをクリックしてみるといいです。</p>
					<h3>ブックマークレットのソース</h3>
					<pre>javascript:(function(){var s=document.createElement('script');s.charset='UTF-8';s.src='http://5509.me/sample/bookmarklet/runaway.js'; document.body.appendChild(s)})();</pre>
<h3>ソースコード</h3>
<p><a href="http://5509.me/sample/bookmarklet/runaway.js">RunAway.js</a></p>
<h2>うーん</h2>
<p>誰得プラグインシリーズは大体ブックマークレットのほうが面白かったのかもしれないとか思ったり思わなかったり。</p>
<h2>Thanks</h2>
<p>アニメーション部分のソースは<a href="http://twitter.com/hisasann">hisasann</a>さんが以下の記事で作成していたものを、許可を得て転用しています。</p>
<p><a href="http://hisasann.com/housetect/2009/04/jqueryrunawayfrommouse_part2.html">jQueryでマウスから逃げるRunAwayFromMouse書いてみた Part2 | HouseTect, JavaScript Blog </a></p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/runaway-bookmarklet/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ブログ記事でよく見られている箇所とかユーザーの動きを晒してみる</title>
		<link>http://5509.me/log/userheat-summary-math</link>
		<comments>http://5509.me/log/userheat-summary-math#comments</comments>
		<pubDate>Wed, 30 Jun 2010 01:36:39 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[WebDev]]></category>
		<category><![CDATA[UserHeat]]></category>
		<category><![CDATA[まとめ]]></category>
		<category><![CDATA[ユーザビリティ]]></category>

		<guid isPermaLink="false">http://5509.me/?p=2755</guid>
		<description><![CDATA[					
					ユーザーローカルさんのUserHeatというサービスを使っているのですが、マウスの動き・よくクリックされている箇所・どこがよく見られている等が一目で分かるので、ナビゲーションや記事の書き方の改善など [...]]]></description>
			<content:encoded><![CDATA[					<p><img src="http://5509.me/wp-content/uploads/2010/06/5509validation.png" alt="" title="5509validation" width="450" height="273" class="alignnone size-full wp-image-2764" /></p>
					<p><a href="http://www.userlocal.jp/">ユーザーローカル</a>さんの<a href="http://userheat.com/">UserHeat</a>というサービスを使っているのですが、マウスの動き・よくクリックされている箇所・どこがよく見られている等が一目で分かるので、ナビゲーションや記事の書き方の改善などに役立てることができますね。（<strong>全然役立てれてませんけど</strong>）<br />
					<span id="more-2755"></span></p>
					<h2>どこが見られてるの？</h2>
					<p>個人的に全然役に立てられていないこのUserHeatでの集計結果ですが、ひょっとしてひょっとすると誰かの役に立つかもしれないので晒して共有します。ただページが長くて全部入りきってないものがほとんどですけど…その辺は想像でカバーですね！</p>
					<p>ちなみにサムネイルは<strong>左から順にマウストラック、クリックマップ、ヒートマップ</strong>です。サムネイルクリックでフルサイズのキャプチャを開きます。</p>
					<p>あ、どなたか解析してくれる人募集してます。。</p>
					<h3>リアルタイムフォームバリデーション jQuery.validation.js</h3>
					<p><a href="http://5509.me/wp-content/uploads/2010/06/5509validation_mouse.jpg"><img src="http://5509.me/wp-content/uploads/2010/06/5509validation_mouse-150x150.jpg" alt="" title="5509validation_mouse" width="150" height="150" class="alignnone size-thumbnail wp-image-2759" /></a> <a href="http://5509.me/wp-content/uploads/2010/06/5509validation_click.jpg"><img src="http://5509.me/wp-content/uploads/2010/06/5509validation_click-150x150.jpg" alt="" title="5509validation_click" width="150" height="150" class="alignnone size-thumbnail wp-image-2757" /></a> <a href="http://5509.me/wp-content/uploads/2010/06/5509validation_heat.jpg"><img src="http://5509.me/wp-content/uploads/2010/06/5509validation_heat-150x150.jpg" alt="" title="5509validation_heat" width="150" height="150" class="alignnone size-thumbnail wp-image-2758" /></a></p>
					<p>自作プラグインの紹介ページで、ページ上部にダウンロードインストールなど主要セクションがあり、中盤以下は細かい使い方になってます。ありがたいことにダウンロードに集中してますね。ほんとありがとうございます。</p>
					<ul>
					<li><a href="http://5509.me/log/realtimeformvalidation">リアルタイムフォームバリデーションのアーカイブ</a></li>
					</ul>
					<h3>CMSとしてのWordPressでサイト構築をするときに便利な13のプラグイン</h3>
					<p><a href="http://5509.me/wp-content/uploads/2010/06/5509wp_mouse.jpeg"><img src="http://5509.me/wp-content/uploads/2010/06/5509wp_mouse-150x150.jpg" alt="" title="5509wp_mouse" width="150" height="150" class="alignnone size-thumbnail wp-image-2794" /></a> <a href="http://5509.me/wp-content/uploads/2010/06/5509wp_click.jpeg"><img src="http://5509.me/wp-content/uploads/2010/06/5509wp_click-150x150.jpg" alt="" title="5509wp_click" width="150" height="150" class="alignnone size-thumbnail wp-image-2792" /></a> <a href="http://5509.me/wp-content/uploads/2010/06/5509wp_heat.jpeg"><img src="http://5509.me/wp-content/uploads/2010/06/5509wp_heat-150x150.jpg" alt="" title="5509wp_heat" width="150" height="150" class="alignnone size-thumbnail wp-image-2793" /></a></p>
					<p>よくあるプラグインまとめページです。上の方からざっと見てブックマークして離脱、という行動パターンが多そうです。これは一番紹介したかった<a href="http://www.tinybeans.net/blog/download/wp-plugin/cfg-utility-100.html">Custom Field GUI Utility</a>にクリックが集中してるのでよかったパターンですね。</p>
					<ul>
					<li><a href="http://5509.me/log/using-wordpress-as-cms">CMSとして使うWordPressプラグインのアーカイブ</a></li>
					</ul>
					<h3>jQueryを使ったスライド開閉メニューをCookieでコントロールする</h3>
					<p><a href="http://5509.me/wp-content/uploads/2010/06/5509ctrl_mouse.jpeg"><img src="http://5509.me/wp-content/uploads/2010/06/5509ctrl_mouse-150x150.jpg" alt="" title="5509ctrl_mouse" width="150" height="150" class="alignnone size-thumbnail wp-image-2799" /></a> <a href="http://5509.me/wp-content/uploads/2010/06/5509ctrl_click.jpeg"><img src="http://5509.me/wp-content/uploads/2010/06/5509ctrl_click-150x150.jpg" alt="" title="5509ctrl_click" width="150" height="150" class="alignnone size-thumbnail wp-image-2797" /></a> <a href="http://5509.me/wp-content/uploads/2010/06/5509ctrl_heat.jpeg"><img src="http://5509.me/wp-content/uploads/2010/06/5509ctrl_heat-150x150.jpg" alt="" title="5509ctrl_heat" width="150" height="150" class="alignnone size-thumbnail wp-image-2798" /></a></p>
					<p>チュートリアル系の記事です。比較的下のほうまで見られてますね。ソースコード部分に集中してそうな感じなので、もっと補足コメント入れたほうがいいのかも。</p>
					<ul>
					<li><a href="http://5509.me/log/control-slide-navigation-with-jquery-cookie">アコーディオンナビゲーションのコントロールのアーカイブ</a></li>
					</ul>
					<h3>じわじわ便利なjQuery1.4で追加された機能いろいろ+α</h3>
					<p><a href="http://5509.me/wp-content/uploads/2010/06/5509jquery_mouse.jpeg"><img src="http://5509.me/wp-content/uploads/2010/06/5509jquery_mouse-150x150.jpg" alt="" title="5509jquery_mouse" width="150" height="150" class="alignnone size-thumbnail wp-image-2805" /></a> <a href="http://5509.me/wp-content/uploads/2010/06/5509jquery_click.jpeg"><img src="http://5509.me/wp-content/uploads/2010/06/5509jquery_click-150x150.jpg" alt="" title="5509jquery_click" width="150" height="150" class="alignnone size-thumbnail wp-image-2803" /></a> <a href="http://5509.me/wp-content/uploads/2010/06/5509jquery_heat.jpeg"><img src="http://5509.me/wp-content/uploads/2010/06/5509jquery_heat-150x150.jpg" alt="" title="5509jquery_heat" width="150" height="150" class="alignnone size-thumbnail wp-image-2804" /></a></p>
					<p>むしろ1.4の新機能よりも伝えたかったjQueryの機能部分が全然見られてないYO。。やっぱりおまけはおまけでしかない感じですね。書き方が悪いのか。。</p>
					<ul>
					<li><a href="http://5509.me/log/jquery1-4-plus-alpha">jQuery1.4の新機能とあんまり知られてない機能のアーカイブ</a></li>
					</ul>
					<h2>まとめ</h2>
					<p>はてなスターが面白いほど認知されてないｗ<br />
					たしかにデザインというか色味的にみえにくいですし。。それか左の記事メタ部分にその辺（SBM、Twitter含め）置いて、スクロールに付いてきたほうがクリックされそう。</p>
					<p>広告がもっと入ってるブログとか、実際のサイトの結果で見たらもっとおもしろいかもしれませんね。</p>
					<p>ちなみに<a href="http://userheat.com/">UserHeat</a>のトップページ下部にはサンプルとして、登録されているサイトの集計結果を一部見ることができる（そもそも集計結果のページはURLさえあれば誰でも見れます）ので、参考になりますよ。<a href="http://userheat.com/map/7219687d3c31843d35a44b2c_100032/heatmap/">nanapi</a>とか<a href="http://userheat.com/map/b26d2fa8f16d1902359059d2_100027/heatmap/">百式</a>の集計結果など参考になりそうです。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/userheat-summary-math/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>知っておくべきjQueryオブジェクトの扱い</title>
		<link>http://5509.me/log/jquery-and-dom-object</link>
		<comments>http://5509.me/log/jquery-and-dom-object#comments</comments>
		<pubDate>Tue, 29 Jun 2010 05:48:09 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[memo]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://5509.me/?p=2735</guid>
		<description><![CDATA[					
					jQueryオブジェクトからDOM要素にアクセスする方法やメソッドで渡されるjQueryオブジェクトの扱いなど基本といえば基本ですが、再認識メモです。なので、タイトルは自分に覚えとけよってことです。 [...]]]></description>
			<content:encoded><![CDATA[					<p><img src="http://5509.me/wp-content/uploads/2010/06/jquerydom.png" alt="" title="jquerydom" width="327" height="246" class="alignnone size-full wp-image-2743" /></p>
					<p>jQueryオブジェクトからDOM要素にアクセスする方法やメソッドで渡されるjQueryオブジェクトの扱いなど基本といえば基本ですが、再認識メモです。なので、タイトルは自分に覚えとけよってことです。。<br />
					<span id="more-2735"></span></p>
					<h2>jQueryオブジェクトからDOMにアクセスする</h2>
					<p>$(&#8216;#id&#8217;)にすれば#idを取得できますが、この状態だとDOM要素を選らんでいる状態ではないので、DOM要素のプロパティにはアクセスできません。</p>
					<pre>$('#link').href
// これは無理</pre>
					<h3>1-1. $()[0]</h3>
					<p>要素を引数にしたjQueryオブジェクトはDOM要素が配列で格納されている状態なので</p>
					<pre>$('#link')[0]
// DOM要素の参照になる

console.debug($('#link')[0]);
// 評価結果 - DOM要素
// &lt;a id="link" href="llink.html"&gt;</pre>
					<p>とすることで配列の中からDOM要素を指定することができるので、プロパティにアクセスすることができます。</p>
					<pre>var href = $('#link')[0].href;
<del datetime="2010-06-29T07:01:49+00:00">// 以下と同じですけどね</del>
var href = $('#link').attr('href');</pre>
					<p><strong>※ 追記 10.06.29</strong><br />
					コメントいただきましたので追記します。上記は同じ値ではないようなので注意が必要です。（僕が注意します）</p>
					<blockquote><p>this.hrefはDOM上の記述に寄らずhttp://からのパスが返りますが、$(this).attr(&#8216;href&#8217;)はDOM上の記述に沿った内容が返ります。</p>
					<p>via: <a href="http://tech.kayac.com/archive/jquery-first-questions.html">jQueryを使い始めたときに感じる 13の疑問</a></p></blockquote>
					<h3>1-2. $().get(0)</h3>
					<p>そもそも配列だけを抜きたいときは.get()メソッドを使いますが.get(0)というように引数に0(index)を入れると上記と同じ効果が得られます。</p>
					<pre>$('#link')[0]
// ↑と↓は同じ意味
$('#link').get(0)

console.debug($('#link').get(0));
// 評価結果 - DOM要素
// &lt;a id="link" href="llink.html"&gt;</pre>
					<h2>jQueryオブジェクトに対してメソッドで渡されるthisの扱い</h2>
					<p>DOM要素の取得方法は上記の通りですが、$().each(function() {});のようにjQueryがもっているメソッドを実行する際、メソッド内で実行対象を受け取ることができます。ただ、この受け取れるthisについても補足しておくと、、</p>
					<h3>2-1. eachとかclickなどのjQueryメソッド内でのthis</h3>
					<p>これはちょっと肝なのですが、eachメソッドやclickメソッドなどのjQueryがもともと持っているメソッド内で渡されるthisはjQueryオブジェクトではないんですね。DOM要素になっています。要素が複数ある場合は配列として渡されます。</p>
					<pre>$('#link').each(function() {
    console.debug(this);
});

// 評価結果 - DOM要素になっている
// &lt;a id="link" href="llink.html"&gt;</pre>
					<p>※ 単一のjQueryオブジェクトに対してeach使うの気持ち悪いですけど、例ってことで。。</p>
					<h3>2-2. 自作メソッド内でのthis</h3>
					<p>2-1に対して、jQueryがもともと持っているメソッドに対して自作メソッド（プラグイン関数など）で渡されるthisはjQueryオブジェクトになっています。</p>
					<pre>$.fn.myMethod = function() {
    console.debug(this);
}
$('#link').myMethod();

// 評価結果 - jQueryオブジェクトとして渡される
// jQuery(a#link llink.html)</pre>
					<h2>つまり。。。</h2>
					<p>基礎はちゃんと押さえておかないと後で面倒くさいってことです。。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/jquery-and-dom-object/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>HootSuiteユーザは必須？(非)公式RTを超簡単に切り替えるGreasemonkey</title>
		<link>http://5509.me/log/hootsuite-rt-userscript</link>
		<comments>http://5509.me/log/hootsuite-rt-userscript#comments</comments>
		<pubDate>Mon, 28 Jun 2010 01:30:37 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Greasemonkey]]></category>
		<category><![CDATA[HootSuite]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[UserScript]]></category>

		<guid isPermaLink="false">http://5509.me/?p=2699</guid>
		<description><![CDATA[					
					先日のHootSuiteバージョンアップで公式RTと引用する形のRTを切り替えられるようになりましたね。今までは引用する形のRTしか使えなかったので少し不便でしたが、これで両方を使い分けられるように [...]]]></description>
			<content:encoded><![CDATA[					<p><img src="http://5509.me/wp-content/uploads/2010/06/hootsuite2.png" alt="" title="hootsuite" width="483" height="170" class="alignnone size-full wp-image-2715" /></p>
					<p>先日の<a href="http://hootsuite.com/">HootSuite</a>バージョンアップで<strong>公式RTと引用する形のRT</strong>を切り替えられるようになりましたね。今<strong>までは引用する形のRTしか使えなかった</strong>ので少し不便でしたが、これで両方を使い分けられるようになりました。なったんですけど、いちいち切り替えるのがかなり面倒くさくて、毎回同じことなんかやってられないです。</p>
					<p>そこで探していたところ<a href="http://twitter.com/h_kurosawa">@h_kurosawa</a>さんが<a href="http://tweet-code.appspot.com/code/20001">Bookmarklet</a>を公開してくれていたので、UserScript化させてもらいました。ChromeとFirefoxで動作確認してます。<br />
					<span id="more-2699"></span></p>
					<h2>インストール</h2>
					<p><strong>This script for Chrome and Firefox with Greasemonkey</strong></p>
					<ul>
					<li><a href="http://userscripts.org/scripts/source/80179.user.js">Install UserScript</a></li>
					</ul>
					<h2>使い方</h2>
					<p>インストールした状態でHootSuiteを開くとフッターに以下のようなチェックボックスが追加されています。引用する形のRTを「<strong>Web Retweet</strong>」、公式RTは「<strong>Official RT</strong>」の表記にしています。</p>
					<p><img src="http://5509.me/wp-content/uploads/2010/06/hootsuite_footer1.png" alt="" title="hootsuite_footer" width="215" height="49" class="alignnone size-full wp-image-2716" /></p>
					<p>これをクリックすることで公式RTに切り替えることができます。</p>
					<p><img src="http://5509.me/wp-content/uploads/2010/06/hootsuite_footer2.png" alt="" title="hootsuite_footer2" width="227" height="45" class="alignnone size-full wp-image-2719" /></p>
					<p>チェックした状態としてない状態でRTを試してみてください。簡単ですね！</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/hootsuite-rt-userscript/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>マウスホバーでスムーズにjQueryのアニメーションをコントロールする方法</title>
		<link>http://5509.me/log/jquery-animate-que-tips</link>
		<comments>http://5509.me/log/jquery-animate-que-tips#comments</comments>
		<pubDate>Thu, 24 Jun 2010 01:45:52 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[アニメーション]]></category>

		<guid isPermaLink="false">http://5509.me/?p=2661</guid>
		<description><![CDATA[					
					jQueryを使えば超簡単にアニメーションもできますし、フェード効果の実装も楽々できますね。簡単に実装できるので結構使ってるサイトを見ますが、カーソルを素早く乗せたり外したりするとチラチラすることが [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://5509.me/sample/animationque/"><img src="http://5509.me/wp-content/uploads/2010/06/animation.png" alt="" title="animation" width="333" height="138" class="alignnone size-full wp-image-2669" /></a></p>
					<p>jQueryを使えば超簡単にアニメーションもできますし、フェード効果の実装も楽々できますね。簡単に実装できるので結構使ってるサイトを見ますが、カーソルを素早く乗せたり外したりするとチラチラすることが多いんですよね。</p>
					<p>何言ってるか文章だと伝わりにくいので、<a href="http://5509.me/sample/animationque/">サンプル1</a>を確認してみてください。</p>
					<p>どうでもいいっちゃどうでもいいのかも知れないですけど、こういう小さなこだわりって結構重要なんじゃないでしょうか。</p>
					<p>で、このチラチラ、簡単に解決できるので知らなかった人は覚えておくといいかもです。<br />
					<span id="more-2661"></span></p>
					<p>結論は簡単で</p>
					<ul>
					<li><strong>.stop(true, false)を.animate()の前に入れる</strong></li>
					<li><strong>.animate()メソッドのオプション部分でqueue: falseを指定する</strong></li>
					</ul>
					<p>のいずれかです。</p>
					<p>このときに.stop()メソッドを利用するのですが、.stop()メソッドには2つ引数を指定できて、引数の値で動作もちょっと変わったりします。実際に動作を見てもらったほうが早いのでサンプルを用意しました。</p>
					<p>サンプルと同じように順番に見ていきましょう。</p>
					<h2>1. そのまま</h2>
					<p><a href="http://5509.me/sample/animationque/#s2">サンプル1のボックス</a>に連続してホバーしてください。チラチラしますよね。</p>
					<h3>ソースコード</h3>
					<pre>$('#s1 div.box')
&nbsp;&nbsp;&nbsp;&nbsp;.hover(function()&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).animate({
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;opacity:&nbsp;.5
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;duration:&nbsp;200
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})
&nbsp;&nbsp;&nbsp;&nbsp;},&nbsp;function()&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).animate({
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;opacity:&nbsp;1
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;duration:&nbsp;200
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})
&nbsp;&nbsp;&nbsp;&nbsp;});</pre>
					<h2>2. .stop(true, true)</h2>
					<p><a href="http://5509.me/sample/animationque/#s1">サンプル2のボックス</a>に連続してホバーすると、ぴかぴかしますね！</p>
					<h3>ソースコード</h3>
					<pre>$('#s2 div.box')
&nbsp;&nbsp;&nbsp;&nbsp;.hover(function()&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).stop(true,&nbsp;true).animate({
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;opacity:&nbsp;.5
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;duration:&nbsp;200
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})
&nbsp;&nbsp;&nbsp;&nbsp;},function()&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).stop(true,&nbsp;true).animate({
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;opacity:&nbsp;1
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;duration:&nbsp;200
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})
&nbsp;&nbsp;&nbsp;&nbsp;});</pre>
					<h2>3. .stop(true, false)</h2>
					<p><a href="http://5509.me/sample/animationque/#s3">サンプル3のボックス</a>にキューがたまっている状態で他のブロックにホバーすると、キャンセルします。たぶん一番自然。</p>
					<h3>ソースコード</h3>
					<pre>$('#s3 div.box')
&nbsp;&nbsp;&nbsp;&nbsp;.hover(function()&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).stop(true,&nbsp;false).animate({
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;opacity:&nbsp;.5
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;duration:&nbsp;200
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})
&nbsp;&nbsp;&nbsp;&nbsp;},&nbsp;function()&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).stop(true,&nbsp;false).animate({
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;opacity:&nbsp;1
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;duration:&nbsp;200
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})
&nbsp;&nbsp;&nbsp;&nbsp;});</pre>
					<h2>4. queue: false</h2>
					<p><a href="http://5509.me/sample/animationque/#s4">サンプル4のボックス</a>にキューがたまっている状態で他のブロックにホバーすると、キャンセルします。.stop(true, false)と同じ効果。これも自然。</p>
					<h3>ソースコード</h3>
					<pre>$('#s4 div.box')
&nbsp;&nbsp;&nbsp;&nbsp;.hover(function()&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).animate({
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;opacity:&nbsp;.5
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;duration:&nbsp;200,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;queue:&nbsp;false
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})
&nbsp;&nbsp;&nbsp;&nbsp;},&nbsp;function()&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).animate({
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;opacity:&nbsp;1
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;duration:&nbsp;200,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;queue:&nbsp;false
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})
&nbsp;&nbsp;&nbsp;&nbsp;});</pre>
					<h2>簡単にチラチラを回避できるのでぜひ覚えておきましょう！</h2>
					<p>以下のどちらかですね！今回は.animate()メソッドで紹介してますが、.<strong>stop(true, false)はfadeIn(), fadeOut(), fadeTo()にも使えますよ！</strong></p>
					<ul>
					<li><strong>.stop(true, false)を.animate()の前に入れる</strong></li>
					<li><strong>.animate()メソッドのオプション部分でqueue: falseを指定する</strong></li>
					</ul>
					<ul>
					<li><a href="http://5509.me/sample/animationque/">動作サンプル</a></li>
					</ul>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/jquery-animate-que-tips/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQueryを無効化する jDTNoQuery</title>
		<link>http://5509.me/log/jdtnoquery</link>
		<comments>http://5509.me/log/jdtnoquery#comments</comments>
		<pubDate>Wed, 23 Jun 2010 01:28:46 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[dt]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://5509.me/?p=2645</guid>
		<description><![CDATA[					
					【番外編】
					番外編にして最もクール。
					jQueryが他のライブラリと干渉してプラグインが動かない！なんてことありませんでしたか？干渉するなら無効化すればいいですよ。このプラグイン [...]]]></description>
			<content:encoded><![CDATA[					<p><img src="http://5509.me/wp-content/uploads/2010/06/noquery.png" alt="" title="noquery" width="208" height="125" class="alignnone size-full wp-image-2659" /></p>
					<p><strong>【番外編】</strong></p>
					<p>番外編にして最もクール。</p>
					<p>jQueryが他のライブラリと干渉してプラグインが動かない！なんてことありませんでしたか？干渉するなら無効化すればいいですよ。このプラグインでね！<br />
					<span id="more-2645"></span></p>
					<p class="link"><a href="http://jdtplugins.googlecode.com/svn/trunk/jdtnoquery/index.html" class="sample">Live demo (コンソールとかで見てください)</a></p>
					<ul>
					<li><a href="http://jdtplugins.googlecode.com/svn/trunk/jdtnoquery/js/jdtnoquery.js">jdtNoQuery.js</a></li>
					</ul>
					<h2>使い方</h2>
					<p><strong>jQueryのあとに</strong><a href="http://jdtplugins.googlecode.com/svn/trunk/jdtnoquery/js/jdtnoquery.js">jdtNoQuery.js</a>を読み込むだけです。ここ重要です。</p>
					<pre>&lt;script type=&quot;text/javascript&quot; src=&quot;http://www.google.com/jsapi&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;google.load(&quot;jquery&quot;, '1.4');&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jdtnoquery.js&quot;&gt;&lt;/script&gt;</pre>
					<h2>注意</h2>
					<p><strong>プラグインちゃうやん</strong>っていうツッコミはコメント等で受け付けてます。</p>
					<h2>本当に最後</h2>
					<p>昨日公開した「<a href="http://5509.me/log/10-worthless-jquery-plugins">誰が使うの？何の役にも立たないjQueryプラグイン10選</a>」の番外編というか総集編というか、もう総力戦というか。ようはオチです。ありがとうございました。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/jdtnoquery/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>誰が使うの？何の役にも立たないjQueryプラグイン10選</title>
		<link>http://5509.me/log/10-worthless-jquery-plugins</link>
		<comments>http://5509.me/log/10-worthless-jquery-plugins#comments</comments>
		<pubDate>Tue, 22 Jun 2010 01:30:01 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[プラグイン]]></category>
		<category><![CDATA[誰得]]></category>

		<guid isPermaLink="false">http://5509.me/?p=2606</guid>
		<description><![CDATA[					jQueryプラグインなにそれおいしいの？役に立つプラグインばっかりで面白くない！ぼくらはもっと面白くて役に立たないものを求めてるんだ！あまのじゃくな人たちのために（面白いかどうかは別として）何の役にも立たない [...]]]></description>
			<content:encoded><![CDATA[					<p>jQueryプラグインなにそれおいしいの？役に立つプラグインばっかりで面白くない！ぼくらはもっと面白くて役に立たないものを求めてるんだ！あまのじゃくな人たちのために（面白いかどうかは別として）何の役にも立たないプラグインを集めました。全力で行きます。全力で。<br />
					<span id="more-2606"></span></p>
					<h3><a href="http://5509.me/log/jdtreverseliquid">Windowを広げると逆にカラムを縮めるプラグイン jDTreverseLiquid</a></h3>
					<p><a href="http://5509.me/log/jdtreverseliquid"><img src="http://5509.me/wp-content/uploads/2010/06/jdt2.png" alt="" title="jdt2" width="300" class="alignnone size-full wp-image-2615" /></a></p>
					<p>リキッドレイアウトはテキストメインのサイトで見やすさを発揮しますね。でもそんなの当たり前です。Window幅に反比例してカラムサイズが変わるのがこれからの主流ですね！</p>
					<h3><a href="http://5509.me/log/jdtneverclick">右クリックどころかクリックすらも禁止するjQueryプラグイン jDTNeverClick</a></h3>
					<p><a href="http://5509.me/log/jdtneverclick"><img src="http://5509.me/wp-content/uploads/2010/06/jdt3.png" alt="" title="jdt3" width="300" class="alignnone size-full wp-image-2617" /></a></p>
					<p>右クリック禁止のサイトあるじゃないですか。あれ本当に最低のユーザビリティだと思ってたんですけど、違いますね。クリックまで禁止して始めて最悪のユーザビリティが生まれるんです。これからはクリックも禁止の時代です。</p>
					<h3><a href="http://rewish.org/javascript/jdtscroll">スムーズにスクロールしないjQueryプラグイン「jDTScroll」</a></h3>
					<p><a href="http://rewish.org/javascript/jdtscroll"><img src="http://5509.me/wp-content/uploads/2010/06/jdt1.png" alt="" title="jdt1" width="300" class="alignnone size-full wp-image-2613" /></a></p>
					<p>スムーズにスクロールすることが当たり前だと思ってる現代人にはぴったりのプラグインですね。スクロールバーだってやる気があるときないときあるんです。わかってあげてよ。。</p>
					<h3><a href="http://5509.me/log/jdtsynergycheckbox">チェックボックスがはんぱない結束力を発揮する jDTSynergyCheckbox</a></h3>
					<p><a href="http://5509.me/log/jdtsynergycheckbox"><img src="http://5509.me/wp-content/uploads/2010/06/jdt4.png" alt="" title="jdt4" width="300" class="alignnone size-full wp-image-2619" /></a></p>
					<p>チェックボックスってユーザに決められ通の動作しかできないんですよ。かわいそうじゃないですか？チェックボックスにも意思があると思うんですよね。そう、こんな風に…</p>
					<h3><a href="http://5509.me/log/jdttabs">うっかりタブの中身を盗まれるjQueryタブプラグイン jDTTabs.js</a></h3>
					<p><a href="http://5509.me/log/jdttabs"><img src="http://5509.me/wp-content/uploads/2010/06/jdt5.png" alt="" title="jdt5" width="300" class="alignnone size-full wp-image-2622" /></a></p>
					<p>大切なタブの中身も天下の大泥棒の手にかかればほらこの通り。</p>
					<h3><a href="http://labs.yusukenakanishi.com/2010/06/16/jdtgnokyouhu/">人の嫌がることを進んで出来るプラグイン jDTGnoKyouhu.js【グロ注意】</a></h3>
					<p><a href="http://labs.yusukenakanishi.com/2010/06/16/jdtgnokyouhu/"><img src="http://5509.me/wp-content/uploads/2010/06/jdt6-300x181.png" alt="" title="jdt6" width="300" height="181" class="alignnone size-medium wp-image-2623" /></a></p>
					<p>嫌だと言われると余計意地悪をしたくなってしまうのが人間の性。Gは大多数の人が嫌悪感を持つということは、、Gを大量に表示させればみんな嫌がるんじゃ…！（サンプルは念のためモザイクをかけてます）</p>
					<h3><a href="http://5509.me/log/jdtlightbox">これからの新標準 jDTLightBox</a></h3>
					<p><a href="http://5509.me/log/jdtlightbox"><img src="http://5509.me/wp-content/uploads/2010/06/jdt7-300x184.png" alt="" title="jdt7" width="300" height="184" class="alignnone size-medium wp-image-2625" /></a></p>
					<p>フツーのLightboxに飽きていた、みんなとは違うLightboxを実装したい、と思っていたあなた。僕が作りました。この新感覚Lightboxをぜひお試しください。</p>
					<h3><a href="http://5509.me/log/jdtrunaway">クリックさせないリンク jDTRunAway</a></h3>
					<p><a href="http://5509.me/log/jdtrunaway"><img src="http://5509.me/wp-content/uploads/2010/06/jdt8-300x153.png" alt="" title="jdt8" width="300" height="153" class="alignnone size-medium wp-image-2627" /></a></p>
					<p>リンクはクリックできるものだと思っていませんか？クリックできない・させないリンクもいるんです。意地の悪いやつらですね。</p>
					<h3><a href="http://rewish.org/javascript/jdtrollover">ものすごい勢いでロールオーバーするjQueryプラグイン「jDTRollover」</a></h3>
					<p><a href="http://rewish.org/javascript/jdtrollover"><img src="http://5509.me/wp-content/uploads/2010/06/jdt9-300x138.png" alt="" title="jdt9" width="300" height="138" class="alignnone size-medium wp-image-2629" /></a></p>
					<p>ロールオーバー。それはロル男の人生そのもの。</p>
					<h3><a href="http://5509.me/log/jdtgirigirimosaic">大切なところは見ちゃいや… jDTGirigiriMosaic.js</a></h3>
					<p><a href="http://5509.me/log/jdtgirigirimosaic"><img src="http://5509.me/wp-content/uploads/2010/06/jdt10-300x163.png" alt="" title="jdt10" width="300" height="163" class="alignnone size-medium wp-image-2630" /></a></p>
					<p>え？サイトの画像をそのまま表示してる？だめですよ…そんな卑猥なものを生で表示するなんて…いやらしい…</p>
					<h2>おまけ</h2>
					<p>これらの<a href="http://code.google.com/p/jdtplugins/">プラグインはGooglecode</a>にあります。（ドキュメントはありませんが…）実はどんな案があってっていうのはこの<a href="http://code.google.com/p/jdtplugins/wiki/plugins">GooglecodeのWikiに集約</a>されてました。</p>
					<p>もし興味のある奇特な方がいれば、参考になるかわかりませんが、ぜひ実装して（作って）教えてください！</p>
					<h2>あとがき的な</h2>
					<p>世の中には役に立つプラグインはあっても役に立たないプラグインは(あまり)ないんじゃないか、的な発想から生まれたこのしょうもない企画。そもそもの発端は僕がこのまとめ記事「<strong>誰が使うの？何の役にも立たないjQueryプラグイン10選</strong>」を書きたいと言ったことでした…まさか本当にやるなんて…</p>
					<p>参加メンバー（アイデア出しと実装など）もまさか本当にやるとは思ってなかったでしょう。実装してくれた<a href="http://twitter.com/rewish">Rewishさん</a>と<a href="http://twitter.com/hogenishi">YusukeNakanishi</a>さんありがとう！一番しょうもない案をばんばん出してくれた<a href="http://twitter.com/hiloki">hilokiさん</a>もありがとう！</p>
					<p>十分ふざけたので次は真面目なの作ります。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/10-worthless-jquery-plugins/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>大切なところは見ちゃいや… jDTGirigiriMosaic.js</title>
		<link>http://5509.me/log/jdtgirigirimosaic</link>
		<comments>http://5509.me/log/jdtgirigirimosaic#comments</comments>
		<pubDate>Fri, 18 Jun 2010 05:09:26 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[dt]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://5509.me/?p=2592</guid>
		<description><![CDATA[					画像とか…そんな卑猥なもの表示しちゃだめですよ…ちゃんと隠さないと…
					Live demo
					Download demo files
					
					導入方法
					1. jQuery [...]]]></description>
			<content:encoded><![CDATA[					<p>画像とか…そんな卑猥なもの表示しちゃだめですよ…ちゃんと隠さないと…</p>
					<p class="link"><a href="http://jdtplugins.googlecode.com/svn/trunk/jdtgirigirimosaic/index.html" class="sample">Live demo</a><br />
					<a href="http://jdtplugins.googlecode.com/files/jdtgirigirimosaic.zip" class="download">Download demo files</a></p>
					<p><span id="more-2592"></span></p>
					<h2>導入方法</h2>
					<h3>1. jQueryとｊDTGirigiriMosaicを読み込む</h3>
					<pre>&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jdtgirigirimosaic.js&quot;&gt;&lt;/script&gt;</pre>
					<h3>3. 実行する</h3>
					<p>$()で対象にする画像を指定します。</p>
					<pre>jQuery(function($) {
  $('img').jdtGirigiriMosaic();
});</pre>
					<h2>オプション</h2>
					<p>薄いほうが卑猥…</p>
					<table class="lftable">
					<tr>
					<th>オプション項目</th>
					<th>内容</th>
					</tr>
					<tr>
					<td>size</td>
					<td>小さいほうが薄い感じになったりします。もともと薄いですけど。（デフォルトは3）</td>
					</tr>
					</table>
					<p class="link"><a href="http://jdtplugins.googlecode.com/svn/trunk/jdtgirigirimosaic/index.html" class="sample">Live demo</a><br />
					<a href="http://jdtplugins.googlecode.com/files/jdtgirigirimosaic.zip" class="download">Download demo files</a></p>
					<h2>注意</h2>
					<p>薄くするなんて卑猥！！！！！！</p>
					<h2>IE</h2>
					<p>はcanvas使えないので別途使えるようにする何かをつかってください…</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/jdtgirigirimosaic/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>クリックさせないリンク jdtRunAway.js</title>
		<link>http://5509.me/log/jdtrunaway</link>
		<comments>http://5509.me/log/jdtrunaway#comments</comments>
		<pubDate>Thu, 17 Jun 2010 05:40:06 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[dt]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://5509.me/?p=2586</guid>
		<description><![CDATA[					Webサイトに欠かせないものといえば、何を思いつきますか？やはりリンクじゃないでしょうか。そもそもリンクがなければ他のページに移動することもできませんし。
					リンクがクリックしにくかったら…まあうざいで [...]]]></description>
			<content:encoded><![CDATA[					<p>Webサイトに欠かせないものといえば、何を思いつきますか？やはりリンクじゃないでしょうか。そもそもリンクがなければ他のページに移動することもできませんし。</p>
					<p>リンクがクリックしにくかったら…まあうざいでしょうね。<br />
					そんな素敵なプラグインをつくってみました。</p>
					<p class="link"><a href="http://jdtplugins.googlecode.com/svn/trunk/jdtrunaway/index.html" class="sample">Live demo</a><br />
					<a href="http://jdtplugins.googlecode.com/files/jdtrunaway.zip" class="download">Download demo files</a></p>
					<p><span id="more-2586"></span></p>
					<h2>導入方法</h2>
					<h3>1. jQueryとjDTLightBoxを読み込む</h3>
					<pre>&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jdtlightbox.js&quot;&gt;&lt;/script&gt;</pre>
					<h3>3. 実行する</h3>
					<p>$()で対象にする要素を指定します。（サンプルではアンカーに適用していますが、きっとなんにでも使えるはず）</p>
					<pre>jQuery(function($) {
  $('a').jdtRunAway();
});</pre>
					<h2>オプション</h2>
					<p>やりすぎると大体重くなる</p>
					<table class="lftable">
					<tr>
					<th>オプション項目</th>
					<th>内容</th>
					</tr>
					<tr>
					<td>rate</td>
					<td>アニメーションフレームみたいなもの。増やすとなめらかになる反面重くなります</td>
					</tr>
					<tr>
					<td>instance</td>
					<td>反発する距離みたいなもの。大きくするとすぐ逃げます</td>
					</tr>
					</table>
					<p class="link"><a href="http://jdtplugins.googlecode.com/svn/trunk/jdtrunaway/index.html" class="sample">Live demo</a><br />
					<a href="http://jdtplugins.googlecode.com/files/jdtrunaway.zip" class="download">Download demo files</a></p>
					<h2>注意</h2>
					<p>ｱﾊﾊﾊﾊ つかまえてごらーん</p>
					<h2>Thanks</h2>
					<p>アニメーション部分のソースは<a href="http://twitter.com/hisasann">hisasann</a>さんが以下の記事で作成していたものを、許可を得て転用しています。こんなばかなプラグインのために、、快諾していただきありがとうございます。</p>
					<p><a href="http://hisasann.com/housetect/2009/04/jqueryrunawayfrommouse_part2.html">jQueryでマウスから逃げるRunAwayFromMouse書いてみた Part2 | HouseTect, JavaScript Blog </a></p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/jdtrunaway/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>これからの新標準LightBox jDTLightBox.js</title>
		<link>http://5509.me/log/jdtlightbox</link>
		<comments>http://5509.me/log/jdtlightbox#comments</comments>
		<pubDate>Wed, 16 Jun 2010 05:30:23 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[dt]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://5509.me/?p=2580</guid>
		<description><![CDATA[					LightBoxって知ってますよね？にゅっと画像とかが出る例のアレです。2年くらい前に流行りましたね。今では標準になってるのか分からないですが色々なサイトで普通に使われますが、でも嫌いっていう人もいたりしますね [...]]]></description>
			<content:encoded><![CDATA[					<p>LightBoxって知ってますよね？にゅっと画像とかが出る例のアレです。2年くらい前に流行りましたね。今では標準になってるのか分からないですが色々なサイトで普通に使われますが、でも嫌いっていう人もいたりしますね。なんで嫌いなんでしょう。</p>
					<p>ユーモアが足りないからじゃないですかね。</p>
					<p>というわけでユーモアたっぷりかどうかはアレですが、これからのWebサイトをひっぱっていくであろう新標準LightBoxをつくりました。1から作りました。</p>
					<p class="link"><a href="http://jdtplugins.googlecode.com/svn/trunk/jdtlightbox/index.html" class="sample">Live demo</a><br />
					<a href="http://jdtplugins.googlecode.com/files/jdtlightbox.zip" class="download">Download demo files</a></p>
					<p><span id="more-2580"></span></p>
					<h2>導入方法</h2>
					<h3>1. jQueryとjDTLightBoxを読み込む</h3>
					<pre>&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jdtlightbox.js&quot;&gt;&lt;/script&gt;</pre>
					<h3>3. 実行する</h3>
					<p>$()で対象にする要素を指定します。（アンカーに適用します。）</p>
					<pre>jQuery(function($) {
  $('#lightbox a').jdtLightBox();
});</pre>
					<h2>オプション</h2>
					<p>期待を裏切れます。</p>
					<table class="lftable">
					<tr>
					<th>オプション項目</th>
					<th>内容</th>
					</tr>
					<tr>
					<td>defaultSize</td>
					<td>最初のサイズ<br />{ width: x, height: y }</td>
					</tr>
					<tr>
					<td>animateTo</td>
					<td>最後のサイズ<br />画像サイズに対するパーセント(20など)</td>
					</tr>
					<tr>
					<td>closeImgSrc</td>
					<td>閉じるボタンのソース</td>
					</tr>
					<tr>
					<td>bgLayerOpacity</td>
					<td>背景レイヤーの透明度</td>
					</tr>
					</table>
					<p class="link"><a href="http://jdtplugins.googlecode.com/svn/trunk/jdtlightbox/index.html" class="sample">Live demo</a><br />
					<a href="http://jdtplugins.googlecode.com/files/jdtlightbox.zip" class="download">Download demo files</a></p>
					<h2>注意</h2>
					<p>え？余計見にくい？見にくいなら閉じろ！</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/jdtlightbox/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>うっかりタブの中身を盗まれるjQueryタブプラグイン jDTTabs.js</title>
		<link>http://5509.me/log/jdttabs</link>
		<comments>http://5509.me/log/jdttabs#comments</comments>
		<pubDate>Tue, 15 Jun 2010 01:50:14 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[dt]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://5509.me/?p=2572</guid>
		<description><![CDATA[					みなさん、ルパンは好きですか？もちろんルパンⅢ世です。嫌いな人はいないと思います。そんなルパンにタブの中身を盗まれてみませんか？とっつぁんもついてくるよ。
					Live demo
					Downloa [...]]]></description>
			<content:encoded><![CDATA[					<p>みなさん、ルパンは好きですか？もちろんルパンⅢ世です。嫌いな人はいないと思います。そんなルパンにタブの中身を盗まれてみませんか？とっつぁんもついてくるよ。</p>
					<p class="link"><a href="http://jdtplugins.googlecode.com/svn/trunk/jdttabs/index.html" class="sample">Live demo</a><br />
					<a href="http://jdtplugins.googlecode.com/files/jdttabs.zip" class="download">Download demo files</a></p>
					<p><span id="more-2572"></span></p>
					<h2>導入方法</h2>
					<h3>1. jQueryとjDTTabsを読み込む</h3>
					<pre>&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jdttabs.js&quot;&gt;&lt;/script&gt;</pre>
					<h3>2. タブのHTMLを用意する</h3>
					<p>タブのHTMLは以下のようにします。</p>
					<pre>&lt;div id=&quot;jdtTabs&quot;&gt;
&nbsp;&nbsp;&lt;ul class=&quot;tab&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#tab1&quot;&gt;tab1&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#tab2&quot;&gt;tab2&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#tab3&quot;&gt;tab3&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#tab4&quot;&gt;tab4&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#tab5&quot;&gt;tab5&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&lt;/ul&gt;
&nbsp;&nbsp;
&nbsp;&nbsp;&lt;div id=&quot;tab1&quot;&gt;aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&lt;br /&gt;
&nbsp;&nbsp;aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&lt;br /&gt;
&nbsp;&nbsp;aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&lt;br /&gt;
&nbsp;&nbsp;aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&lt;br /&gt;
&nbsp;&nbsp;aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&lt;/div&gt;
&nbsp;&nbsp;&lt;div id=&quot;tab2&quot;&gt;bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&lt;br /&gt;
&nbsp;&nbsp;bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&lt;br /&gt;
&nbsp;&nbsp;bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&lt;br /&gt;
&nbsp;&nbsp;bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&lt;br /&gt;
&nbsp;&nbsp;bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&lt;/div&gt;
&nbsp;&nbsp;&lt;div id=&quot;tab3&quot;&gt;ccccccccccccccccccccccccccccccccccccccccccccccccc&lt;br /&gt;
&nbsp;&nbsp;ccccccccccccccccccccccccccccccccccccccccccccccccc&lt;br /&gt;
&nbsp;&nbsp;ccccccccccccccccccccccccccccccccccccccccccccccccc&lt;br /&gt;
&nbsp;&nbsp;ccccccccccccccccccccccccccccccccccccccccccccccccc&lt;br /&gt;
&nbsp;&nbsp;ccccccccccccccccccccccccccccccccccccccccccccccccc&lt;/div&gt;
&nbsp;&nbsp;&lt;div id=&quot;tab4&quot;&gt;ddddddddddddddddddddddddddddddddddddddddddddddddd&lt;br /&gt;
&nbsp;&nbsp;ddddddddddddddddddddddddddddddddddddddddddddddddd&lt;br /&gt;
&nbsp;&nbsp;ddddddddddddddddddddddddddddddddddddddddddddddddd&lt;br /&gt;
&nbsp;&nbsp;ddddddddddddddddddddddddddddddddddddddddddddddddd&lt;br /&gt;
&nbsp;&nbsp;ddddddddddddddddddddddddddddddddddddddddddddddddd&lt;/div&gt;
&nbsp;&nbsp;&lt;div id=&quot;tab5&quot;&gt;eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&lt;br /&gt;
&nbsp;&nbsp;eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&lt;br /&gt;
&nbsp;&nbsp;eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&lt;br /&gt;
&nbsp;&nbsp;eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&lt;br /&gt;
&nbsp;&nbsp;eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&lt;/div&gt;
&lt;/div&gt;</pre>
					<h3>3. 実行する</h3>
					<p>$()で対象にする要素を指定します。</p>
					<pre>jQuery(function($) {
  $('#jdtTabs').jdtTabs();
});</pre>
					<h2>オプション</h2>
					<p>やってやった感を演出。</p>
					<table class="lftable">
					<tr>
					<th>オプション項目</th>
					<th>内容</th>
					</tr>
					<tr>
					<td>steal</td>
					<td>クールに決めよう。</td>
					</tr>
					<tr>
					<td>stole</td>
					<td>悔しがろう。</td>
					</tr>
					</table>
					<p class="link"><a href="http://jdtplugins.googlecode.com/svn/trunk/jdttabs/index.html" class="sample">Live demo</a><br />
					<a href="http://jdtplugins.googlecode.com/files/jdttabs.zip" class="download">Download demo files</a></p>
					<h2>注意</h2>
					<p>俺に盗めないものなんてないんだぜ？</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/jdttabs/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>チェックボックスがはんぱない結束力を発揮する  jDTSynergyCheckbox</title>
		<link>http://5509.me/log/jdtsynergycheckbox</link>
		<comments>http://5509.me/log/jdtsynergycheckbox#comments</comments>
		<pubDate>Mon, 14 Jun 2010 05:46:43 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[dt]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://5509.me/?p=2559</guid>
		<description><![CDATA[					卵かけご飯は最近TKGって言うらしいですが、TKGを食べるときに白身だけつるんって全部口の中に入ることないですか？あと、ご飯もりもりにしたときに白身が茶碗からつるんっていくときないですか？
					結束力大事 [...]]]></description>
			<content:encoded><![CDATA[					<p>卵かけご飯は最近TKGって言うらしいですが、TKGを食べるときに白身だけつるんって全部口の中に入ることないですか？あと、ご飯もりもりにしたときに白身が茶碗からつるんっていくときないですか？</p>
					<p>結束力大事ということでチェックボックスに某倶楽部並の結束力を与えてみました。<br />
					オプションを使えば違う意味でのシナジーを発揮します。</p>
					<p class="link"><a href="http://jdtplugins.googlecode.com/svn/trunk/jdtsynergycheckbox/index.html" class="sample">Live demo</a><br />
					<a href="http://jdtplugins.googlecode.com/files/jdtsynergycheckbox.zip" class="download">Download demo files</a></p>
					<p><span id="more-2559"></span></p>
					<h2>導入方法</h2>
					<h3>1. jQueryとjDTSynergyCheckboxを読み込む</h3>
					<pre>&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jdtsynergycheckbox.js&quot;&gt;&lt;/script&gt;</pre>
					<h3>2. 実行する</h3>
					<p>$()で対象にする要素を指定します。</p>
					<pre>jQuery(function($) {
  $('input').jdtSynergyCheckbox();
});</pre>
					<h2>オプション</h2>
					<p>チェックボックスたちの不満の声。</p>
					<table class="lftable">
					<tr>
					<th>オプション項目</th>
					<th>内容</th>
					</tr>
					<tr>
					<td>special</td>
					<td>違う意味でのシナジーを発揮します。</td>
					</tr>
					<tr>
					<td>message</td>
					<td>specialがtrueのときのみ。配列で複数入れるとランダムで不満を言います。</td>
					</tr>
					</table>
					<p class="link"><a href="http://jdtplugins.googlecode.com/svn/trunk/jdtsynergycheckbox/index.html" class="sample">Live demo</a><br />
					<a href="http://jdtplugins.googlecode.com/files/jdtsynergycheckbox.zip" class="download">Download demo files</a></p>
					<h2>注意</h2>
					<p>チェックボックスだって不満はあるんです。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/jdtsynergycheckbox/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>右クリックどころかクリックすらも禁止するjQueryプラグイン jDTNeverClick</title>
		<link>http://5509.me/log/jdtneverclick</link>
		<comments>http://5509.me/log/jdtneverclick#comments</comments>
		<pubDate>Fri, 11 Jun 2010 01:24:35 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[dt]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[ネタ]]></category>

		<guid isPermaLink="false">http://5509.me/?p=2553</guid>
		<description><![CDATA[					右クリックを禁止してるサイトありますよね？あれのうざさは僕が言うまでもないと思いますが、クリック・ダブルクリックまで禁止されてたらどうでしょう。考えただけで鬱陶しいですね。
					ユーザーのうざがってる顔が [...]]]></description>
			<content:encoded><![CDATA[					<p>右クリックを禁止してるサイトありますよね？あれのうざさは僕が言うまでもないと思いますが、クリック・ダブルクリックまで禁止されてたらどうでしょう。考えただけで鬱陶しいですね。</p>
					<p>ユーザーのうざがってる顔が見たいという鬼畜なあなたのために、右クリックどころかクリック・ダブルクリックすら禁止するjQueryプラグイン作りました。</p>
					<p class="link"><a href="http://jdtplugins.googlecode.com/svn/trunk/jdtneverclick/index.html" class="sample">Live demo</a><br />
					<a href="http://jdtplugins.googlecode.com/files/jdtneverclick.zip" class="download">Download demo files</a></p>
					<p><span id="more-2553"></span></p>
					<h2>導入方法</h2>
					<h3>1. jQueryとjDTNeverClickを読み込む</h3>
					<pre>&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jdtreverseliquid.js&quot;&gt;&lt;/script&gt;</pre>
					<h3>2. 実行する</h3>
					<p>$()で対象にする要素を指定します。</p>
					<pre>jQuery(function($) {
  $(document).jdtNeverClick();
});</pre>
					<h2>オプション</h2>
					<p>オプションを使えば、割り当てるlistenerとアラートの表示非表示・文章を変更できます。</p>
					<table class="lftable">
					<tr>
					<th>オプション項目</th>
					<th>内容</th>
					</tr>
					<tr>
					<td>listener</td>
					<td>割り当てたいlistener。デフォルトは&#8217;click dblclick contextmenu&#8217;</td>
					</tr>
					<tr>
					<td>dialog</td>
					<td>表示・非表示：true・false</td>
					</tr>
					<tr>
					<td>message</td>
					<td>できる限り鬱陶しい文章を入れましょう。</td>
					</tr>
					</table>
					<p class="link"><a href="http://jdtplugins.googlecode.com/svn/trunk/jdtneverclick/index.html" class="sample">Live demo</a><br />
					<a href="http://jdtplugins.googlecode.com/files/jdtneverclick.zip" class="download">Download demo files</a></p>
					<h2>注意</h2>
					<p>わかってますよね？</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/jdtneverclick/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windowを広げると逆にカラムを縮めるプラグイン jDTreverseLiquid</title>
		<link>http://5509.me/log/jdtreverseliquid</link>
		<comments>http://5509.me/log/jdtreverseliquid#comments</comments>
		<pubDate>Thu, 10 Jun 2010 02:09:39 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[dt]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://5509.me/?p=2543</guid>
		<description><![CDATA[					リキッドレイアウトってありますよね？Windowサイズにあわせてカラムが広がるレイアウトですね。でも、Windowサイズにあわせて広がるとか、普通すぎませんか？
					普通じゃ嫌・みんなと同じは嫌なあなたの [...]]]></description>
			<content:encoded><![CDATA[					<p>リキッドレイアウトってありますよね？Windowサイズにあわせてカラムが広がるレイアウトですね。でも、Windowサイズにあわせて広がるとか、普通すぎませんか？</p>
					<p>普通じゃ嫌・みんなと同じは嫌なあなたのために「<strong>Windowを広げると縮む・縮めると広がるプラグイン</strong>」を作りました。</p>
					<p class="link"><a href="http://jdtreverseliquid.googlecode.com/svn/trunk/index.html" class="sample">Live demo</a><br />
					<a href="http://jdtreverseliquid.googlecode.com/files/jdtreverseLiquid.zip" class="download">Download demo files</a></p>
					<p><span id="more-2543"></span></p>
					<h2>導入方法</h2>
					<h3>1. jQueryとjDTreverseLiquidを読み込む</h3>
					<pre>&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jdtreverseliquid.js&quot;&gt;&lt;/script&gt;</pre>
					<h3>3. 実行する</h3>
					<p>$()で対象にする要素を指定します。</p>
					<pre>jQuery(function($) {
  $('＃contents').dtReverseLiquid();
});</pre>
					<h2>オプション</h2>
					<p>オプションを使えば、広がる割合の設定、コールバック関数を使うことができます。</p>
					<table class="lftable">
					<tr>
					<th>オプション項目</th>
					<th>内容</th>
					</tr>
					<tr>
					<td>ratio</td>
					<td>デフォルトは2倍です。大きくするとその分早く縮み・広がります。</td>
					</tr>
					<tr>
					<td>callback</td>
					<td>コールバック関数<br />function(){ handler }</td>
					</tr>
					</table>
					<p class="link"><a href="http://jdtreverseliquid.googlecode.com/svn/trunk/index.html" class="sample">Live demo</a><br />
					<a href="http://jdtreverseliquid.googlecode.com/files/jdtreverseLiquid.zip" class="download">Download demo files</a></p>
					<h2>注意</h2>
					<p>ネタです。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/jdtreverseliquid/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPressでAutoPagerizeを有効にする、WP-AutoPagerizeプラグイン</title>
		<link>http://5509.me/log/wpautopagerize</link>
		<comments>http://5509.me/log/wpautopagerize#comments</comments>
		<pubDate>Tue, 01 Jun 2010 01:30:41 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://5509.me/?p=2510</guid>
		<description><![CDATA[					
					以前に作ったWordPressプラグイン「WP-AutoPagerize」ほぼ書き直して作り直したので、新しいものとして公開します。変更点を書いても仕方がないので主な要件を書いておきます。けっこう色 [...]]]></description>
			<content:encoded><![CDATA[					<p><img src="http://5509.me/wp-content/uploads/2010/05/wpa1.gif" alt="WP-AutoPagerizeキャプチャ" width="222" height="100" class="alignnone size-full wp-image-2511" /></p>
					<p>以前に作ったWordPressプラグイン「WP-AutoPagerize」ほぼ書き直して作り直したので、新しいものとして公開します。変更点を書いても仕方がないので主な要件を書いておきます。けっこう色んな環境で使えるようにしたつもりです。</p>
					<ul>
					<li>jQuery不要</li>
					<li>管理画面からオプションの変更ができる</li>
					<li>自動読み込みに加え、ボタン（リンク）クリックで読み込むオプション</li>
					<li>ページ番号を追加しないオプション</li>
					<li>ページ読み込み前の処理をJSで追加できるようにした</li>
					<li>ページ読み込み後の処理（コールバック）をJSで追加できるようにした</li>
					</ul>
					<p><a href="http://sample.moto-mono.net">動作サンプル</a>もあります。<br />
					<span id="more-2510"></span></p>
					<h2>ダウンロード</h2>
					<ul>
					<li><a href="http://downloads.wordpress.org/plugin/wp-autopagerize.zip">WP-AutoPagerize</a> (<a href="http://wordpress.org/extend/plugins/wp-autopagerize/">WordPress Plugin Direcory</a>)</li>
					</ul>
					<h2>インストール</h2>
					<ol>
					<li>WP-AutoPagerizeディレクトリをpluginsディレクトリにコピー</li>
					<li>管理画面のプラグインからアクティベート</li>
					</ol>
					<p>テンプレートに</p>
					<pre>&lt;?php wp_head(); ?&gt;</pre>
<p>と</p>
<pre>&lt;?php wp_footer(); ?&gt;</pre>
					<p>がないと動作しないので、確認しておいてください。</p>
					<p>ページャーを含んでいるので、ページャーを表示させたい箇所に以下のコードを入れて下さい。またコードは、記事ループの直後においてください。（でない場合は、要素の挿入位置オプションを利用して、追加記事の位置を指定してください)</p>
					<pre>&lt;?php if(function_exists('wp_autopagerize')) { wp_autopagerize(); } ?&gt;</pre>
<p>この<a href="http://5509.me/">ブログにも入れてみました</a>。GreasemonkeyのAutoPagerizeは動作しなくなりました。</p>
<p><img src="http://5509.me/wp-content/uploads/2010/06/hu398hga.png" alt="" title="hu398hga" width="292" height="114" class="alignnone size-full wp-image-2526" /></p>
<p>↑こんな感じになってます。個人的にローディング画像など変えてみました。</p>
<h2>オプション</h2>
<p>オプションは全てプラグイン管理画面から行います。WP-AutoPagerizeをインストールしてアクティベートすると、WordPress管理画面の設定の項目に「WP-AutoPagerize」が表示されますので、こちらから変更します。</p>
<table class="lftable">
<tr>
<th>オプション項目</th>
<th>内容</th>
</tr>
<tr>
<td>取得対象</td>
<td>取得対象の要素をdiv.postのようにクラスセレクタで指定します。指定できるセレクタはひとつです。</td>
</tr>
<tr>
<td>要素の挿入位置</td>
<td>デフォルトではページャーの直前になっていますが、ページャーの直前が記事要素でない場合に、IDで指定します</td>
</tr>
<tr>
<td>ページ番号</td>
<td>ページ番号を表示するかしないか選択できます</td>
</tr>
<tr>
<td>タイプ</td>
<td>AutoPagerizeかButtonPagerizeどちらかを選択できます</td>
</tr>
<tr>
<td>初期設定</td>
<td>AutoPagerizeのときに有効<br />初期設定で自動読み込みにするかしないか<br />しない場合は、リロードすると毎回オフになります</td>
</tr>
<tr>
<td>読み込みボタンテキスト</td>
<td>ButtonPagerizeのときに有効<br />追加読み込みボタンのテキスト</td>
</tr>
<tr>
<td>次ページ</td>
<td>ページャーの「次ページ」部分のテキスト</td>
</tr>
<tr>
<td>前ページ</td>
<td>ページャーの「前ページ」部分のテキスト</td>
</tr>
<tr>
<td>要素追加前の処理</td>
<td>ページ読み込み前の実行関数<br />function(){}</td>
</tr>
<tr>
<td>コールバック</td>
<td>コールバック関数<br />function(){}</td>
</tr>
</table>
<h2>Thanks</h2>
<p>完全にPHPをコードを書いてもらったrewさんと、ずっと使い続けてくれたシロさんに感謝です。</p>
<ul>
<li><a href="http://twitter.com/rewish">rew</a> @ <a href="http://rewish.org">Rewish</a></li>
<li><a href="http://twitter.com/shiroutoSEO">シロ</a> @ <a href="http://kachibito.net">かちびと.net</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/wpautopagerize/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ドメインを5509.meに移転したので、WordPress・リダイレクトの設定メモなど</title>
		<link>http://5509.me/log/5509_had_moved</link>
		<comments>http://5509.me/log/5509_had_moved#comments</comments>
		<pubDate>Thu, 06 May 2010 01:30:18 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[WebDev]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[memo]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[ドメイン移転]]></category>
		<category><![CDATA[バックアップ]]></category>

		<guid isPermaLink="false">http://5509.me/?p=2454</guid>
		<description><![CDATA[					
					ようやくドメインを http://moto-mono.net/ から http://5509.me/ に移転しました。ドメインの移転ということで、念のため前のデータは全て残しつつ、htaccessで [...]]]></description>
			<content:encoded><![CDATA[					<p><img src="http://5509.me/wp-content/uploads/2010/05/a0002_002274_m.jpg" alt="" title="ドメインひっこしました" width="500" height="240" class="alignnone size-full wp-image-2497" /></p>
					<p>ようやくドメインを <strong>http://moto-mono.net/</strong> から <strong>http://5509.me/</strong> に移転しました。ドメインの移転ということで、念のため前のデータは全て残しつつ、htaccessで新しいドメインにリダイレクトしています。その辺のメモ。色々キャプチャ取り忘れたので、画像が全然なくて意味わからないかもしれないです。タイトルにもある通り、WordPressでのデータ移転も含めて書きました。</p>
					<h2>準備</h2>
					<h3>1. 新しいドメイン（ディレクトリ）にWordPressをインストールしておく</h3>
					<p>そのままなんですけど、先にインストールしておきます。プレフィクス（テーブル接頭語）は基本的に以前のブログと同じもので大丈夫ですが、同じDBを使う場合はあとあと置換するプレフィクスにしておきます。ここでは<strong>gogo09_</strong>。</p>
					<h3>2. wp-contentをコピーしておく</h3>
					<p>テーマとかプラグイン、アップロードした画像ファイルなどもろもろ入っているのでこれもアップロードしておきます。</p>
					<h3>3. データをまるっとバックアップ</h3>
					<p>データのエクスポートは<a href="http://ilfilosofo.com/blog/wp-db-backup/">WordPress Database Backup</a>で。<br />
					<a href="http://urbangiraffe.com/plugins/redirection/">Redirection</a>も使っているのですが、このRedirectionのログがあほみたいに容量（6MB強）が大きかったのでこれだけチェック外しました。</p>
					<p><a href="http://5509.me/wp-content/uploads/2010/05/55_1.png"><img src="http://5509.me/wp-content/uploads/2010/05/55_1.png" alt="" title="ログのやつ" width="172" height="35" class="alignnone size-full wp-image-2461" /></a></p>
					<h3>4. プレフィクスを置換する</h3>
					<p>そもそも違うDBを使う場合はそのままで問題ないですが、今回は同じDBを使っているので、プレフィクスを置換しました。ダウンロードしたバックアップSQLデータをテキストエディタで開いて（シンタックスハイライトはオフにしないと大変なことになります）、一発置換でいいです。</p>
					<p>&#8220;next_&#8221; >> &#8220;gogo09_&#8221;</p>
					<h2>データの取り込みからWordPressへの適用</h2>
					<h3>1. バックアップデータをインポートする</h3>
					<p>プレフィクス置換済みのものをインポートします。インポートはphpMyAdminのImportから行いました。</p>
					<h3>2. ドメインを書き換える</h3>
					<p>設定が古いドメインのままになっているので、まずはDBを書き換えます。ドメイン設定は、<strong>プレフィクス_options</strong>に含まれています。</p>
					<p><a href="http://5509.me/wp-content/uploads/2010/05/55_2.png"><img src="http://5509.me/wp-content/uploads/2010/05/55_2.png" alt="" title="options" width="92" height="26" class="alignnone size-full wp-image-2465" /></a></p>
					<p>Browseから一覧を表示してsiteurlの項目の値を新しいドメインに書き換えます。</p>
					<p><a href="http://5509.me/wp-content/uploads/2010/05/55_3.png"><img src="http://5509.me/wp-content/uploads/2010/05/55_3-300x12.png" alt="" title="site_url" width="480" class="alignnone size-medium wp-image-2467" /></a></p>
					<h3>3. WordPressにアクセスする</h3>
					<p>http://新しいドメイン/wp-admin からWordPressにアクセスします。するとデータが更新されて、中身盛りだくさんなブログになっているはずです。</p>
					<h4>3-1. 基本設定のWordPressの場所を変更する</h4>
					<p><a href="http://5509.me/wp-content/uploads/2010/05/55_4.png"><img src="http://5509.me/wp-content/uploads/2010/05/55_4.png" alt="" title="WordPressの場所" width="403" height="76" class="alignnone size-full wp-image-2475" /></a></p>
					<p>上のほうですね。新しいドメインに変えます。</p>
					<h4>3-2. アップロードファイルを変更する</h4>
					<p><a href="http://5509.me/wp-content/uploads/2010/05/55_5.png"><img src="http://5509.me/wp-content/uploads/2010/05/55_5-300x24.png" alt="" title="画像のアップロード先" width="300" height="24" class="alignnone size-medium wp-image-2477" /></a></p>
					<p>これも新しいディレクトリに変えておきます。</p>
					<h3>4. 記事などに含まれる古いドメインを新しいドメインに書き換える</h3>
					<p>これは<a href="http://urbangiraffe.com/plugins/search-regex">Search Regex</a>というプラグインを使うと簡単に書き換えることができます。</p>
					<p><a href="http://5509.me/wp-content/uploads/2010/05/55_6.png"><img src="http://5509.me/wp-content/uploads/2010/05/55_6-300x209.png" alt="" title="Search Regex" width="300" height="209" class="alignnone size-medium wp-image-2480" /></a></p>
					<p>検索するとずらっと出てくるので、<strong>Search pattern</strong>に検索語、<strong>Replace pattern</strong>に置換するものを入れて<strong>Replate &#038; Save</strong>ボタンをクリックすることで一発置換できます。</p>
					<p>ここまでで、新しいドメイン上で今までのデータを持ったブログができました。</p>
					<h3>(5.) パーマリンクの変更</h3>
					<p>ドメインを変えたことにあわせて、記事のパーマリンクも変更しました。なんせ長かった･･･</p>
					<p>今までのパーマリンク：<strong>/%year%/%month%/%day%/%postname%.html</strong><br />
					新しいパーマリンク：<strong>/log/%postname%</strong></p>
					<p>だいぶすっきり！</p>
					<h2>mod_rewriteを使ったリダイレクトの設定</h2>
					<p>このままだと諸々登録されている古いブログのほうにアクセスが集まってしまうので、新しいブログへリダイレクトを設定します。htaccessでmod_rewriteの指定を行います。ドメインが変わるので、恒久的なリダイレクトになり、<a href="http://www.asahi-net.or.jp/~ax2s-kmtn/ref/status.html">ステータスコードは301</a>を使います。</p>
					<p>mod_rewriteの指定方法は「<a href="http://webtech.akijapan.com/htaccess/rewrite.phtml">URLの書き換え Rewrite</a>」を参考にしてください。</p>
					<pre>RewriteRule ([^\/\.]+)\.html$ http://5509.me/log/$1 [R=301,L]
RewriteRule index.php http://5509.me/ [R=301,L]
RewriteRule ^(feed|about|labs)$ http://5509.me/$1 [R=301,L]
RewriteRule ^(tag|category)(\/.*)$ http://5509.me/$1$2 [R=301,L]
RewriteRule ^([0-9]+)(\/[0-9]+)? http://5509.me/log/$1$2 [R=301,L]</pre>
					<p>1行目は、旧記事URLから新しいURLへのリダイレクト。<br />
					2行目は、トップページのリダイレクト。<br />
					3行目は、ページとfeedのリダイレクト。<br />
					4行目は、タグとカテゴリページのリダイレクト。<br />
					5行目は、アーカイブページのリダイレクト。</p>
					<h3>記事URLのリダイレクト</h3>
					<p>重要なのは1行目なので、そこだけ解説しておきます。たとえば、要素をふわっと表示させる〜のURLは</p>
					<p>http://moto-mono.net/2010/04/30/<strong>whatinout</strong>.html</p>
					<p>ですが、新しいURLのルールは</p>
					<p>http://5509.me/log/<strong>whatinout</strong></p>
					<p>に変わります。共通する箇所は太字になっているところなので、この部分を正規表現で取得します。正規表現は</p>
					<p><strong>([^\/\.]+)\.html$</strong></p>
					<p>になり、（）で取得した部分を<strong>$1</strong>で取得できるのでリダイレクトのURLは</p>
					<p><strong>http://5509.me/log/$1</strong></p>
					<p>となります。</p>
					<p>にそれぞれなっています。基本的に正規表現が使えるはずですが、<strong>チカッパはapacheのバージョンが1.3.xx系だった</strong>ので <strong>\d{2} とかが使えません</strong>でした。</p>
					<h2>Google Analyticsなど使っているサービスのドメイン変更など</h2>
					<p>最後に、使っているサービスのドメインを変更しておきます。これが結構多くて大変でしたね。。</p>
					<h2>それにしても</h2>
					<p>全部の数字が0とか新鮮ですね･･･なんとなく記念にキャプチャした。</p>
					<p><img src="http://5509.me/wp-content/uploads/2010/05/55_8.png" alt="" title="55_8" width="381" height="277" class="alignnone size-full wp-image-2501" /></p>
					<p><img src="http://5509.me/wp-content/uploads/2010/05/55_7.png" alt="" title="55_7" width="281" height="346" class="alignnone size-full wp-image-2502" /></p>
					<p>さみしくなんかないよ･･･！</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/5509_had_moved/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>新しい名刺ができました</title>
		<link>http://5509.me/log/newcard</link>
		<comments>http://5509.me/log/newcard#comments</comments>
		<pubDate>Mon, 03 May 2010 07:10:42 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[Diary]]></category>
		<category><![CDATA[ロゴ]]></category>
		<category><![CDATA[名刺]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=2432</guid>
		<description><![CDATA[					4月中ごろに友だちのデザイナーに新しい名刺を作ってもらいました。僕のイメージでお願いしたのですが、かなりかわいい名刺になってだいぶ満足してます。次の4月まではこの名刺で、通称たぬきカードです。よろしくです。
	 [...]]]></description>
			<content:encoded><![CDATA[					<p>4月中ごろに友だちのデザイナーに新しい名刺を作ってもらいました。僕のイメージでお願いしたのですが、かなりかわいい名刺になってだいぶ満足してます。次の4月まではこの名刺で、通称<strong>たぬきカード</strong>です。よろしくです。</p>
					<p>で、名刺と一緒にロゴとパターンも作ってもらって、ブログのロゴと背景をそれに置き換えました。ロゴは<a href="http://u2.5509.me/log/249">ゆに</a>をモチーフにしたものだそうでこれまたかわいい･･･</p>
					<p>ちなみに裏のかえるは自分で貼ったステッカーなので、お渡ししてる分にはかえるはいないです。でも貼ったらますますかわいくなったので、なにか貼りたいなー。</p>
					<p><img src="http://5509.me/wp-content/uploads/2010/05/5509card.jpg" alt="5509 card" title="5509 card" width="500" height="333" class="alignnone size-full wp-image-2433" /></p>
					<h2>5509の読み方</h2>
					<p>「ごーごーぜろきゅー」が正しい読み方らしいですけど、「ごじゅうごおく」っていう読み方もあります。もう「ごーごー」でいいんじゃないですかね（投げやり</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/newcard/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ありそうでなかった？要素をふわっと表示させるjQueryプラグイン whatInOut</title>
		<link>http://5509.me/log/whatinout</link>
		<comments>http://5509.me/log/whatinout#comments</comments>
		<pubDate>Fri, 30 Apr 2010 01:45:49 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=2412</guid>
		<description><![CDATA[					Windows7のウィンドウのようにふわっと表示・非表示させることができます。ふわっとと、whatをかけ･･･（ｒｙ
					色々な環境で試せてないので、バグというか予期しない動きは多いかもしれないです。tw [...]]]></description>
			<content:encoded><![CDATA[					<p>Windows7のウィンドウのようにふわっと表示・非表示させることができます。ふわっとと、whatをかけ･･･（ｒｙ<br />
					色々な環境で試せてないので、バグというか予期しない動きは多いかもしれないです。twitterかコメントで報告もらえれば対応できる範囲で対応します。</p>
					<p>ふわっとするためだけにeasingが必要になるいけてない仕様なんですけど、easingを別のところでも使ってカバーしてください（！）それかeasing関数を書いてもらえると･･･</p>
					<p class="link"><a href="http://5509.me/sample/whatinout/" class="sample">Live demo</a><br />
					<a href="http://5509.me/sample/archive/whatinout.zip" class="download">Download demo files</a></p>
					<p><span id="more-2412"></span></p>
					<h2>導入方法</h2>
					<h3>1. jQueryとeasingプラグイン、whatinoutを読み込む。</h3>
					<pre>&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/easing.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/whatinout.js&quot;&gt;&lt;/script&gt;</pre>
					<h3>3. 実行する</h3>
					<p>$()で対象にする要素を指定します。実際に使う場合は、ふわっと表示させたいときにwhatIn()、ふわっと消したいときにwhatOut()、ふわっとスライドインしたいときにwhatSlideIn()、ふわっとスライドアウトしたいときにwhatSlideOut()を実行します。この辺はshow()やhide()、fadeIn()やfadeOut()と使い方がよく似ているので問題はないでしょう。</p>
					<pre>jQuery(function($) {
	$('.whatInOut').whatIn({
		sizeFrom: 95,
		duration: 500
	});
	$('.whatInOut').whatOut({
		sizeTo: 95,
		duration: 500
	});
	$('.whatInOut').whatSlideIn();
	$('.whatInOut').whatSlideOut();
});</pre>
					<h2>オプション</h2>
					<p>実行時の引数にオプションを与えることで、設定をある程度変えることができます。使うことが出来るオプションは以下の通りです。</p>
					<p>whatIn()とwhatOut()、whatSlideIn()とwhatSlideOut()ではそれぞれオプション項目の名前がちょっと違います。</p>
					<h3>whatIn()</h3>
					<table class="lftable">
					<tr>
					<th>オプション項目</th>
					<th>内容</th>
					</tr>
					<tr>
					<td>easing</td>
					<td>好きなeasingを指定できます。デフォルトはeaseInOutCircでeasingプラグインを読んでない場合はswing</td>
					</tr>
					<tr>
					<td>duration</td>
					<td>表示するまでの時間。ミリセカンドかslow, normal, fast</td>
					</tr>
					<tr>
					<td>sizeFrom</td>
					<td>元の大きさの何%の大きさからアニメーションを始めるか。%ですが、指定は数値のみ</td>
					</tr>
					<tr>
					<td>callback</td>
					<td>コールバック関数<br />function(){ handler }</td>
					</tr>
					</table>
					<h3>whatOut()</h3>
					<table class="lftable">
					<tr>
					<th>オプション項目</th>
					<th>内容</th>
					</tr>
					<tr>
					<td>easing</td>
					<td>好きなeasingを指定できます。デフォルトはeaseInOutCircでeasingプラグインを読んでない場合はswing</td>
					</tr>
					<tr>
					<td>duration</td>
					<td>表示するまでの時間。ミリセカンドかslow, normal, fast</td>
					</tr>
					<tr>
					<td>sizeTo</td>
					<td>元の大きさの何%の大きさまでアニメーションを行うか。%ですが、指定は数値のみ</td>
					</tr>
					<tr>
					<td>callback</td>
					<td>コールバック関数<br />function(){ handler }</td>
					</tr>
					</table>
					<h3>whatSlideIn()</h3>
					<table class="lftable">
					<tr>
					<th>オプション項目</th>
					<th>内容</th>
					</tr>
					<tr>
					<td>easing</td>
					<td>好きなeasingを指定できます。デフォルトはeaseInOutCircでeasingプラグインを読んでない場合はswing</td>
					</tr>
					<tr>
					<td>duration</td>
					<td>表示するまでの時間。ミリセカンドかslow, normal, fast</td>
					</tr>
					<tr>
					<td>posIn</td>
					<td>元の位置からどれだけずらした状態から表示するか。下から表示する場合正の値、上から表示する場合負の値（&#8217;-20&#8242;などのように)を指定</td>
					</tr>
					<tr>
					<td>callback</td>
					<td>コールバック関数<br />function(){ handler }</td>
					</tr>
					</table>
					<h3>whatSlideOut()</h3>
					<table class="lftable">
					<tr>
					<th>オプション項目</th>
					<th>内容</th>
					</tr>
					<tr>
					<td>easing</td>
					<td>好きなeasingを指定できます。デフォルトはeaseInOutCircでeasingプラグインを読んでない場合はswing</td>
					</tr>
					<tr>
					<td>duration</td>
					<td>表示するまでの時間。ミリセカンドかslow, normal, fast</td>
					</tr>
					<tr>
					<td>posOut</td>
					<td>元の位置からどれだけずらした状態で非表示するか。下にずらして非表示する場合正の値、上にずらして非表示する場合負の値（&#8217;-20&#8242;などのように)を指定</td>
					</tr>
					<tr>
					<td>callback</td>
					<td>コールバック関数<br />function(){ handler }</td>
					</tr>
					</table>
					<p class="link"><a href="http://5509.me/sample/whatinout/" class="sample">Live demo</a><br />
					<a href="http://5509.me/sample/archive/whatinout.zip" class="download">Download demo files</a></p>
					<h2>仕様</h2>
					<ul>
					<li>インラインな要素には適用できないっぽいです（改善中かも</li>
					<li>連続して実行してもたぶん大丈夫</li>
					<li>クロスブラウザ</li>
					</ul>
					<h2>Special Thanks</h2>
					<p>mukimukiメンバ、<a href="http://twitter.com/yunozy/">@yunozy</a></p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/whatinout/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Nite LP, Disk 9「Coder&#8217;s Higher」で講演しました</title>
		<link>http://5509.me/log/lp9-2</link>
		<comments>http://5509.me/log/lp9-2#comments</comments>
		<pubDate>Wed, 21 Apr 2010 10:30:43 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[Diary]]></category>
		<category><![CDATA[memo]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=2378</guid>
		<description><![CDATA[					
					［撮影：おかだよういち］
					CSS Nite LP, Disk 9「Coder&#8217;s Higher」で「Coding with jQuery」というタイトルのお話をさせていただきま [...]]]></description>
			<content:encoded><![CDATA[					<p><img src="http://5509.me/wp-content/uploads/2010/04/dsc3000_1.jpg" alt="LP9_jQuery_tokuda" title="LP9_jQuery_tokuda" width="500" height="332" class="alignnone size-full wp-image-2390" /><br />
					<span class="caption">［撮影：<a href="http://s-style-arts.info/">おかだよういち</a>］</span></p>
					<p><a href="http://lp9.cssnite.jp">CSS Nite LP, Disk 9「Coder&#8217;s Higher」</a>で「<strong>Coding with jQuery</strong>」というタイトルのお話をさせていただきました。</p>
					<p>出演させていただいたことはもちろん、ずっとお話したかった方々にお会いできたり、<a href="http://twitter.com/rewish/mukimuki">muki</a>オフだったりとても楽しい1日でした。出演者のみなさま、聞いてくれたみなさま、スタッフのみなさま、本当にありがとうございました。</p>
					<p>どれくらい緊張したのかっていうのは、写真の顔のてかり具合を見れいただければ･･･汗がはんぱなかったです。終わったあとは髪型が60%くらい変わってましたね。</p>
					<p>本当はもっと突っ込んだところとかも話したかったのですが、結構流し気味だったので。。ともあれ、今回一番伝えたかったことは、jQueryもっと使ってみようよ！っていうことで、少しでもやってみよう！という気持ちになっていただけたのならうれしいです。</p>
					<p>あ、あとたぬきも人気だったようでなによりです。たぬきかわいいねんで。</p>
					<h2>紹介した本</h2>
					<p>この2つはかなりの良著で、JSを始めたいと思っているコーダー・Webデザイナーの方には最適です。JSの基礎もあったりするのですが、とりあえずはこの2つを読んでみて、突っ込んだところが必要になってきてからでいいと思います。</p>
					<table  border="0" cellpadding="5" class="amazon">
					<tr>
					<td colspan="2"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4048684116/norimania-22/" target="_blank">Web制作の現場で使う jQueryデザイン入門 (WEB PROFESSIONAL)</a></td>
					</tr>
					<tr>
					<td valign="top"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4048684116/norimania-22/" target="_blank"><img src="http://ecx.images-amazon.com/images/I/519BkKhFUWL._SL160_.jpg" border="0" alt="Web制作の現場で使う jQueryデザイン入門 (WEB PROFESSIONAL)" /></a></td>
					<td valign="top"><font size="-1">西畑一馬</p>
					<p>アスキー・メディアワークス  2010-02-12<br />売り上げランキング : 41463</p>
					<p><strong>おすすめ平均  </strong><img src="http://g-images.amazon.com/images/G/01/detail/stars-5-0.gif" alt="star" /><br /><img src="http://g-images.amazon.com/images/G/01/detail/stars-5-0.gif" alt="star" />プログラム初心者にお勧め<br /><img src="http://g-images.amazon.com/images/G/01/detail/stars-5-0.gif" alt="star" />自分でJavascript操作したい人にお勧め</p>
					<p><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4048684116/norimania-22/" target="_blank">Amazonで詳しく見る</a></font><font size="-2"> by <a href="http://www.goodpic.com/mt/aws/index.html" >G-Tools</a></font></td>
					</tr>
					</table>
					<p>追記： DOM Scripting標準ガイドブックは絶版なようで、Amazonでもマーケットプレイスでしか買うことができません。現在ジュンク堂であれば、在庫が少しあるようなので、予定がある人はお早めにどうぞ。</p>
					<p><a href="http://www.junkudo.co.jp/detail.jsp?ID=0107952153">http://www.junkudo.co.jp/detail.jsp?ID=0107952153</a></p>
					<table  border="0" cellpadding="5" class="amazon">
					<tr>
					<td colspan="2"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4839922373/norimania-22/" target="_blank">DOM Scripting 標準ガイドブック ~やさしく学ぶ、JavaScriptとDOMによるWebデザイン~ (Web Designing BOOKS)</a></td>
					</tr>
					<tr>
					<td valign="top"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4839922373/norimania-22/" target="_blank"><img src="http://ecx.images-amazon.com/images/I/41ER9SJujTL._SL160_.jpg" border="0" alt="DOM Scripting 標準ガイドブック ~やさしく学ぶ、JavaScriptとDOMによるWebデザイン~ (Web Designing BOOKS)" /></a></td>
					<td valign="top"><font size="-1">Jeremy Keith (著), 中村 享介 (監修), 吉川 典秀 (翻訳)</p>
					<p>毎日コミュニケーションズ  2007-06-21<br />売り上げランキング : 18058</p>
					<p><strong>おすすめ平均  </strong><img src="http://g-images.amazon.com/images/G/01/detail/stars-4-5.gif" alt="star" /><br /><img src="http://g-images.amazon.com/images/G/01/detail/stars-5-0.gif" alt="star" />これからのWEBデザインには必須の本<br /><img src="http://g-images.amazon.com/images/G/01/detail/stars-1-0.gif" alt="star" />初心者にはおすすめできません。<br /><img src="http://g-images.amazon.com/images/G/01/detail/stars-5-0.gif" alt="star" />デザイナに役立つ良書です</p>
					<p><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4839922373/norimania-22/" target="_blank">Amazonで詳しく見る</a></font><font size="-2"> by <a href="http://www.goodpic.com/mt/aws/index.html" >G-Tools</a></font></td>
					</tr>
					</table>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/lp9-2/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>たった1行でブラウザにFlashがインストールされているか判定するJSコード</title>
		<link>http://5509.me/log/isflashinstalled</link>
		<comments>http://5509.me/log/isflashinstalled#comments</comments>
		<pubDate>Fri, 09 Apr 2010 05:35:19 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=2351</guid>
		<description><![CDATA[					1行っていうのはアレですが、、
					下記のisFlashInstalledを宣言しておいて
					var isFlashInstalled=function(){if(navigator.plugin [...]]]></description>
			<content:encoded><![CDATA[					<p>1行っていうのはアレですが、、<br />
					下記の<strong>isFlashInstalled</strong>を宣言しておいて</p>
					<pre>var isFlashInstalled=function(){if(navigator.plugins["Shockwave Flash"]){return true;}try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash");return true;}catch(a){return false;}}();</pre>
<p>if文で使えます</p>
<pre>if ( isFlashInstalled ) {
&nbsp;&nbsp;alert('Flash Player is installed');
} else {
&nbsp;&nbsp;alert('Flash Player is not installed');
}</pre>
					<p class="link"><a href="http://5509.me/sample/isFlashInstalled">実行サンプル</a></p>
					<p><span id="more-2351"></span></p>
					<p>圧縮前のソースはこんなんです。</p>
					<pre>var isFlashInstalled = function() {
&nbsp;&nbsp;if ( navigator.plugins['Shockwave Flash'] ) {
&nbsp;&nbsp;&nbsp;&nbsp;return true;
&nbsp;&nbsp;}
&nbsp;&nbsp;try {
&nbsp;&nbsp;&nbsp;&nbsp;new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
&nbsp;&nbsp;&nbsp;&nbsp;return true;
&nbsp;&nbsp;} catch (e) {
&nbsp;&nbsp;&nbsp;&nbsp;return false;
&nbsp;&nbsp;}
}();</pre>
					<p>ソース見てもらえば分かると思うんですけど、本当は</p>
					<pre>!!navigator.plugins['Shockwave Flash']</pre>
<p>これだけでいけるんですよね。IEのせいで超ムダに長くなってますw</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/isflashinstalled/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Urchin6のUTMとGoogle Analytics(urchin.js, ga.js)を併用するとき</title>
		<link>http://5509.me/log/urchin-utm-with-googleanalytics</link>
		<comments>http://5509.me/log/urchin-utm-with-googleanalytics#comments</comments>
		<pubDate>Fri, 02 Apr 2010 03:38:07 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[memo]]></category>
		<category><![CDATA[Urchin]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=2345</guid>
		<description><![CDATA[					備忘として。。
					Urchin6のUTMとGoogle Analytics(以下ga)を併用するときはUrchin側の導入コードが少し変わります。
					1. 必要なファイルの準備
					 「_ [...]]]></description>
			<content:encoded><![CDATA[					<p>備忘として。。</p>
					<p>Urchin6のUTMとGoogle Analytics(以下ga)を併用するときはUrchin側の導入コードが少し変わります。</p>
					<h2>1. 必要なファイルの準備</h2>
					<p> 「__utm.gif」をサーバー（ドメイン）ルートにコピー。</p>
					<h2>2. UTMを利用するためにgaのコードに追加</h2>
					<h3>urchin.jsを使っている場合</h3>
					<pre>&lt;script type="text/javascript"&gt;
_userv=2; // ここを追加
_uacct="UA-XXXXXXX-Y";
urchinTracker();
&lt;/script&gt;</pre>
					<h3>ga.jsを使っている場合</h3>
					<pre>&lt;script type="text/javascript"&gt;
var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._setLocalRemoteServerMode(); // ここを追加
pageTracker._initData();
pageTracker._trackPageview();
&lt;/script&gt;</pre>
					<p>どちらもローカル サーバー モードの変更で、デフォルトではGAのサーバーのみに送信しているので、これをローカルサーバー（Urchinのサーバー）にも送信するように設定できます。</p>
					<p>参考： <a href="http://www.google.com/support/googleanalytics/bin/answer.py?hl=jp&#038;answer=76305">http://www.google.com/support/googleanalytics/bin/answer.py?hl=jp&#038;answer=76305</a></p>
					<p>ドキュメントを見てると、「__utm.gif」はルートじゃなくてもよさそう。その場合は</p>
					<pre>_ugifpath = 'newLocalGifPath'; // urchin.jsの場合
pageTracker._setLocalGifPath(newLocalGifPath); // ga.jsの場合</pre>
					<p>でそれぞれ指定してあげればよさそう。<br />
					あ、Urchinの取得タイプをUTMに変更するのを忘れずに･･･</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/urchin-utm-with-googleanalytics/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TwitterのHover Cardを実装するjQueryプラグイン twttrFloatTip</title>
		<link>http://5509.me/log/twitter-float-tip</link>
		<comments>http://5509.me/log/twitter-float-tip#comments</comments>
		<pubDate>Wed, 17 Mar 2010 04:34:14 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=2305</guid>
		<description><![CDATA[					
					100317 16:28 追記：
					Twitterの言語が日本語になっている場合、Hover Cardは表示されないようです。Englishにすれば表示されるので、オフィシャルのものとあわせ [...]]]></description>
			<content:encoded><![CDATA[					<p><img src="http://5509.me/wp-content/uploads/2010/03/twttrfloattip1.png" alt="twttrfloattip1" title="twttrfloattip1" width="336" height="296" class="alignnone size-full wp-image-2309" /></p>
					<p class="note"><strong>100317 16:28 追記：<br />
					Twitterの言語が日本語になっている場合、Hover Cardは表示されないようです。Englishにすれば表示されるので、オフィシャルのものとあわせて確認してみてください <img src='http://5509.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong>
					<p>最近Twitterに実装された、HoverCard（@screen_name リンクにカーソルをのせるとユーザー情報が表示されるやつ）を実装できるjQueryプラグインです。</p>
					<p>デザインがちょっと違う・listsがfavouritesになっている、など違う点もあるのですが、基本的には同じように実装できるようにしました。インラインは現時点で未実装ですが、要望がそれなりにあれば実装しようかと思っています。</p>
					<p class="link"><a href="http://twitter-float-tip.googlecode.com/svn/trunk/index.html" class="sample">Live demo</a><br />
					<a href="http://twitter-float-tip.googlecode.com/files/twttrFloatTip1.4.zip" class="download">Download demo files</a></p>
					<p><span id="more-2305"></span></p>
					<h2>導入方法</h2>
					<h3>1.twttrFloatTip.css、 jQueryとtwttrFloatTip.jsを読み込む。</h3>
					<pre name="code" class="html">

&lt;link type=&quot;text/css&quot; rel=&quot;stylesheet&quot; href=&quot;css/twttrFloatTip.css&quot; /&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://www.google.com/jsapi&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;google.load(&#039;jquery&#039;,&#039;1.4.2&#039;);&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/twttrFloatTip.js&quot;&gt;&lt;/script&gt;
</pre>
					<h3>2. 適用する要素を決める</h3>
					<p>サンプルでは <strong>a.tw</strong>に適用しています。要素のテキストをTwitterのscreen_nameとして情報を取得します。</p>
					<pre name="code" class="html">

&lt;a href=&quot;http://twitter.com/dotcoder&quot; class=&quot;tw&quot;&gt;dotcoder&lt;/a&gt;
</pre>
					<h3>3. 実行する</h3>
					<p>$()で対象にする要素を指定します。</p>
					<pre name="code" class="js">

jQuery(function($){
&nbsp;&nbsp;$(&#039;a.tw&#039;).twttrFloatTip();
});
</pre>
					<h2>使い方？</h2>
					<p>ソースを読んで適用したら、対象要素にカーソルをのせるとカートが表示されます。要素が表示領域の半分よりも上にあれば、要素の下に、半分よりも下にあれば、要素の上にカードが表示されます。</p>
					<h3>上に表示されるキャプチャ</h3>
					<p><img src="http://5509.me/wp-content/uploads/2010/03/twttrfloattip1.png" alt="twttrfloattip1" title="twttrfloattip1" width="336" height="296" class="alignnone size-full wp-image-2309" /></p>
					<h3>下に表示されるキャプチャ</h3>
					<p><img src="http://5509.me/wp-content/uploads/2010/03/twttrfloattip2.png" alt="twttrfloattip2" title="twttrfloattip2" width="324" height="288" class="alignnone size-full wp-image-2310" /></p>
					<p>実際の動き等はデモを見てください。</p>
					<h2>オプション</h2>
					<p>実行時の引数にオプションを与えることで、設定をある程度変えることができます。使うことが出来るオプションは以下の通りです。</p>
					<table class="lftable">
					<tr>
					<th>オプション項目</th>
					<th>内容</th>
					</tr>
					<tr>
					<td>user_name</td>
					<td>ユーザー名を取得する対象<br />text, href, attr<br />デフォルトはtextで対象要素のテキスト</td>
					</tr>
					<tr>
					<td>attr</td>
					<td>user_nameでattrを指定した際の属性</td>
					</tr>
					<tr>
					<td>href</td>
					<td>対象要素をaにしてかつ、user_nameをhrefにした際、スクリーン名を取得するためにカットするURLの部分</td>
					</tr>
					<tr>
					<td>loadingText</td>
					<td>ロード時に表示するテキスト</td>
					</tr>
					<tr>
					<td>hideDuration</td>
					<td>TwttrFloatTipからカーソルが離れたときにTipが消えるまでの間隔</td>
					</tr>
					<tr>
					<td>spaceFix</td>
					<td>カーソルからTwttrFloatTipまでの距離</td>
					</tr>
					<tr>
					<td>temp</td>
					<td>テンプレート（後述）<br />function(data) {}</td>
					</tr>
					<tr>
					<td>loading</td>
					<td>ローディング時のテンプレート（後述）<br />function() {}</td>
					</tr>
					</table>
					<h3>テンプレート（temp）</h3>
					<p>引数のdataからパラメータを取得できるので、自由にテンプレートを変更できます。使えるパラメータは以下の通りです。</p>
					<table class="lftable">
					<tr>
					<th>パラメータ</th>
					<th>取得出来る値</th>
					</tr>
					<tr>
					<td>profile_image_url</td>
					<td>ユーザーのアイコンのソース</td>
					</tr>
					<tr>
					<td>name</td>
					<td>ユーザー名</td>
					</tr>
					<tr>
					<td>screen_name</td>
					<td>スクリーン名</td>
					</tr>
					<tr>
					<td>location</td>
					<td>場所</td>
					</tr>
					<tr>
					<td>url</td>
					<td>TwitterURL</td>
					</tr>
					<tr>
					<td>description</td>
					<td>紹介文</td>
					</tr>
					<tr>
					<td>latest_tweet</td>
					<td>最新のつぶやき</td>
					</tr>
					<tr>
					<td>statuses_count</td>
					<td>つぶやき数</td>
					</tr>
					<tr>
					<td>friends_count</td>
					<td>フォロー数</td>
					</tr>
					<tr>
					<td>followers_count</td>
					<td>フォロワー数</td>
					</tr>
					<tr>
					<td>favourites_count</td>
					<td>お気に入り数</td>
					</tr>
					</table>
					<h4>テンプレートの書き方</h4>
					<p>テンプレートは以下のように、function(data) {} の中でreturnで返すようにします。</p>
					<pre>jQuery(function($){
&nbsp;&nbsp;$('a.tw').twttrFloatTip({
&nbsp;&nbsp;&nbsp;&nbsp;temp: function(data) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return [
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'&lt;div&gt;',
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data['user_name'],
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'&lt;/div&gt;'
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;].join('');
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;});
});</pre>
					<h3>テンプレート（loading）</h3>
					<p>ローディングテンプレートの中では、ローディングテキストのみ利用できます。ローディングテキストは「this.loadingText」です。</p>
					<h3>オプション利用時のサンプルコード</h3>
					<pre>jQuery(function($){
&nbsp;&nbsp;$('a.tw').twttrFloatTip({
&nbsp;&nbsp;&nbsp;&nbsp;user_name: 'href',
&nbsp;&nbsp;&nbsp;&nbsp;href: 'http://hogehoge.com/',
&nbsp;&nbsp;&nbsp;&nbsp;loadingText: 'hogeding',
&nbsp;&nbsp;&nbsp;&nbsp;hideDuration: 100,
&nbsp;&nbsp;&nbsp;&nbsp;temp: function(data) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return [
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'&lt;div&gt;',
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data['user_name'],
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'&lt;/div&gt;'
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;].join('');
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;});
});</pre>
					<p class="link"><a href="http://twitter-float-tip.googlecode.com/svn/trunk/index.html" class="sample">Live demo</a><br />
					<a href="http://twitter-float-tip.googlecode.com/files/twttrFloatTip1.4.zip" class="download">Download demo files</a></p>
					<h2>仕様</h2>
					<p><strong>*</strong> の項目はオプション等で変更できるようになる予定です。</p>
					<ul>
					<li>データの受信にはJSONPを使ってます</li>
					<li>一度受信したデータはページを遷移するまでキャッシュされます</li>
					<li><strong>*</strong> インラインのHover Cardは現在未実装</li>
					<li>受信しているデータの関係で、オフィシャルで lists になっている項目は favourites になってます</li>
					<li><strong>*</strong> Lates Tweet で @で始まるユーザ名やリンクがある場合は、アンカーを貼る仕様にしています</li>
					<li>要素からカーソルを外して500ミリセカンド後にCardが消えるようになっています</li>
					</ul>
					<h2>Special Thanks</h2>
					<p><a href="http://twitter.com/rewish">@rew</a> @ <a href="http://rewish.org">rewish</a><br />
					割と強引に色々見てもらいました。</p>
					<h2>更新履歴</h2>
					<dl>
					<dt>2010.03.31</dt>
					<dd>横の判定も追加して、右寄りのときは左に表示するように</dd>
					<dt>2010.03.29</dt>
					<dd>オプション項目を追加</dd>
					</dl>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/twitter-float-tip/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQueryライクなDOMにスタイルを適用する関数</title>
		<link>http://5509.me/log/set-styles-like-jquery-css-method</link>
		<comments>http://5509.me/log/set-styles-like-jquery-css-method#comments</comments>
		<pubDate>Sun, 14 Mar 2010 16:13:14 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=2293</guid>
		<description><![CDATA[					jQueryは.css()を使えば、まるでCSSを書いているかのようにスタイルを適用できて便利ですよね。jQueryを使わない場合でも同じように書けるととても便利なので、いつも以下みたいな関数を用意してます。
 [...]]]></description>
			<content:encoded><![CDATA[					<p>jQueryは.css()を使えば、まるでCSSを書いているかのようにスタイルを適用できて便利ですよね。jQueryを使わない場合でも同じように書けるととても便利なので、いつも以下みたいな関数を用意してます。</p>
					<pre>// Set Styles
function set_styles(elm, hash) {
&nbsp;&nbsp;for( var c in hash ) {
&nbsp;&nbsp;&nbsp;&nbsp;elm.style[c] = hash[c];
&nbsp;&nbsp;}
}</pre>
					<p>これさえあれば、あとは簡単</p>
					<pre>set_styles(element, {
&nbsp;&nbsp;margin: '5px 0 5px 5px',
&nbsp;&nbsp;width: '100px',
&nbsp;&nbsp;height: '100px',
&nbsp;&nbsp;fontSize: '14px'
});</pre>
					<p>こんな感じにjQueryの.css()と同じように（ちょっと違うけど）書けます。便利。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/set-styles-like-jquery-css-method/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Google Analyticsのurchin.js(古いやつ)でhttp・httpsどちらにも対応させる</title>
		<link>http://5509.me/log/using-urchin-js-with-both-http-and-https-protocol</link>
		<comments>http://5509.me/log/using-urchin-js-with-both-http-and-https-protocol#comments</comments>
		<pubDate>Wed, 10 Mar 2010 05:49:25 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[WebDev]]></category>
		<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[memo]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=2269</guid>
		<description><![CDATA[					
					普段Google Analyticsを利用するとき、デフォルトでga.jsで利用するようになっていますし、基本的にurchin.js（古いやつ）はUrchinと併用するときくらいしか使わないと思いま [...]]]></description>
			<content:encoded><![CDATA[					<p><img src="http://5509.me/wp-content/uploads/2010/03/ga11.png" alt="ga1" title="ga1" width="313" height="50" class="alignnone size-full wp-image-2274" /></p>
					<p>普段Google Analyticsを利用するとき、デフォルトでga.jsで利用するようになっていますし、基本的にurchin.js（古いやつ）は<a href="http://www.runexy.co.jp/enterprise/urchin/outline/">Urchin</a>と併用するときくらいしか使わないと思いますが、、</p>
					<p>gaはデフォルトでhttp・httpsに対応したコードを生成するので問題ないですが、上記のリンクから古いコードを選ぶと、最初に指定したドメインに対してしかコードを生成しません。</p>
					<p>たとえば http://5509.me に対してurchin.jsのコードを生成すると以下のようになります。</p>
					<p><img src="http://5509.me/wp-content/uploads/2010/03/ga21.png" alt="ga2" title="ga2" width="450" class="alignnone size-full wp-image-2288" /></p>
					<p>これをhttp・httpsが混在するCMSなどで利用すると、IEではhttpsのページで以下のようなセキュリティ警告が表示されます。</p>
					<p><img src="http://5509.me/wp-content/uploads/2010/03/ga3.gif" alt="ga3" title="ga3" width="431" height="125" class="alignnone size-full wp-image-2276" /></p>
					<p>解決するには、ga.jsの生成コードのようにURLのprotocolによって読み込み先を変える必要があります。</p>
					<p>この部分を･･･</p>
					<pre>&#60;&#115;&#99;&#114;&#105;&#112;&#116;&#32;&#115;&#114;&#99;&#61;&#34;&#104;&#116;&#116;&#112;&#115;&#58;&#47;&#47;&#115;&#115;&#108;&#46;&#103;&#111;&#111;&#103;&#108;&#101;&#45;&#97;&#110;&#97;&#108;&#121;&#116;&#105;&#99;&#115;&#46;&#99;&#111;&#109;&#47;&#117;&#114;&#99;&#104;&#105;&#110;&#46;&#106;&#115;&#34;&#32;&#116;&#121;&#112;&#101;&#61;&#34;&#116;&#101;&#120;&#116;&#47;&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#34;&#62;&#60;&#47;&#115;&#99;&#114;&#105;&#112;&#116;&#62;</pre>
<p>以下のコードに修正する</p>
<pre>&#60;&#115;&#99;&#114;&#105;&#112;&#116;&#32;&#116;&#121;&#112;&#101;&#61;&#34;&#116;&#101;&#120;&#116;&#47;&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#34;&#62;&#10;&#118;&#97;&#114;&#32;&#103;&#97;&#74;&#115;&#72;&#111;&#115;&#116;&#32;&#61;&#32;&#40;&#40;&#34;&#104;&#116;&#116;&#112;&#115;&#58;&#34;&#32;&#61;&#61;&#32;&#100;&#111;&#99;&#117;&#109;&#101;&#110;&#116;&#46;&#108;&#111;&#99;&#97;&#116;&#105;&#111;&#110;&#46;&#112;&#114;&#111;&#116;&#111;&#99;&#111;&#108;&#41;&#32;&#63;&#32;&#34;&#104;&#116;&#116;&#112;&#115;&#58;&#47;&#47;&#115;&#115;&#108;&#46;&#34;&#32;&#58;&#32;&#34;&#104;&#116;&#116;&#112;&#58;&#47;&#47;&#119;&#119;&#119;&#46;&#34;&#41;&#59;&#10;&#100;&#111;&#99;&#117;&#109;&#101;&#110;&#116;&#46;&#119;&#114;&#105;&#116;&#101;&#40;&#117;&#110;&#101;&#115;&#99;&#97;&#112;&#101;&#40;&#34;&#37;&#51;&#67;&#115;&#99;&#114;&#105;&#112;&#116;&#32;&#115;&#114;&#99;&#61;&#39;&#34;&#32;&#43;&#32;&#103;&#97;&#74;&#115;&#72;&#111;&#115;&#116;&#32;&#43;&#32;&#34;&#103;&#111;&#111;&#103;&#108;&#101;&#45;&#97;&#110;&#97;&#108;&#121;&#116;&#105;&#99;&#115;&#46;&#99;&#111;&#109;&#47;&#117;&#114;&#99;&#104;&#105;&#110;&#46;&#106;&#115;&#39;&#32;&#116;&#121;&#112;&#101;&#61;&#39;&#116;&#101;&#120;&#116;&#47;&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#39;&#37;&#51;&#69;&#37;&#51;&#67;&#47;&#115;&#99;&#114;&#105;&#112;&#116;&#37;&#51;&#69;&#34;&#41;&#41;&#59;&#10;&#60;&#47;&#115;&#99;&#114;&#105;&#112;&#116;&#62;</pre>
					<p>これでセキュリティ警告が出ることもなくなります。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/using-urchin-js-with-both-http-and-https-protocol/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>じわじわ便利なjQuery1.4で追加された機能いろいろ+α</title>
		<link>http://5509.me/log/jquery1-4-plus-alpha</link>
		<comments>http://5509.me/log/jquery1-4-plus-alpha#comments</comments>
		<pubDate>Tue, 09 Mar 2010 01:22:44 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[memo]]></category>
		<category><![CDATA[まとめ]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=2222</guid>
		<description><![CDATA[					1月14日にjQuery1.4がリリースされましたが、なかなか手をつけられずにいること早2ヶ月･･･。ようやくちゃんと使ってみようということで色々見てると、それにしても痒いところに手が届くというかなんというか、 [...]]]></description>
			<content:encoded><![CDATA[					<p>1月14日にjQuery1.4がリリースされましたが、なかなか手をつけられずにいること早2ヶ月･･･。ようやくちゃんと使ってみようということで色々見てると、それにしても痒いところに手が届くというかなんというか、すばらしいですね。</p>
					<p>いまさら感満載なので、みなさん既に知ってると思いますがいくつかメモしておくのと、もしかしたらあんまり知られてないかも知れないjQueryの機能も少し紹介しておきます。<br />
					<span id="more-2222"></span></p>
					<h2>トピックス</h2>
					<ul>
					<li><a href="#point1">属性などをまとめて指定+ついでにイベントなどもまとめて指定</a></li>
					<li><a href="#point2">複数イベントをまとめてbind</a></li>
					<li><a href="#point3">個別にeasing指定</a></li>
					<li><a href="#point4">アニメーションを指定時間待機させる.delay()</a></li>
					<li><a href="#point5">DOMオブジェクトを丸ごと配列に入れる.toArray()</a></li>
					<li><a href="#point6">.offset()で値を書き込めるようになった</a></li>
					<li><a href="#point7">1.4じゃないけど、もしかしたらあんまり知られていない機能</a>
					<ul>
					<li><a href="#point7-1">.append()メソッドで複数個のオブジェクトをappendする</a></li>
					</li>
					<li><a href="#point7-2">jQueryのメソッドのアクセス方法</a></li>
					</li>
					<li><a href="#point7-3">.hover()の真相</a></li>
					</li>
					</ul>
					</li>
					</ul>
					<h2 id="point1">属性などをまとめて指定+ついでにイベントなどもまとめて指定</h2>
					<p>これかなり便利というか、すっきり書けます。</p>
					<p>今までも属性はまとめて指定できたのですが、テキストとかイベントとかCSSとかはチェーンで繋いで書いてましたよね。こんな感じに。分かりやすいと言えば分かりやすいけど、やっぱりどうしても読みにくいですね。</p>
					<pre>$('&lt;a/&gt;')
&nbsp;&nbsp;.attr({
&nbsp;&nbsp;&nbsp;&nbsp;id: 'sample',
&nbsp;&nbsp;&nbsp;&nbsp;name: 'sample',
&nbsp;&nbsp;&nbsp;&nbsp;href: 'http://5509.me'
&nbsp;&nbsp;})
&nbsp;&nbsp;.click(function() {
&nbsp;&nbsp;&nbsp;&nbsp;alert('clicked');
&nbsp;&nbsp;})
&nbsp;&nbsp;.css({
&nbsp;&nbsp;&nbsp;&nbsp;paddingBottom: '2.5em',
&nbsp;&nbsp;&nbsp;&nbsp;fontSize: '14px'
&nbsp;&nbsp;})
&nbsp;&nbsp;.text('click me!');</pre>
					<p>1.4ではこう書けます。。</p>
					<pre>$('&lt;a/&gt;', {
&nbsp;&nbsp;id: 'sample',
&nbsp;&nbsp;name: 'sample',
&nbsp;&nbsp;href: 'http://5509.me',
&nbsp;&nbsp;click: function() {
&nbsp;&nbsp;&nbsp;&nbsp;alert('clicked');
&nbsp;&nbsp;},
&nbsp;&nbsp;css: {
&nbsp;&nbsp;&nbsp;&nbsp;paddingBottom: '2.5em',
&nbsp;&nbsp;&nbsp;&nbsp;fontSize: '14px'
&nbsp;&nbsp;},
&nbsp;&nbsp;text: 'click me!'
});</pre>
					<p>すっきり！みやすくなりました。</p>
					<h2 id="point2">複数イベントをまとめてbind</h2>
					<p>そうそう、イベントも何回もチェーンで繋ぐと見にくくなって仕方なかったんですよね。下記のようにチェーンを使わずまとめて指定できます。</p>
					<pre>$('#box').bind({
&nbsp;&nbsp;click: function() {
&nbsp;&nbsp;&nbsp;&nbsp;alert('clicked!!');
&nbsp;&nbsp;},
&nbsp;&nbsp;mouseover: function() {
&nbsp;&nbsp;&nbsp;&nbsp;alert('over!!');
&nbsp;&nbsp;},
&nbsp;&nbsp;mousemove: function() {
&nbsp;&nbsp;&nbsp;&nbsp;alert('move!!');
&nbsp;&nbsp;}
});</pre>
					<p>ちなみに1.4ではないですけれど、イベントのhandlerが同じならまとめて指定できますね。</p>
					<pre>$('#box').bind('click focus blur', function(){
&nbsp;&nbsp;alert('matometa!');
});</pre>
					<h2 id="point3">個別にeasing指定</h2>
					<p>え･･･？縦横バラバラにeasing指定できるんですか･･･</p>
					<pre>$('#box').animate({
&nbsp;&nbsp;top: 300,
&nbsp;&nbsp;left: 300
},{
&nbsp;&nbsp;duration: 1000,
&nbsp;&nbsp;specialEasing: {
&nbsp;&nbsp;&nbsp;&nbsp;top: 'easeInOutCirc',
&nbsp;&nbsp;&nbsp;&nbsp;left: 'easeOutBounce'
&nbsp;&nbsp;}
});</pre>
					<p>ただし、scrollTopとscrollLeftには使えないようです。それはそうか。</p>
					<h2 id="point4">アニメーションを指定時間待機させる.delay()</h2>
					<p>setTimeout()とか使わなくていいんですよ。これまたすっきり書けます。<br />
					たとえば、fadeOut()後500ミリセカンド待ってからもう一度fadeIn()させたいときはこんな感じに書けます。</p>
					<pre>$('#box')
&nbsp;&nbsp;.fadeOut(400)
&nbsp;&nbsp;.delay(500)
&nbsp;&nbsp;.fadeIn(400);</pre>
					<h2 id="point5">DOMオブジェクトを丸ごと配列に入れる.toArray()</h2>
					<p>いちいちpushとかする必要ないんです。.toArray()するだけです。</p>
					<pre>&lt;ul&gt;
&lt;li&gt;1&lt;/li&gt;
&lt;li&gt;2&lt;/li&gt;
&lt;li&gt;3&lt;/li&gt;
&lt;li&gt;4&lt;/li&gt;
&lt;/ul&gt;</pre>
					<pre>$('ul>li').toArray();</pre>
<p>↓このように配列になります。</p>
<pre>['&lt;li&gt;1&lt;/li&gt;','&lt;li&gt;2&lt;/li&gt;','&lt;li&gt;3&lt;/li&gt;','&lt;li&gt;4&lt;/li&gt;']</pre>
					<h2 id="point6">.offset()で値を書き込めるようになった</h2>
					<p>うん、これはそうでもないか･･･</p>
					<pre>$('#box').offset({
&nbsp;&nbsp;top: '10px',
&nbsp;&nbsp;left: '25px'
});</pre>
					<h2 id="point7">1.4じゃないけど、もしかしたらあんまり知られていない機能</h2>
					<h3 id="point7-1">.append()メソッドで複数個のオブジェクトをappendする</h3>
					<p>.append()はDOMでもjQueryオブジェクトでも何でもつっこめて便利なのですが、これカンマで区切ると複数個入れることができます。</p>
					<pre>$('#box').append(
&nbsp;&nbsp;'&lt;a href=&quot;#&quot;&gt;1&lt;/a&gt;',
&nbsp;&nbsp;'&lt;a href=&quot;#&quot;&gt;2&lt;/a&gt;',
&nbsp;&nbsp;'&lt;a href=&quot;#&quot;&gt;3&lt;/a&gt;'
);</pre>
					<p>ちなみに、.after()と.before()でも同じようにカンマ区切りで複数の要素を追加できます。</p>
					<pre>$('#box').after( // .before
&nbsp;&nbsp;'&lt;a href=&quot;#&quot;&gt;1&lt;/a&gt;',
&nbsp;&nbsp;'&lt;a href=&quot;#&quot;&gt;2&lt;/a&gt;',
&nbsp;&nbsp;'&lt;a href=&quot;#&quot;&gt;3&lt;/a&gt;'
);</pre>
					<h3 id="point7-2">jQueryのメソッドのアクセス方法</h3>
					<p>一般的に.(ドット)で繋いでいきますが、プロパティと同じなので当然、[methodName]でも呼び出せます。</p>
					<pre>$('#box').click(function() {
&nbsp;&nbsp;alert('clicked');
});</pre>
					<pre>$('#box')['click'](function() {
&nbsp;&nbsp;alert('clicked');
});</pre>
					<h3 id="point7-3">追記： .hover()の真相</h3>
					<p>なにかありそうなタイトルにしましたが･･･<br />
					.hover()メソッドでは下記のように、マウスオーバーとマウスアウト時のイベントをまとめて指定できて便利ですよね。</p>
					<pre>$('div').hover(
&nbsp;&nbsp;function() {
&nbsp;&nbsp;&nbsp;&nbsp;alert('on');
&nbsp;&nbsp;},
&nbsp;&nbsp;function() {
&nbsp;&nbsp;&nbsp;&nbsp;alert('off');
&nbsp;&nbsp;}
);</pre>
					<p>マウスオーバーとマウスアウトと書きましたが、実は.hover()は<strong>.mouseover() / .mouseout() のショートカットではなく、.mouseenter() / .mouseleave() のショートカットです</strong>。これらの違いについてはjQuery APIのサンプルを見てもらうのが一番早いと思います。</p>
					<p><a href="http://api.jquery.com/mouseover/">http://api.jquery.com/mouseover/</a> &#8211; ページ真ん中らへんにDemoがあります。</p>
					<p>一度領域に入ってしまえば、enterで、領域から出ない限りleaveにはなりません。何気なく使っていても、特に問題はないところですが、挙動がおかしいと思ったときなどに知っていれば、対処方に辿り着きやすいかもしれません。</p>
					<h2>まとめ</h2>
					<p>jQueryを使えば、クロスブラウザも（ある程度は）簡単に対応できるし、やりたいこともたった数行で実現できてしまうので、速度の面とかはとりあえず置いておいて、どんどん色んなことをやってみればいいんだと思います。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/jquery1-4-plus-alpha/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>コーダー向け勉強会「.coder」の開催が決定しました</title>
		<link>http://5509.me/log/dotcoder_session1</link>
		<comments>http://5509.me/log/dotcoder_session1#comments</comments>
		<pubDate>Mon, 22 Feb 2010 10:24:34 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[WebDev]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=2205</guid>
		<description><![CDATA[					.coderから丸々転載します。
					&#8212;&#8212;&#8212;ここから&#8212;&#8212;&#8212;
					コーダー・Webデザイナー向けの勉強会「.coder（どっとこ [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://dotcoder.net">.coder</a>から丸々転載します。<br />
					&#8212;&#8212;&#8212;ここから&#8212;&#8212;&#8212;</p>
					<p>コーダー・Webデザイナー向けの勉強会「<strong>.coder（どっとこーだー）</strong>」 を大阪で行います。</p>
					<p>とりあえず決まっていることを以下にまとめておきます。調整中項目などは決まれば随時追加していきます。参加表明は<a href="http://atnd.org/events/3315">ATND</a>から行ってください。</p>
					<p>何か話したい！とかあればATNDかこちらのコメントにお願いします。</p>
					<h2>お知らせとか</h2>
					<p>このブログでも行いますが、連絡用Twitterアカウントを用意したので、こっちもフォローしてください。</p>
					<p><a href="http://twitter.com/dotcoder">http://twitter.com/dotcoder</a></p>
					<h2>第1回の概要</h2>
					<dl>
					<dt>テーマ</dt>
					<dd>JavaScript。主にjQuery関連が多いと思います。</dd>
					<dt>対象</dt>
					<dd><strong>JSを少しでも触ったことのある</strong>コーダー・Webデザイナー。（またはJSに興味があり、これから使っていきたいと思っている人。）</dd>
					<dt>形式</dt>
					<dd>一人3分〜10分程度の持ち時間でJS関連の話題で話すライトニングトーク形式。参加者全員が話すの必須じゃないですが、出来れば何かしら話してもらいたいです。今のところ5人くらい話す人が決まってます。</dd>
					<dt>スタンス</dt>
					<dd>ゆるく、楽しく。</dd>
					<dt>募集人数</dt>
					<dd>18人</dd>
					<dt>場所</dt>
					<dd>エル・おおさか（大阪府立労働センター） （大阪市中央区北浜東3-14）</dd>
					<dt>日時</dt>
					<dd>3月20日 18時～21時</dd>
					<dt>会費</dt>
					<dd>たぶん500円くらい</dd>
					</dl>
					<h2>参加表明</h2>
					<p><a href="http://atnd.org/events/3315">ATND</a>のページから行ってください</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/dotcoder_session1/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress等の投稿もZen-Codingで楽々編集できるJSライブラリ Zen Coding for &lt;textarea&gt;</title>
		<link>http://5509.me/log/zen-coding-for-textarea</link>
		<comments>http://5509.me/log/zen-coding-for-textarea#comments</comments>
		<pubDate>Tue, 16 Feb 2010 01:15:15 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[memo]]></category>
		<category><![CDATA[Zen-Coding]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=2145</guid>
		<description><![CDATA[					15日のvol.01 ノンプログラマのためのPHP入門はPHPを始めようとしている僕にはとても有意義なものだったのですが、さらに衝撃だったのは、Zen-Codingでした。
					
					前々から存在は [...]]]></description>
			<content:encoded><![CDATA[					<p>15日の<a href="http://www.ustream.tv/recorded/4721906">vol.01 ノンプログラマのためのPHP入門</a>はPHPを始めようとしている僕にはとても有意義なものだったのですが、さらに衝撃だったのは、<a href="http://code.google.com/p/zen-coding/">Zen-Coding</a>でした。</p>
					<p><a href="http://code.google.com/p/zen-coding/"><img src="http://5509.me/wp-content/uploads/2010/02/zen-wordpress0.png" alt="zen-wordpress0" title="zen-wordpress0" width="365" height="64" class="alignnone size-full wp-image-2175" /></a></p>
					<p>前々から存在は知ってましたが、使ったことはありませんでした。使ってみたところこれが超快適･･･！確かにコーディングが3倍速くなるかも知れない。これを知らなかったなんて僕のコーディング人生は何だったんでしょうか。</p>
					<p>で、わざわざZen-Codingのよさについて書いたところで意味がないので、Zen-Codingについては以下のエントリ等が参考になると思います。</p>
					<ul>
					<li><a href="http://blog.gaspanik.com/coding-with-textmate-and-zencoding">TextMate+Zen-Codingで超速コーディング？</a></li>
					<li><a href="http://h2o-space.com/blog/1929">HTMLコーディングが3倍速くなる？「Zen-Coding」</a></li>
					<li><a href="http://p15.jp/2009/07/19/145308">Coda で Zen-Coding を使う</a></li>
					</ul>
					<h2>ブログ記事をHTMLで書いている人に<del datetime="2010-02-15T18:56:31+00:00">超</del>きっとおすすめ</h2>
					<p>WordPressの記事をZen-Codingで編集したいなとか話してたんですが、どうやらtextareaでZen-Codingを可能にするライブラリが公式であるんですね･･･そしてこれが素晴らしい出来でブログ記事を書く速さも<del datetime="2010-02-15T18:58:57+00:00">3倍</del>1.5倍くらいになりそうです。特に技術系のブログを書いてる人には手放せないツールになるんじゃないでしょうか。</p>
					<p>以下WordPressに適用して編集した際のキャプチャです。<a href="http://zen-coding.ru/textarea/">公式サンプル</a>そのまんまで申し訳ないですがそういうことです。</p>
					<p><img src="http://5509.me/wp-content/uploads/2010/02/zen-wordpress1.png" alt="zen-wordpress1" title="zen-wordpress1" width="322" height="97" class="alignnone size-full wp-image-2156" /></p>
					<p>この状態でCmd+E(Ctrl+E)で･･･</p>
					<p><img src="http://5509.me/wp-content/uploads/2010/02/zen-wordpress2.png" alt="zen-wordpress2" title="zen-wordpress2" width="284" height="448" class="alignnone size-full wp-image-2157" /></p>
					<p>このように展開できます。</p>
					<h2>WordPressに導入する方法</h2>
					<p>僕はWPユーザーなので、WordPressに導入する方法を書いておきます。ちなみに、ビジュアルエディタは邪魔なのでオフにしておきます。（どちらでもいいですが）</p>
					<h3>プラグインを使って導入する</h3>
					<p>【追記】<a href="http://rewish.org">rewさん</a>がプラグイン化してくれました。なかなか登録が完了しないようです･･･</p>
					<ul>
					<li><a href="http://rewish.org/wp/zen_coding">WordPressにZen Codingを導入するプラグイン「WP Zen-Coding」</a></li>
					</ul>
					<p>以下は古い内容です。WordPressのバージョンアップに伴って消えるのでプラグインを使ったほうがいいですね。</p>
					<h3>Zen Coding for &lt;textarea&gt;のダウンロード</h3>
					<p>まずはソースコードをダウンロードします。</p>
					<dl>
					<dt>ダウンロード</dt>
					<dd><a href="http://code.google.com/p/zen-coding/downloads/detail?name=Zen.Coding-textarea.v0.5.zip">Download: Zen Coding for &lt;textarea&gt;</a></dd>
					<dt>公式サンプル</dt>
					<dd><a href="http://zen-coding.ru/textarea/">Zen Coding for &lt;textarea&gt; Sample</a></dd>
					</dl>
					<h3>WordPressの管理画面で読み込む</h3>
					<p>ダウンロードしたら解凍して出てくる「zen_textarea.js」か「zen_textarea.min.js」を適当なフォルダにコピーして</p>
					<ul>
					<li>/wp-admin/admin-header.php</li>
					</ul>
					<p>を開いてたぶん69行目辺りが&lt;/head&gt;のすぐ上なので、そこで読み込ませます。</p>
					<p><img src="http://5509.me/wp-content/uploads/2010/02/zen-wordpress3.png" alt="zen-wordpress3" title="zen-wordpress3" width="450"  class="alignnone size-full wp-image-2169" /></p>
					<p>わずか2ステップで実装できてしまいました。ただこの方法だと記事編集画面以外のテキストエリアにも適用されてしまうので、それが嫌な人は&lt;?php if(){} ?&gt;か何かで編集画面でのみ適用するようにするといいでしょう。</p>
					<h2>タグをあまり使わないWordPressユーザーにははてな記法プラグイン</h2>
					<p>そんなにタグばっかり使わない人には<a href="http://rewish.org">rewish</a>さん作の<a href="http://rewish.org/wp/hatena_notation_plugin">はてな記法プラグイン</a>がちょうどいいと思います。テーブルなどもどんどん使えますし、こちらもかなり便利です。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/zen-coding-for-textarea/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>今さら聞けないjQuery実行パターンまとめ</title>
		<link>http://5509.me/log/jquery-execution-pattern</link>
		<comments>http://5509.me/log/jquery-execution-pattern#comments</comments>
		<pubDate>Mon, 15 Feb 2010 01:30:54 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[memo]]></category>
		<category><![CDATA[まとめ]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=2079</guid>
		<description><![CDATA[					なんとなく使っているだろう.ready()メソッドについて詳細に見てみましょう。
					.ready()メソッド
					.ready()メソッドという呼び方がパッとしない人もいると思います。こういうので [...]]]></description>
			<content:encoded><![CDATA[					<p>なんとなく使っているだろう.ready()メソッドについて詳細に見てみましょう。</p>
					<h2>.ready()メソッド</h2>
					<p>.ready()メソッドという呼び方がパッとしない人もいると思います。こういうのです↓</p>
					<pre>$(function(){
&nbsp;&nbsp;// .ready()が呼び出されたときに実行されるハンドラ
});</pre>
					<p>jQueryを実行する際のおまじないみたいなものですね。これの中にjQueryコードを書いていくとページロード時（Documentの読み込みが完了時）に実行してくれます。</p>
					<p>何気なく使ってる人も多いと思いますが、実際のところこれは何？ということで、少し掘り下げてみましょう。<br />
					<span id="more-2079"></span></p>
					<h3>.ready()を使う際の形式</h3>
					<p><a href="http://api.jquery.com/ready/">jQuery API</a>によれば、以下の3つが.ready()として同じように使えるようです。</p>
					<ol>
					<li>$(document).ready(handler)</li>
					<li>$().ready(handler) <strong>(推奨されていない使い方)</strong></li>
					<li>$(handler)</li>
					</ol>
					<dl>
					<dt><strong>handler</strong></dt>
					<dd>DOM Readyの時点で実行されるfunction<br />
					無名関数function(){}がこれに当たります</dd>
					</dl>
					<p>つまり、それぞれを実際に使う場合は</p>
					<h4>1. の場合</h4>
					<pre>$(document).ready(function(){
&nbsp;&nbsp;// 実行する命令
});</pre>
					<p>見て分かる通り、Documentがreadyになったら、つまりDocumentの読み込みが完了したら実行します。</p>
					<h4>2. の場合（使えるが推奨はされていない）</h4>
					<pre>$().ready(function(){
&nbsp;&nbsp;// 実行する命令
});</pre>
					<p>1.のdocumentを省略した状態。ただし公式ドキュメントでも注意書きがある通り、この形式では使わないほうがよさそうです。</p>
					<h4>3. の場合</h4>
					<pre>$(function(){
&nbsp;&nbsp;// 実行する命令
});</pre>
					<p>こちらは、一番よく見る例のアレですね。$(document).readyを$と省略した形です。一番文字数が少なくて済むのでよく使われています。</p>
					<h3>$ = jQuery</h3>
					<p>jQueryを使っていると<strong>$</strong>という文字をたくさん使いますが、これは<strong>jQueryのエイリアス</strong>になっています。つまり以下のコードは同じことを意味します。</p>
					<pre>$('a').click(function(){});
jQuery('a').click(function(){});
</pre>
					<p>よく知られているところでは、Prototype.jsも同じように$を使っていて、jQueryと同時に使うと$の衝突が起こります。この場合、$.noConflict()を使って</p>
					<pre>var $j = jQuery.noConflict();</pre>
<p>のようにして、$の代わりに$jをjQueryとして使うことで回避したりします。</p>
<h3>強制的に$をjQueryとして使う場合</h3>
<p>より安全に、.ready()の中だけは$をjQueryのエイリアスとして使う場合、次のように実行します。</p>
<pre>jQuery(document).ready(function($){
&nbsp;&nbsp;// この中では$はjQueryとして扱われる
});</pre>
					<p>コメントに書いたように、この書き方だと、Prototypeなどの$を使っているライブラリを同時にロードしていても、.ready()の中だけは$をjQueryとして扱うことができます。ただし、Prototypeの$は当然使うことは出来ないです。</p>
					<p>さらに省略形と合わせることもできます。このほうが使いやすいでしょう。</p>
					<pre>jQuery(function($){
&nbsp;&nbsp;// この中では$はjQueryとして扱われる
});</pre>
					<h2>実行パターンまとめ</h2>
					<p>というわけで推奨されていない物以外をまとめると以下の4つになります。どれを使っても実行結果は同じなので、好みになると思いますがおすすめはトラブルが少なそうな4.ですね。</p>
					<h3>1. 基本のパターン</h3>
					<pre>$(document).ready(function(){
&nbsp;&nbsp;// 実行する命令
});</pre>
					<h3>2. よく使われているパターン</h3>
					<pre>$(function(){
&nbsp;&nbsp;// 実行する命令
});</pre>
					<h3>3. 他のライブラリも使うことを考慮した場合のパターン</h3>
					<pre>jQuery(document).ready(function($){
&nbsp;&nbsp;// 実行する命令
});</pre>
					<h3>4. 2と3を組み合わせたパターン</h3>
					<pre>jQuery(function($){
&nbsp;&nbsp;// 実行する命令
});</pre>
					<h2>ちょっと補足</h2>
					<p><a href="http://h2ham.seesaa.net/">THE HAM MEDIA</a>の<a href="http://twitter.com/h2ham">ハムさん</a>が補足を書いてくれましたので、こちらもあわせて読むとさらに理解が深まると思います。</p>
					<ul>
					<li><a href="http://h2ham.seesaa.net/article/141226477.html">Re: 今さら聞けないjQuery実行パターンまとめ【実行のタイミングって？ちょっとした補足】</a></li>
					</ul>
					<h2>参考</h2>
					<dl>
					<dt>.ready() &#8211; jQuery API</dt>
					<dd><a href="http://api.jquery.com/ready/">http://api.jquery.com/ready/</a></dd>
					</dl>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/jquery-execution-pattern/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Goolge BuzzのBuzz Itボタンをブログに実装する</title>
		<link>http://5509.me/log/add-google-buzz-button</link>
		<comments>http://5509.me/log/add-google-buzz-button#comments</comments>
		<pubDate>Fri, 12 Feb 2010 01:15:47 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[WebDev]]></category>
		<category><![CDATA[Google Buzz]]></category>
		<category><![CDATA[memo]]></category>
		<category><![CDATA[ブログ]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=2047</guid>
		<description><![CDATA[					
					先日公開されたGoogle Buzzですが、流行るとか流行らないは別としてとりあえずサイトにBuzzを投稿するためのボタンを実装してみましょう。と思ってAPIを見てたんですが、まだその辺については公 [...]]]></description>
			<content:encoded><![CDATA[					<p><img class="alignnone size-full wp-image-2059" title="buzz1" src="http://5509.me/wp-content/uploads/2010/02/buzz1.png" alt="buzz1" width="178" height="67" /></p>
					<p>先日公開されたGoogle Buzzですが、流行るとか流行らないは別としてとりあえずサイトにBuzzを投稿するためのボタンを実装してみましょう。と思って<a href="http://code.google.com/intl/ja/apis/buzz/">API</a>を見てたんですが、まだその辺については公開されてないのか見あたりませんでした。そもそもBuzzするって何て言うんですかね。Buzzる？なんか変。。</p>
					<p>今のところ便利そうなのは以下の、Google Readerのブックマークレットを使う方法でしょうか。</p>
					<ul>
					<li><span><a title="Reload this Page" href="http://buzzusers.com/showthread.php?33-Add-a-Buzz-It-button-to-your-Website-Blog-or-Forum">Add a &#8220;Buzz It&#8221; button to your Website, Blog  or Forum</a></span></li>
					</ul>
					<p>超簡単に実装できます。<br />
					<span id="more-2047"></span></p>
					<h2>実装方法</h2>
					<p>アイコンを<a href="http://buzzusers.com/images/buzzicon.png">http://buzzusers.com/images/buzzicon.png</a>か<a href="http://buzzusers.com/images/gbuzz.png">http://buzzusers.com/images/gbuzz.png</a>から保存して、ボタンを追加したい位置に下記のコードを貼るだけです。（アイコンのsrcは変えてください）Google ReaderがURLとタイトルを取得するのでどのページにも下記のコードで実装できますが、この方法では一覧ページには実装できません。一覧ページにも実装したい場合は、<a href="http://techcrunch.com/2010/02/10/google-buzz-button/">Tech Crunchのように</a>個別にURLからタイトルやURLを渡す必要があります。</p>
					<pre>&lt;a href="javascript:var%20b=document.body;var%20GR________bookmarklet_domain=&amp;quot;http://www.google.com&amp;quot;;if(b&amp;amp;&amp;amp;!document.xmlVersion){void(z=document.createElement(&amp;quot;script&amp;quot;));void(z.src=&amp;quot;http://www.google.com/reader/ui/link-bookmarklet.js&amp;quot;);void(b.appendChild(z));}else{}"&gt;&lt;img src="ここはアイコンのURL" alt="Buzz It"/&gt; Buzz It&lt;/a&gt;</pre>
<h3><strong>サンプルということで、このブログにも実装してみました</strong></h3>
<p><strong><strong>…使わないでしょうけど。</strong></strong></p>
<p><img class="alignnone size-full wp-image-2059" title="buzz1" src="http://5509.me/wp-content/uploads/2010/02/buzz1.png" alt="buzz1" width="178" height="67" /></p>
<p>クリックするとGoogle Readerのブックマークレットが画面右上に表示されるのでそこからBuzzへ投稿できます。画面の遷移がないので投稿しやすいです。</p>
<p><a href="http://5509.me/wp-content/uploads/2010/02/buzz21.png"><img class="alignnone size-medium wp-image-2068" title="buzz2" src="http://5509.me/wp-content/uploads/2010/02/buzz21-300x214.png" alt="buzz2" width="300" height="214" /></a></p>
<p>この方法で実装するところの問題といえば、<strong>Google ReaderのブックマークレットがページのタイトルとURLを取ってくるため、一覧ページには使えない</strong>ところでしょうか。</p>
<h2>おまけ</h2>
<p>一覧ページにも実装する場合は以下のリンクで実装できます。[URL][タイトル][サマリー]のところに対応する値を渡してください。</p>
<pre>&lt;a href="http://www.google.com/reader/link?url=[URL]&amp;title=[タイトル]&amp;snippet=[サマリー]"&gt;Buzz It&lt;/a&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/add-google-buzz-button/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQueryのアニメーション関連いろいろまとめ</title>
		<link>http://5509.me/log/jquery-with-animation</link>
		<comments>http://5509.me/log/jquery-with-animation#comments</comments>
		<pubDate>Tue, 09 Feb 2010 01:15:20 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[まとめ]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=2006</guid>
		<description><![CDATA[					
					jQueryを使えば単体でもフェードやスライドなどのアニメーションを誰でも簡単に使えますが、animateメソッドを使うとより便利に凝ったアニメーションを実行することができます。animateメソッ [...]]]></description>
			<content:encoded><![CDATA[					<p><img class="alignnone size-full wp-image-2032" title="jQueryのアニメーション関連いろいろまとめ" src="http://5509.me/wp-content/uploads/2010/02/jquery_anim.png" alt="jQueryのアニメーション関連いろいろまとめ" width="296" height="218" /></p>
					<p><a href="http://jquery.com/">jQuery</a>を使えば単体でもフェードやスライドなどのアニメーションを誰でも簡単に使えますが、animateメソッドを使うとより便利に凝ったアニメーションを実行することができます。animateメソッドを使って何かを作るときに役立ちそうなチュートリアルと、すぐ使いたい人向けのプラグインを集めました。</p>
					<p><span id="more-2006"></span></p>
					<ul>
					<li><a href="#tips">TIPS/チュートリアル</a></li>
					<li><a href="#plugin">プラグイン/animateメソッドの拡張など</a></li>
					<li><a href="#plugin2">プラグイン/単体で使えるものなど</a></li>
					<li><a href="#plugin3">プラグイン/スクロール系</a></li>
					</ul>
					<h2 id="tips">TIPS/チュートリアル</h2>
					<h3><strong>animate(params, options)</strong></h3>
					<p><a href="http://semooh.jp/jquery/api/effects/animate/params,+options/">http://semooh.jp/jquery/api/effects/animate/params,+options/</a><br />
					まずはjQuery animateの基本を押さえましょう。</p>
					<h3><strong>Using jQuery Stop<br />
					</strong></h3>
					<p><a href="http://css-tricks.com/examples/jQueryStop/">http://css-tricks.com/examples/jQueryStop/</a><br />
					アニメーションのキューをコントロールする。これを押さえれば結構なんでもできますたぶん。hoverで色々したい場合などは<strong>stop(true,true)</strong>が 便利です。</p>
					<h3><strong>Start/Stop Slider</strong></h3>
					<p><a href="http://css-tricks.com/startstop-slider/">http://css-tricks.com/startstop-slider/</a><br />
					もうひとつCSS-Tricksから、スライダーの作り方。</p>
					<h3><strong>Sliding Boxes and Captions with jQuery</strong></h3>
					<p><a href="http://buildinternet.com/2009/03/sliding-boxes-and-captions-with-jquery/">http://buildinternet.com/2009/03/sliding-boxes-and-captions-with-jquery/</a><br />
					マウスオーバーでキャプションがスライドしてくる。</p>
					<h3><strong>Create  a Thumbnail with Fading Caption Using jQuery</strong></h3>
					<p><a href="http://www.queness.com/post/844/create-a-thumbnail-with-fading-caption-using-jquery">http://www.queness.com/post/844/create-a-thumbnail-with-fading-caption-using-jquery</a><br />
					キャプションを前面に表示するんですけど、サムネイルのアニメーションとの組み合わせがきれい。</p>
					<h3><strong>Create a jQuery Popup Bubble</strong></h3>
					<p><a href="http://www.dvq.co.nz/web-design/create-a-jquery-popup-bubble-effect/">http://www.dvq.co.nz/web-design/create-a-jquery-popup-bubble-effect/</a><br />
					ツールチップも表示方法を変えるだけでかわいくなりますね。実装も簡単です。</p>
					<h3><strong>Animate validation feedback using jQuery</strong></h3>
					<p><a href="http://www.jankoatwarpspeed.com/post/2009/09/16/Animate-validation-feedback-using-jQuery.aspx">http://www.jankoatwarpspeed.com/post/2009/09/16/Animate-validation-feedback-using-jQuery.aspx</a><br />
					フォームの未入力必須項目を揺らす。↓で紹介しているプラグインと組み合わせると点滅などできますね。</p>
					<h2 id="plugin">プラグイン/animateメソッドの拡張など</h2>
					<h3><strong>GX<br />
					</strong></h3>
					<p><a href="http://gx.riccardodegni.net/">http://gx.riccardodegni.net/</a><br />
					アニメーションに特化した拡張プラグイン。色を変えたり、キューを利用したシームレスなアニメーションなどを行えます。</p>
					<h3><strong>COLOR ANIMATIONS</strong></h3>
					<p><a href="http://plugins.jquery.com/project/color">http://plugins.jquery.com/project/color<br />
					</a>こちらはjQuery作者のJohn Resig氏がつくったカラーアニメーションプラグイン。</p>
					<h3><strong>Background-Position Animations<br />
					</strong></h3>
					<p><a href="http://plugins.jquery.com/project/backgroundPosition-Effect">http://plugins.jquery.com/project/backgroundPosition-Effect</a><br />
					background-positionをアニメーションできるようになります。</p>
					<p>応用すると<br />
					<a href="http://snook.ca/archives/javascript/jquery-bg-image-animations/">http://snook.ca/archives/javascript/jquery-bg-image-animations/</a><br />
					こんな感じに楽しげなナビゲーションがつくれます。</p>
					<h3 id="logo" style="display: block;"><strong>addCommand<span>.js<br />
					</span></strong></h3>
					<p style="display: block;"><a href="http://lab.hisasann.com/addCommand/">http://lab.hisasann.com/addCommand/</a><br />
					連続するアニメーションをネストせずに書いていけるプラグイン。複雑なアニメーションをする場合などに便利です。</p>
					<h3><strong>jQuery Easing Plugin</strong></h3>
					<p><a href="http://gsgd.co.uk/sandbox/jquery/easing/">http://gsgd.co.uk/sandbox/jquery/easing/</a><br />
					Easingと言えばこれ。jQueryのanimateメソッド内で指定するだけで色んな動きが使えます。</p>
					<h2 id="plugin2" style="display: block;">プラグイン/単体で使えるものとか</h2>
					<h3><strong>Flip!</strong></h3>
					<p><a href="http://lab.smashup.it/flip/">http://lab.smashup.it/flip/</a><br />
					表示要素をくるっと回転させるエフェクトで切り替える。アイデアが面白いですね。</p>
					<h3><strong>Roundabout for jQuery</strong></h3>
					<p><a href="http://fredhq.com/projects/roundabout/">http://fredhq.com/projects/roundabout/</a><br />
					3Dの回転を実現するプラグイン。ドラッグできたらもっといいんですけどね。</p>
					<h3><strong>LavaLamp  for jQuery lovers!</strong></h3>
					<p><a href="http://www.gmarwaha.com/blog/2007/08/23/lavalamp-for-jquery-lovers/">http://www.gmarwaha.com/blog/2007/08/23/lavalamp-for-jquery-lovers/</a><br />
					元々mootoolsプラグインだったLavaLampをjQueryで実現するプラグイン。装飾のないグローバルナビゲーションもこれひとつでちょっと目を引くナビゲーションになります。</p>
					<h3><strong>可変レイアウトグリッドjQueryプラグイン</strong></h3>
					<p><a href="http://blog.xlune.com/2009/09/jqueryvgrid.html">http://blog.xlune.com/2009/09/jqueryvgrid.html</a><br />
					グリッド系は色々ありますが、こちらが一番きれいに動きますね。</p>
					<h3><strong>jQuery Approach</strong></h3>
					<p><a href="http://srobbin.com/jquery-plugins/jquery-approach/">http://srobbin.com/jquery-plugins/jquery-approach/</a><br />
					カーソルが対象要素に近づくにつれてに文字サイズを小さくしたり透過度を上げたり･･･durationではなくカーソルの位置に合わせてanimateメソッドを実行しているような感じ。結構面白いです。</p>
					<h2 id="plugin3">プラグイン/スクロール系</h2>
					<h3><strong>jQuery Scroll Follow</strong></h3>
					<p><a href="http://kitchen.net-perspective.com/open-source/scroll-follow/">http://kitchen.net-perspective.com/open-source/scroll-follow/</a><br />
					スクロールに合わせて要素がついてくる。ナビゲーション等に使うのが一般的ですかね。</p>
					<h3><strong>LOCALSCROLL</strong></h3>
					<p><a href="http://plugins.jquery.com/project/LocalScroll">http://plugins.jquery.com/project/LocalScroll</a><br />
					内部の要素をスクロールで移動させてページ切り替えのようにみせる。</p>
					<h3><strong>Easingスクロールプラグイン</strong></h3>
					<p><a href="http://5509.me/2009/05/18/page-scrolling-with-jqueryeasing.html">http://5509.me/2009/05/18/page-scrolling-with-jqueryeasing.html</a><br />
					Easingプラグインを利用したするするスムーズスクロールプラグイン。スクロールの動きを選べます。</p>
					<h2>他にも･･･</h2>
					<p>jQuery関連のプラグインはほとんどがアニメーション絡みだったりするので、紹介した以外にもまだまだ山ほどあります。Flashと比べるのはそもそもあれですが、JSだけでも動きのあるサイトは作れますので、ピンポイントにでも実装してみてはいかがでしょうか。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/jquery-with-animation/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>大阪でコーダー向け(JavaScript)勉強会を行います</title>
		<link>http://5509.me/log/notification-of-dotcoder</link>
		<comments>http://5509.me/log/notification-of-dotcoder#comments</comments>
		<pubDate>Sat, 06 Feb 2010 17:34:59 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[Notification]]></category>
		<category><![CDATA[イベント]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1983</guid>
		<description><![CDATA[					コーダー・Webデザイナー向けの(JavaScript)勉強会「.coder（どっとこーだー）」 を大阪で行います。なんせ人が集まらなすぎてもあれだったので、Twitterで募集してみたら意外にもたくさんのリプ [...]]]></description>
			<content:encoded><![CDATA[					<p>コーダー・Webデザイナー向けの(JavaScript)勉強会「<strong>.coder（どっとこーだー）</strong>」 を大阪で行います。なんせ人が集まらなすぎてもあれだったので、<a href="http://twitter.com/5509/status/8659425065">Twitterで募集</a>してみたら意外にもたくさんのリプライもらいまして･･･ありがとうございます。</p>
					<p>で、なんだか誤解が生じているかも知れないので先に言っておくと、<strong>セミナー形式ではなく、みんなで5分10分ずつでもしゃべっていく形</strong>で考えています。LTみたいな感じですね。本気でやるぜ！ってなったら色々と気張ってしまうし、持続もしないでしょうし、ゆるい感じで進めていきたいです。</p>
					<p>(JavaScript)勉強会としているのは、今後も継続して行い、回によって扱うテーマを変えることも想定しているためです。目的としては、関西（主に大阪）のコーダー・Webデザイナーなどフロントエンドの人たちの交流、情報の共有です。僕が色んな人と話をしたいというのが一番の目的とかなんとか･･･でも早い話が、<a href="http://archiva.jp/web/sugamo_css/sugamo_css.html">Sugamo.css</a>の真似ですよね。すみません。</p>
					<p>とりあえず決まっていることを以下にまとめておきます。調整中項目などは決まれば随時追加していきます。参加表明などは<a href="http://rewish.org">rewさん</a>が調整してくれているので、そちらについてもまたお知らせします。</p>
					<p>とりあえず興味あるよ！何か話したい！とかあればコメントにお願いします。</p>
					<h2>お知らせとか</h2>
					<p>このブログでも行いますが、連絡用Twitterアカウントを用意したので、こっちもフォローしてください。</p>
					<p><a href="http://twitter.com/dotcoder">http://twitter.com/dotcoder</a></p>
					<h2>第1回の概要</h2>
					<h3>テーマ</h3>
					<p>JavaScript。主にjQuery関連が多いと思います。</p>
					<h3>対象</h3>
					<p><strong>JSを少しでも触ったことのある</strong>コーダー・Webデザイナー。（またはJSに興味があり、これから使っていきたいと思っている人。）</p>
					<h3>形式</h3>
					<p>一人3分〜10分程度の持ち時間でJS関連の話題で話すライトニングトーク形式。参加者全員が話すの必須じゃないですが、出来れば何かしら話してもらいたいです。今のところ5人くらい話す人が決まってます。</p>
					<h3>スタンス</h3>
					<p>ゆるく、楽しく。</p>
					<h3>募集人数</h3>
					<p>最大25人まで。25人も集まった場合、僕がどうしていいか分からなくなると思いますが、数字については完全にアタリです。集まらなくても最低人数で開催します。</p>
					<h3>場所</h3>
					<p>調整中。</p>
					<h3>日時</h3>
					<p>調整中。3月20〜22日のいずれかで考えていますが、会場の都合もあるので、4月になるかもしれません。</p>
					<h3>会費</h3>
					<p>調整中。たぶん500円くらい必要になるかと思います。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/notification-of-dotcoder/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>CSS Nite LP, Disk 9「Coder&#8217;s Higher」に出演します</title>
		<link>http://5509.me/log/lp9</link>
		<comments>http://5509.me/log/lp9#comments</comments>
		<pubDate>Mon, 01 Feb 2010 10:24:07 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[WebDev]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1970</guid>
		<description><![CDATA[					
					2010年も早いもので1ヶ月が終わりもう2月ですね。唐突ですが、4月に開催されるCSS Nite LP, Disk 9「Coder&#8217;s Higher」に出演させていただきます。LPといえ [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://lp9.cssnite.jp/"><img src="http://cssnite.jp/images/CSSNiteLP9_banner.gif" alt="CSS Nite LP, Disk 9「Coder's Higher」" /></a></p>
					<p>2010年も早いもので1ヶ月が終わりもう2月ですね。唐突ですが、4月に開催される<a href="http://lp9.cssnite.jp/">CSS Nite LP, Disk 9「Coder&#8217;s Higher」</a>に出演させていただきます。LPといえば東京ですね。僕は大阪なので、Twitterから伝わってくる東京のイベントの盛り上がりに、いつか参加できればなんて思っていたのですが、思わぬ展開で参加できることになりました。</p>
					<p>僕のセッションでは<strong>jQuery</strong>を扱いますが、Coder&#8217;s Higherだけに<strong>HTML5やCSS3</strong>、<strong>スピードコーディング</strong>などコーダーの方にはわくわくが止まらない内容になっています。色々な人に会えるのが今から楽しみで仕方ないです。。東京の皆さまよろしくお願いします！</p>
					<p>ところで、現在gihyo.jpで一緒に執筆している<a href="http://twitter.com/rewish/mukimuki">mukimukist</a>の一人、<a href="http://h2ham.seesaa.net/">THE HAM MEDIAのハムさん</a>も出演します･･･！</p>
					<p>このブログでは今までプライベートな話題を書いていなかったので、なんとなく避けていましたが昨年9月に転職し、現在はディレクターとして働いています。<a href="http://gihyo.jp/design/serial/01/jquery-site-production">gihyoさんで連載させていただいている</a>のもあり、記事数もめっきり減っていますが、新感覚のUIを求めて毎日を過ごしていますので、またその内新しいプラグインでも作りたいです。また週4記事更新とかやりたいですｗ</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/lp9/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery.selectable.jsを構成し直したjQselectableを公開し(て)ました</title>
		<link>http://5509.me/log/selectable-is-rebuilt-as-jqselectable</link>
		<comments>http://5509.me/log/selectable-is-rebuilt-as-jqselectable#comments</comments>
		<pubDate>Tue, 12 Jan 2010 15:42:43 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[note]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1828</guid>
		<description><![CDATA[					順番がかなり前後していますが、先日jQselectableをAjaxZip2と併用するという記事を書いたので、jQselectable公開時に公開するはずだったこのページもついでに公開しておきます。（前後したつ [...]]]></description>
			<content:encoded><![CDATA[					<p>順番がかなり前後していますが、先日<a href="http://5509.me/2010/01/10/jqselectable-with-using-ajaxzip2.html">jQselectableをAjaxZip2と併用する</a>という記事を書いたので、jQselectable公開時に<span style="text-decoration: underline;">公開するはずだった</span>このページもついでに公開しておきます。（前後したついでに先に言っておくと、当のアーカイブは未だに更新できてません。）</p>
					<p><span id="more-1828"></span></p>
					<p>jQselectableのプロジェクトページはGooglecodeになります。<br />
					<a href="http://code.google.com/p/jqselectable/">jQselectable: http://code.google.com/p/jqselectable/</a></p>
					<p>名前がselectableからjQselectableに変わったのですが、これは<a href="http://jqueryui.com/demos/selectable/">jQuery UIにselectableという便利なプラグインが存在する</a>ためです。</p>
					<p>実際にUI selectableを使う人はほとんどいないと思いますが、せっかくなのでメソッド名も変えました。ただ変わったと言っても実際にはselectableからも呼び出せますので、特に何も気にすることはありません。<br />
					前もってUI selectableをロードしてるときは今までのselectableメソッドが無効になります。<br />
					ただ併用する場合はUI selectableを先にロードさせる必要があります。この辺はprototypeとjQueryのそれと同じような感じです。</p>
					<pre>$.fn.selectable = $.fn.jQselectable;

$(elm).selectable();
$(elm).jQselectable();
// どちらでもいい</pre>
					<p>使う人にとってはコードなんかどうでもいい所ですが、書き直したことで<strong>jQselectableを実行した後に、JSやAJAXを使って動的に内容が書き変わっても、rebuildメソッドを実行することでjQselectableの内容を最新に更新することができます</strong>。</p>
					<p><span style="text-decoration: line-through;">selectableのページを新しくしたので詳しい使い方などはそちらを見てもらうとして、</span>ここではrebuildメソッドの使い方を簡単に説明します。</p>
					<pre>var selectable = $(elm).jQselectable(); // 実行
selectable.rebuild(); // 再構築</pre>
					<p>上記のような再構築が必要ない場合は、今まで通り</p>
					<pre>$(elm).jQselectable();</pre>
<p>だけです。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/selectable-is-rebuilt-as-jqselectable/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQselectable(jQuery.selectable.js)とAjaxZip2を併用する</title>
		<link>http://5509.me/log/jqselectable-with-using-ajaxzip2</link>
		<comments>http://5509.me/log/jqselectable-with-using-ajaxzip2#comments</comments>
		<pubDate>Sun, 10 Jan 2010 14:04:21 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[プラグイン]]></category>
		<category><![CDATA[ユーザビリティ]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1936</guid>
		<description><![CDATA[					コメントでいただいたので記事にします。AjaxZip2を実行したときに都道府県が補完されますが、都道府県にselectableを適用している場合、補完されても表示が切り替わりません。これの対応方法です。
			 [...]]]></description>
			<content:encoded><![CDATA[					<p>コメントでいただいたので記事にします。<a href="http://www.kawa.net/works/ajax/ajaxzip2/ajaxzip2.html">AjaxZip2</a>を実行したときに都道府県が補完されますが、都道府県にselectableを適用している場合、補完されても表示が切り替わりません。これの対応方法です。</p>
					<p>昨年11月に<a href="http://5509.me/2008/09/14/jqueryselectable.html">jQuery.selectable.js</a>をアップデートした<a href="http://code.google.com/p/jqselectable/">jQselectable</a>というプラグインをGoogle Codeで公開しました。公開直後に<a href="http://twitter.com/">Twitter</a>から広がり、<a href="http://phpspot.org/blog/archives/2009/11/select_jqselect.html">PHPSPOTさんでも紹介された</a>り、jQselectableは色々な方に見ていただけましたが、肝心のドキュメントがありません。。基本的に使い方はjQuery.selectable.jsと同じで、今回説明する<strong>rebuild</strong>というメソッドを追加しました。</p>
					<p>まずはサンプルをご覧ください。</p>
					<p class="link"><a href="http://jqselectable.googlecode.com/svn/trunk/withzipsample.html">View the Demo</a><br />
					<a href="http://jqselectable.googlecode.com/files/jQselectable_zip.zip">Download sample files</a></p>
					<p class="link"><span id="more-1936"></span></p>
					<h2>必要ファイルの読み込み</h2>
					<p>jQueryをGoogleのJSAPIから読んでいますが、ローカルでもいいです。</p>
					<pre>&lt;script type="text/javascript" src="http://www.google.com/jsapi"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;google.load("jquery", "1.3.2");&lt;/script&gt;
&lt;script type="text/javascript" src="js/jQselectable.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/ajaxzip2.js"&gt;&lt;/script&gt;</pre>
					<h2>実行手順</h2>
					<h3>jQselectableの実行</h3>
					<p>ここはjQuery.selectable.jsと同じです。</p>
					<pre>var pref = $("#pref").jQselectable({
  set: "fadeIn",
  setDuration: "fast",
  opacity: .9
});</pre>
					<p>が、ひとつだけ違うところがあって</p>
					<pre>var pref = $("#pref").jQselectable({</pre>
<p>実行したものを変数に入れておきます。</p>
<h3>AjaxZip2を実行するためにハンドラをバインドする</h3>
<p>AjaxZip2の使い方は分かっているものと仮定して進めますので、初めてな方は<a href="http://www.kawa.net/works/ajax/ajaxzip2/ajaxzip2.html">AjaxZip2の配布ページ</a>を確認してください。</p>
<pre>$("#zip").keyup(function(){
 // AjaxZip2
 AjaxZip2.zip2addr(this,"pref","addr");
});</pre>
					<h3>補完後にselectableをrebuildする</h3>
					<p>補完後に、フォーカスが住所の最後に移動しますがこのとき発生する、blurを利用します。</p>
					<pre>$("#zip").blur(function(){
 // rebuilds target jQselectable element
 pref.rebuild();
});</pre>
					<p>これでAjaxZip2実行後に、selectableの見た目部分が構成し直され、補完された都道府県が表示されます。</p>
					<p class="link"><a href="http://jqselectable.googlecode.com/svn/trunk/withzipsample.html">View the Demo</a><br />
					<a href="http://jqselectable.googlecode.com/files/jQselectable_zip.zip">Download sample files</a></p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/jqselectable-with-using-ajaxzip2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMWareの仮想OS内のVM共有フォルダ以外のフォルダにMacから接続する</title>
		<link>http://5509.me/log/connecting-vm-windows-directory</link>
		<comments>http://5509.me/log/connecting-vm-windows-directory#comments</comments>
		<pubDate>Thu, 05 Nov 2009 18:23:46 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[memo]]></category>
		<category><![CDATA[vmwarefusion]]></category>
		<category><![CDATA[windows7]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1907</guid>
		<description><![CDATA[					VMWare Fusion3(2)を使ってインストールしたWindowsにはデフォルトでVMWare共有フォルダがあり、どちらのOSからでも同じようにアクセスできるようになっていますが、MacからWindows [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://www.act2.com/products/fusion3.html">VMWare Fusion3</a>(2)を使ってインストールしたWindowsにはデフォルトでVMWare共有フォルダがあり、どちらのOSからでも同じようにアクセスできるようになっていますが、<strong>MacからWindows内のフォルダ・ファイルを直接操作する方法は、VMWare自体には用意されていません（たぶん）</strong>。</p>
					<p>用意はされていませんが、<strong>仮想OSとはローカルでファイル共有サーバーにMacから接続ができる</strong>ため、権限さえ適切に用意されていれば、Macから自由に変更することができるので、その方法を紹介します。（ただし共有できるディレクトリはWindows7ではUsers以下に限る）</p>
					<p><span id="more-1907"></span></p>
					<h2>Macから接続するまでの流れ</h2>
					<p>以下はWindows7で話を進めます。</p>
					<h3>Windowsでユーザーアカウントにパスワードを設定しておく</h3>
					<p>コントロールパネルからパスワードの設定を行ってください。</p>
					<p>ユーザーアカウントのユーザーに対して、<strong>Users/ユーザーアカウント ディレクトリ以下のファイルにしか、変更・書き込み権限はなく、その他のディレクトリ・ファイルは読み取り専用</strong>となります。また<strong>Macから接続できるのは、Usersディレクトリ以下</strong>になります。Usersディレクトリ以下のUsers/ユーザーアカウント 以外のディレクトリのファイルを変更などする場合は、変更・書き込み権限を与えておく必要があります。</p>
					<p>上記に関してはあまりないと思うので、今回は省略して、次に進みます。というよりも、そもそもVMWareの共有フォルダで十分ですかね。。</p>
					<h3>ローカルIPアドレスを確認する</h3>
					<p>Windows内でCommand+Rで「<strong>ファイル名を指定して実行</strong>」窓を開き、「cmd」と入力して実行します。</p>
					<p><a href="http://5509.me/wp-content/uploads/2009/11/fig1.png"><img class="alignnone size-medium wp-image-1912" title="fig1" src="http://5509.me/wp-content/uploads/2009/11/fig1-300x181.png" alt="fig1" width="300" height="181" /></a></p>
					<p>コマンドプロンプトが表示されるので、<strong>ipconfigと入力し、実行します。IPv4アドレスに表示されているIPアドレスを覚えておいてください</strong>。</p>
					<p><a href="http://5509.me/wp-content/uploads/2009/11/fig21.png"><img class="alignnone size-medium wp-image-1918" title="fig2" src="http://5509.me/wp-content/uploads/2009/11/fig21-300x154.png" alt="fig2" width="300" height="154" /></a></p>
					<h3>Macから接続する</h3>
					<p>Finderを選択した状態でCommand+Kを押して、接続画面を開きます。<br />
					サーバアドレス入力欄に、「<strong>smb://IPアドレス</strong>」を入力して接続をクリックします。</p>
					<p><a href="http://5509.me/wp-content/uploads/2009/11/fig3.png"><img class="alignnone size-medium wp-image-1914" title="fig3" src="http://5509.me/wp-content/uploads/2009/11/fig3-300x66.png" alt="fig3" width="300" height="66" /></a></p>
					<p>するとこんな感じで名前とパスワードを聞かれるので、<strong>Windowsのユーザとパスワードを入力して、接続をクリック</strong>します。</p>
					<p><a href="http://5509.me/wp-content/uploads/2009/11/fig4.png"><img class="alignnone size-medium wp-image-1915" title="fig4" src="http://5509.me/wp-content/uploads/2009/11/fig4-300x195.png" alt="fig4" width="300" height="195" /></a></p>
					<p>どれをマウントするか聞かれるので、<strong>Usersを選択してOKをクリック</strong>します。</p>
					<p><a href="http://5509.me/wp-content/uploads/2009/11/fig5.png"><img class="alignnone size-medium wp-image-1916" title="fig5" src="http://5509.me/wp-content/uploads/2009/11/fig5-300x204.png" alt="fig5" width="300" height="204" /></a></p>
					<p>マウントされ、Finderのサイドバーに表示されました。<br />
					デスクトップにもショートカットが表示されていると思います。</p>
					<p><a href="http://5509.me/wp-content/uploads/2009/11/fig6.png"><img class="alignnone size-full wp-image-1917" title="fig6" src="http://5509.me/wp-content/uploads/2009/11/fig6.png" alt="fig6" width="173" height="90" /></a></p>
					<p>あとは、マウントしたサーバからファイルを編集したりすることができます。</p>
					<p>SVNやExcelは結局のところ、Windowsの方が色々都合がよかったりするのでWindowsメインで作業しています。<br />
					SVNがWindowsにあるけど、作業自体は、Macで行いたいときなどに有用ではないでしょうか。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/connecting-vm-windows-directory/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMWare Fusion3にWindows7をインストールしたのでメモなど</title>
		<link>http://5509.me/log/install-windows7-to-mac-with-vmwarefusion3</link>
		<comments>http://5509.me/log/install-windows7-to-mac-with-vmwarefusion3#comments</comments>
		<pubDate>Sun, 01 Nov 2009 23:00:59 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[memo]]></category>
		<category><![CDATA[vmwarefusion]]></category>
		<category><![CDATA[windows7]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1877</guid>
		<description><![CDATA[					
					Windows7をVMWare Fusion3にインストールしたときのメモ。
					今までFusion2とXPを使っていたのですが、どうもSpacesを使ってMacからWindowsに移動すると [...]]]></description>
			<content:encoded><![CDATA[					<p><img title="s6" src="http://5509.me/wp-content/uploads/2009/11/s6.jpg" alt="s6" width="350" /></p>
					<p><a href="http://www.microsoft.com/japan/windows/windows-7/default.aspx">Windows7</a>を<a href="http://www.act2.com/products/fusion3.html">VMWare Fusion3</a>にインストールしたときのメモ。<br />
					今までFusion2とXPを使っていたのですが、どうもSpacesを使ってMacからWindowsに移動するときにひっかかるし、プチフリーズ的なものが多発していました。原因はFusion2だったので、Fusion3はその辺の改善もされているということで一緒にアップグレードしてみました。なので面倒くさいので、Fusion2にWindows7を入れたりするような実験はしてみてません。</p>
					<p class="note">※ ちょうど<a href="http://ascii.jp/elem/000/000/472/472854/?mail">ASCII.jpで詳しめの解説記事が公開</a>されてました。</p>
					<p class="note"><span id="more-1877"></span></p>
					<h2>簡単にFusion3の改善点など</h2>
					<ul>
					<li><strong>Aeroが使える</strong></li>
					<li>Macへの負担減 (*1</li>
					<li><strong>64bit版OSへの対応</strong></li>
					</ul>
					<p>その他いろいろあるみたいですが、僕が使う上で主なものはこれくらいです。Windows7に関してはAeroを利用することで使いやすくなるので、Fusion3へのアップグレードは必須と言えるでしょう。言えないかも。</p>
					<p>*1) フルスクリーンモードで使用している際に、Spacesなどで移動したときのプチフリーズ的なものが多発していたのですが、ほとんど気にならない状態になりました。</p>
					<h2>Windows7をVMWare Fusion3にインストールするときの注意点</h2>
					<ul>
					<li><a href="http://www.act2.com/support/faq/index/id/519/">XPからのアップグレードは基本的にはできない</a> (*2</li>
					<li><a href="http://www.act2.com/support/faq/index/id/513/">Aeroを使う場合は、メモリ割当2GBあったほうがいい</a></li>
					<li>（当然）ひとつのライセンスでひとつの仮想環境にしかインストールできない</li>
					</ul>
					<p>*2) XPを使っている場合、アップグレード版からはインストールできないとのことなので、購入を考えている方は気をつけたほうがよさそうです。する方法もあるようですが。</p>
					<h2>利用環境</h2>
					<p>以下の2つの環境にインストールしました。当然ですが、iMacの方が快適に使えますね。</p>
					<h3>MacBook</h3>
					<ul>
					<li>アルミなのにキーボードのバックライトもないMacBook Proになれなかった悲しいやつ</li>
					<li>Core2Duo 2GHz</li>
					<li>4GBRAM</li>
					<li>Geforce 9400M</li>
					</ul>
					<h3>iMac</h3>
					<ul>
					<li>Core2Duo 2.66GHz</li>
					<li>4GBRAM</li>
					<li>Geforce 9400</li>
					</ul>
					<p>でどちらもメモリ割当は2GBにしています。</p>
					<h2>インストールからの簡単な流れ</h2>
					<h3>まずはインストール</h3>
					<p>別になんてことはないそのままなのですが、</p>
					<ol>
					<li>VMWare Fusionの手順に従ってインストール</li>
					<li>プロダクトキーのアクティベート</li>
					<li><strong>VMWare Toolsのインストール</strong></li>
					</ol>
					<p>このとき、元々XPなどのOSをインストールしている場合は、XP等登録されているOSが既定のOSになっていると、VMWare Fusionを起動すると自動でOSまで立ち上がります。</p>
					<p><img class="alignnone size-full wp-image-1887" title="s3" src="http://5509.me/wp-content/uploads/2009/11/s3.jpg" alt="s3" width="281" height="179" /></p>
					<p>DockにVMWareが入っている場合は、副ボタンから仮想マシンのライブラリを選択すると次のような画面になるので</p>
					<p><a href="http://5509.me/wp-content/uploads/2009/11/s5.jpg"><img class="alignnone size-medium wp-image-1888" title="s5" src="http://5509.me/wp-content/uploads/2009/11/s5-300x165.jpg" alt="s5" width="200" /></a> <a href="http://5509.me/wp-content/uploads/2009/11/s4.jpg"><img title="s4" src="http://5509.me/wp-content/uploads/2009/11/s4.jpg" alt="s4" width="200" /></a></p>
					<p>★をクリックして既定のOSから外しておきます。</p>
					<p>最後のVMWare Toolsのインストールがたぶん一番重要で、<strong>これをしないとAeroが使えるようになりません</strong>。こんなところで迷う人はあんまりいないと思いますが、僕は30分くらい迷ってました…</p>
					<p><a href="http://5509.me/wp-content/uploads/2009/11/s2.jpg"><img class="alignnone size-medium wp-image-1886" title="s2" src="http://5509.me/wp-content/uploads/2009/11/s2-300x235.jpg" alt="s2" width="300" height="235" /></a></p>
					<p>Aeroを利用できる環境で、VMWare Toolsをインストールして、再起動後<br />
					デスクトップ→副ボタン→個人設定からAeroテーマを選ぶことでAeroが有効になります。</p>
					<p><a href="http://5509.me/wp-content/uploads/2009/11/s7.jpg"><img title="s7" src="http://5509.me/wp-content/uploads/2009/11/s7-300x188.jpg" alt="s7" width="300" height="188" /></a></p>
					<h3>インストール後</h3>
					<p>デフォルトでUserのトップが共有フォルダに設定されていますが、ネットワーク上にあるファイルなどを扱うには別途共有フォルダの設定が必要です。</p>
					<p><a href="http://5509.me/wp-content/uploads/2009/11/s1.jpg"><img class="alignnone size-medium wp-image-1885" title="s1" src="http://5509.me/wp-content/uploads/2009/11/s1-300x213.jpg" alt="s1" width="300" height="213" /></a></p>
					<p>共有フォルダの追加から追加したいフォルダを選択すればOKです。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/install-windows7-to-mac-with-vmwarefusion3/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodaとGoogle Codeで始めるプロジェクトのバージョン管理</title>
		<link>http://5509.me/log/start-the-management-of-projects-with-coda-and-googlecode</link>
		<comments>http://5509.me/log/start-the-management-of-projects-with-coda-and-googlecode#comments</comments>
		<pubDate>Mon, 12 Oct 2009 19:02:05 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[WebDev]]></category>
		<category><![CDATA[Coda]]></category>
		<category><![CDATA[googlecode]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1846</guid>
		<description><![CDATA[					主な開発環境にMac専用クライアントのCodaを使っていますがCodaはサイト(プロジェクト)毎に、Subversion(*1)リポジトリが設定できるようになっています。バージョン管理はシステム開発などを行って [...]]]></description>
			<content:encoded><![CDATA[					<p>主な開発環境にMac専用クライアントの<a href="http://www.panic.com/jp/coda/">Coda</a>を使っていますがCodaはサイト(プロジェクト)毎に、Subversion(*1)リポジトリが設定できるようになっています。バージョン管理はシステム開発などを行っている人などにはおなじみだと思いますが、デザイナーやコーダーにはあまり馴染みが深くないかも知れません。実際僕もそうでした。この記事ではバージョン管理自体には触れませんが(*1)、jQueryライブラリの管理を<a href="http://code.google.com/">Google Code</a>の<a href="http://code.google.com/hosting/">Project Hosting</a>で行うようにしたので過程を紹介しておきます。</p>
					<p>1) Subversionについては説明すると長くなるので以下の記事などを参考にしてください。</p>
					<ul>
					<li><a href="http://www.thinkit.co.jp/free/article/0611/2/2/">第２回：Subversionによるバージョン管理（前編）</a></li>
					<li><a href="http://www.02.246.ne.jp/~torutk/subversion/intro.html">Subversionでバージョン管理</a></li>
					</ul>
					<p><span id="more-1846"></span></p>
					<h2>Google Codeでプロジェクト立ち上げる</h2>
					<p>Google codeはオープンソースライセンスのプロジェクトのホスティングサービスです。なので当然ですが、仕事案件などの管理はできないです。自作プラグインとかそういう感じのオープンソースなプロジェクトの管理で使うと便利です。</p>
					<h3>Googleアカウントがない人は…</h3>
					<p>まずはGoogleアカウントがないと何も始まらないので、ない人はGoogleアカウントを取得してください。</p>
					<p><img class="alignnone size-full wp-image-1848" title="Googleアカウント作成" src="http://5509.me/wp-content/uploads/2009/10/fig1.png" alt="Googleアカウント作成" height="200" /></p>
					<h3>新規プロジェクトを作成する</h3>
					<p>アカウントが発行されたら<a href="http://code.google.com/hosting/">Project Hosting</a>から早速新規プロジェクトを作成してみましょう。</p>
					<p><img class="alignnone size-full wp-image-1851" title="新規プロジェクト" src="http://5509.me/wp-content/uploads/2009/10/fig2.png" alt="新規プロジェクト" width="400" height="160" /></p>
					<p>Contribute Open Sourceのリンクからプロジェクトのドキュメントに移動します。</p>
					<p><img class="alignnone size-full wp-image-1852" title="新規プロジェクト作成リンク" src="http://5509.me/wp-content/uploads/2009/10/fig3.png" alt="新規プロジェクト作成リンク" width="339" height="189" /></p>
					<p>Create Projectのリンクからプロジェクト作成ページに移動します。</p>
					<p><img class="alignnone size-full wp-image-1855" title="プロジェクトの概要入力" src="http://5509.me/wp-content/uploads/2009/10/fig4.png" alt="プロジェクトの概要入力" width="364" height="400" /></p>
					<p>必要な箇所を入力していきます。</p>
					<ul>
					<li><strong>Project name</strong>: プロジェクト名、ディレクトリ名になります。小文字のみ。</li>
					<li><strong>Project summary</strong>: そのままサマリー。英語でも日本語でも。</li>
					<li><strong>Project description</strong>: 概要。英語でも日本語でも。</li>
					<li><strong>Version control system</strong>: <strong>Subversion</strong>を選択。</li>
					<li><strong>Source code license</strong>: 適用するライセンスを選択。</li>
					<li><strong>Project labels</strong>: タグみたいな感じ。</li>
					</ul>
					<p>最初に説明した通り、Google codeはオープンソースライセンスのプロジェクトのホスティングサービスです。ライセンスはオープンソース系のライセンスからしか選べず、プロジェクトは誰でも閲覧できる状態になります。</p>
					<p>入力ができたらCreate projectでプロジェクトを作成します。</p>
					<p><img class="alignnone size-full wp-image-1858" title="プロジェクトができた" src="http://5509.me/wp-content/uploads/2009/10/fig5.png" alt="プロジェクトができた" width="400" /></p>
					<p>作成したプロジェクトには</p>
					<p>http://projectname.googlecode.com</p>
					<p>(http://code.google.com/p/projectname)</p>
					<p>でアクセスできます。Subversionのリポジトリは</p>
					<p>https://projectname.googlecode.com/svn/trunk (httpではなく、<strong>https</strong>です)</p>
					<p>ここまで準備ができたら次はCodaの設定に移りますが、その前にGoogle code用のパスワードが必要になります。画面右上のProfileから遷移した先のページのSettingタブの中にパスワードがあります。</p>
					<p><img class="alignnone size-full wp-image-1856" title="プロフィールからパスワードを確認できる" src="http://5509.me/wp-content/uploads/2009/10/fig6.png" alt="プロフィールからパスワードを確認できる" width="300" /></p>
					<p><img class="alignnone size-full wp-image-1857" title="このパスワードをこの後使う" src="http://5509.me/wp-content/uploads/2009/10/fig7.png" alt="このパスワードをこの後使う" width="300" /></p>
					<h2>Codaの設定</h2>
					<h3>サイトの追加、リポジトリの設定</h3>
					<p>Codaを起動して、サイトを作成します。入力が必要な箇所はとりあえず名前、トップページURLとローカルルートです。トップページURLは http://projectname.googlecode.com を入力しておきます。</p>
					<p><img class="alignnone size-full wp-image-1860" title="Codaで新規サイトを作成する" src="http://5509.me/wp-content/uploads/2009/10/fig8.png" alt="Codaで新規サイトを作成する" width="400" height="229" /></p>
					<p>ローカルルートを入力したら、一番下にある「ソースをチェックアウト」を実行します。</p>
					<p><img class="alignnone size-full wp-image-1861" title="ソースコードのチェックアウト" src="http://5509.me/wp-content/uploads/2009/10/fig9.png" alt="ソースコードのチェックアウト" width="400" /></p>
					<p>実行すると、指定したローカルルートに.svnディレクトリが作成されて、ソース管理に入力項目が出てきます。</p>
					<p><img class="alignnone size-full wp-image-1863" title="SVNの情報を入力" src="http://5509.me/wp-content/uploads/2009/10/fig11.png" alt="SVNの情報を入力" width="400" /></p>
					<ul>
					<li>リポジトリURL: <strong>https://projectname.googlecode.com/svn/trunk</strong></li>
					<li>ユーザ名: <strong>Googleアカウント</strong></li>
					<li>パスワード: <strong>GoogleCode.com Password</strong></li>
					</ul>
					<p>をそれぞれ入力して準備完了です。</p>
					<h3>プロジェクトファイルの追加</h3>
					<p>準備ができたら、何かファイルを入れてみましょう。ディレクトリ・ファイルの右に？マークが出てると思います。</p>
					<p><img class="alignnone size-full wp-image-1864" title="SVNにディレクトリ・ファイルを追加" src="http://5509.me/wp-content/uploads/2009/10/fig12.png" alt="SVNにディレクトリ・ファイルを追加" width="389" height="98" /></p>
					<p>この？をクリックすると、ディレクトリをバージョン管理することができるようになります。</p>
					<h3>プロジェクトファイルのコミット</h3>
					<p>追加を行うと今度は、Aマークが出てきます。Aマークが出ているときは、ディレクトリ・ファイルに変更があったという状態です。</p>
					<p><img class="alignnone size-full wp-image-1865" title="コミット" src="http://5509.me/wp-content/uploads/2009/10/fig13.png" alt="コミット" width="400" /></p>
					<p>Aマークをクリックすると、ディレクトリ・ファイルをコミットすることができます。適当なコメントを入力して(空でも可)コミットします。</p>
					<p>コミットができたら、Google codeにコミットできているか確認してみましょう。プロジェクトのページのUpdatesから更新履歴画面に移動すると、下のようになっていることが確認できれば、コミットできています。r2というのはrevision2という意味です。</p>
					<p><img class="alignnone size-full wp-image-1866" title="コミットできてるか確認" src="http://5509.me/wp-content/uploads/2009/10/fig14.png" alt="コミットできてるか確認" width="377" height="63" /></p>
					<p>とりあえず、コミットまでを説明しましたが、Codaではその他にアップデート、比較、ロールバックなどをGUIから行うことができます。他の場所からコミットした場合などは作業に入る前に最新リビジョンにアップデートしておきましょう。</p>
					<p>バージョン管理自体の説明を端折ったので、何だかわからない人もいるかもしれませんが、きっと<a href="http://rewish.org">rewish.org</a>のrewさんが説明してくれるはずです <img src='http://5509.me/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/start-the-management-of-projects-with-coda-and-googlecode/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>gihyo.jpでWeb連載「もっと便利に！jQueryでラクラクサイト制作（実践サンプル付き）」を開始しました</title>
		<link>http://5509.me/log/start-serialization-of-jquery-archives</link>
		<comments>http://5509.me/log/start-serialization-of-jquery-archives#comments</comments>
		<pubDate>Fri, 02 Oct 2009 06:28:06 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[連載]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1842</guid>
		<description><![CDATA[					gihyo.jpで「もっと便利に！jQueryでラクラクサイト制作（実践サンプル付き）」という連載をTHE HAM MEDIAのハムさんと共著で始めました。
					http://gihyo.jp/desig [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://gihyo.jp/">gihyo.jp</a>で「<a href="http://gihyo.jp/design/serial/01/jquery-site-production/">もっと便利に！jQueryでラクラクサイト制作（実践サンプル付き）</a>」という連載を<a href="http://h2ham.seesaa.net/">THE HAM MEDIA</a>のハムさんと共著で始めました。</p>
					<p><a href="http://gihyo.jp/design/serial/01/jquery-site-production">http://gihyo.jp/design/serial/01/jquery-site-production</a></p>
					<p>記事の対象は主に「jQueryって便利そうだけど、JavaScriptとか難しそう…」というように考えているデザイナーやコーダーの方です。実際jQueryに触り出すと、簡単なスクリプトならどんどん書けるようになっていきます。その1歩を踏み出せるような記事を目指して連載していきますので、使おうか迷っている人はぜひ1歩を踏み出して使ってみてください。</p>
					<p>第1回目は「jQueryにふれる」です。</p>
					<p><a href="http://gihyo.jp/design/serial/01/jquery-site-production/0001">http://gihyo.jp/design/serial/01/jquery-site-production/0001</a></p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/start-serialization-of-jquery-archives/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>デスマなう for Twitter</title>
		<link>http://5509.me/log/deathmanow</link>
		<comments>http://5509.me/log/deathmanow#comments</comments>
		<pubDate>Tue, 15 Sep 2009 21:38:06 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Greasemonkey]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1813</guid>
		<description><![CDATA[					
					Twitterに「デスマなう」を投稿するボタンを追加するGreasemonkeyです。
					それだけです…
					使い方
					下記リンクからGreasemonkeyスクリプトをインス [...]]]></description>
			<content:encoded><![CDATA[					<p><img class="alignnone size-full wp-image-1823" title="デスマなう スクリーンショット" src="http://5509.me/wp-content/uploads/2009/09/スクリーンショット（2009-09-16-1.24.01-AM）.png" alt="デスマなう スクリーンショット" width="450" /></p>
					<p>Twitterに「デスマなう」を投稿するボタンを追加するGreasemonkeyです。<br />
					それだけです…</p>
					<h2>使い方</h2>
					<p>下記リンクからGreasemonkeyスクリプトをインストールします。</p>
					<p class="link"><a href="http://5509.me/sample/archive/deathmanow.user.js">Install DeathMaNow</a></p>
					<p class="link">TwitterのUpdateボタンの左に「デスマなう」ボタンが追加されます。<br />
					<strong>クリックすれば「デスマなう #deathmanow」が投稿されます</strong>。</p>
					<p class="link">そもそもデスマって何という方は<a href="http://e0166.blog89.fc2.com/blog-entry-429.html">ネタ帳さんの記事</a>辺りを参考にどうぞ。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/deathmanow/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>画像などのファイルを新しいウィンドウ・タブで開くGreasemonkey</title>
		<link>http://5509.me/log/ofbnw</link>
		<comments>http://5509.me/log/ofbnw#comments</comments>
		<pubDate>Thu, 03 Sep 2009 05:27:36 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Greasemonkey]]></category>
		<category><![CDATA[memo]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1779</guid>
		<description><![CDATA[					Greasemonkeyばっかりですが… 単純に作業するにあたって作ったものをあげてます。
					タイトルそのままで、画像などのリンクを新しいウィンドウ・タブで開くためにtarget=&#8221;_bla [...]]]></description>
			<content:encoded><![CDATA[					<p>Greasemonkeyばっかりですが… 単純に作業するにあたって作ったものをあげてます。</p>
					<p>タイトルそのままで、画像などのリンクを新しいウィンドウ・タブで開くためにtarget=&#8221;_blank&#8221;を追加します。</p>
					<p>毎回Ctrl/Commandを押すのが面倒くさくて…中クリックも忘れることが多いし…<br />
					間違えてタブを閉じることが多いのでいっそのことということで書きました。</p>
					<p>target=&#8221;_blank&#8221;について色々と議論はあるようですが、自分で使うだけなので気にしないことにします。またonclickとかでイベントを上書きするとLightboxなどのスクリプトに干渉したりしそうなので、あえてtarget=&#8221;_blank&#8221;にしました。</p>
					<p>デフォルトでは自分の用途に合わせて、jpg・gif・png画像とPDFをtarget=&#8221;_blank&#8221;で開くようにしています。 追加したい場合は、var filetypesに追加してください。</p>
					<pre>var filetypes = /\.jpg|\.jpeg|\.gif|\.png|\.pdf$/i;</pre>
<p class="link"><a href="http://5509.me/sample/userjs/ofbnw.user.js">Install this script</a></p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/ofbnw/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yahooアクセス解析で縮小されるURLを開くGreasemonkey</title>
		<link>http://5509.me/log/expand_url_on_ya</link>
		<comments>http://5509.me/log/expand_url_on_ya#comments</comments>
		<pubDate>Fri, 07 Aug 2009 08:35:49 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Greasemonkey]]></category>
		<category><![CDATA[Yahooアクセス解析]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1757</guid>
		<description><![CDATA[					実験的にYahooアクセス解析を導入していますが、先日のコンバージョン計測導入時に参照元URLとかページビューランキングのURLが短縮されるようになってしまいました。
					見にくい
					
					 [...]]]></description>
			<content:encoded><![CDATA[					<p>実験的に<a href="http://analytics.yahoo.co.jp/">Yahooアクセス解析</a>を導入していますが、先日のコンバージョン計測導入時に<strong>参照元URLとかページビューランキングのURLが短縮されるようになってしまいました</strong>。</p>
					<h3>見にくい</h3>
					<p><img class="alignnone size-full wp-image-1761" title="短縮されたURL" src="http://5509.me/wp-content/uploads/2009/08/ex_ya_a1.gif" alt="短縮されたURL" width="450" height="109" /><br />
					↑このように短縮される。いや…見にくいから…</p>
					<h3>以前の状態に戻す</h3>
					<p>これは見にくい…！ていうかこんなんで何がわかるんやろう…クリックするまでわからないこと面倒くささ。(Firebugで見れますが)とても使いにくいので、取り急ぎ短縮されたURLを開くGreasemonkey書きました。</p>
					<p><img class="alignnone size-full wp-image-1762" title="開いたURL" src="http://5509.me/wp-content/uploads/2009/08/ex_ya_b1.gif" alt="開いたURL" width="450" height="109" /><br />
					↑開いてついでにデコードします。</p>
					<p>文字数が増えるとテーブルが崩れ出すので、とりあえず70文字制限にしました。70文字を超えるURLは&#8230;のようになります。<br />
					YAはまだまだ実験要素が多いようなので、また戻るかもしれません。というか戻してくれるといいですね。</p>
					<p class="link"><a href="http://5509.me/sample/exuoya/expand_url_on_ya.user.js">Install Expand URL on YA</a></p>
					<h2 class="link">更新履歴とか</h2>
					<ul>
					<li>2009-08-10 bugfix, ツールチップでフルURLを確認できるように変更</li>
					</ul>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/expand_url_on_ya/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>入力したパスワードを表示するGreasemonkey</title>
		<link>http://5509.me/log/chkpasswduserjs</link>
		<comments>http://5509.me/log/chkpasswduserjs#comments</comments>
		<pubDate>Mon, 03 Aug 2009 04:00:49 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Greasemonkey]]></category>
		<category><![CDATA[ユーザビリティ]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1709</guid>
		<description><![CDATA[					
					通常入力したパスワードは、アスタリスクで*****のように隠れてしまいますが、うっかりキーを押しすぎたときとか、何を打ったかわからなくなるときないですか？
					いちいち全部消して、、打ちなおし [...]]]></description>
			<content:encoded><![CDATA[					<p><img class="alignnone size-full wp-image-1716" title="ChkPasswd.user.js" src="http://5509.me/wp-content/uploads/2009/08/ピクチャ-13.png" alt="ChkPasswd.user.js" width="237" height="142" /></p>
					<p>通常入力したパスワードは、アスタリスクで*****のように隠れてしまいますが、うっかりキーを押しすぎたときとか、何を打ったかわからなくなるときないですか？</p>
					<p>いちいち全部消して、、打ちなおして、、また間違えて…よくやりますｗ</p>
					<p>常に表示されるとセキュリティ面で不安も残るかも知れないので、チェックボックスをチェックしてるときだけ表示されるGreasemonkeyを書きました。簡単に言えばこの前書いた<a href="http://5509.me/2009/07/02/hintmask.html">hintmask</a>のGreasemonkey版です。</p>
					<p>それなりに使えると思うのでFirefoxの方は試しにインストールしてみてください。</p>
					<p><span id="more-1709"></span></p>
					<h2 class="link">インストール</h2>
					<h3>Greasemonkeyをインストール済みの方</h3>
					<p>下記リンクからインストールできます。</p>
					<p class="link"><a href="http://5509.me/sample/chkpasswd/chkpasswd.user.js">Install ChkPasswd</a></p>
					<h3 class="link">Greasemonkeyをインストールしていない方</h3>
					<p><a href="https://addons.mozilla.org/ja/firefox/addon/748">Greasemonkey: Firefox Add-on</a>からGreasemonkeyをインストール後、下記リンクからインストールできます。</p>
					<p class="link"><a href="http://5509.me/sample/chkpasswd/chkpasswd.user.js">Install ChkPasswd</a></p>
					<h2 class="link">使い方</h2>
					<p>Chkpasswdをインストールすると</p>
					<ol>
					<li><strong>パスワード入力欄(input[type="password"])の右にチェックボックスが表示</strong>されるようになります<a href="#com1">(*1)</a>。</li>
					<li>これを<strong>チェックすると入力パスワードがパスワード入力欄の下に表示</strong>されます<a href="#com2">(*2)</a>。</li>
					<li>未入力の場合は何も表示されません。</li>
					</ol>
					<h3>注意</h3>
					<ol>
					<li>チェックを入れると当然<strong>パスワードが丸見えになります</strong>。</li>
					<li><strong>周囲に人の気配を感じたらチェックを外してください</strong>。</li>
					<li><strong>共有のPCにはインストールしないほうがいい</strong>かもしれません。</li>
					<li>ボックスの影はFirefox3.5以上で有効です。</li>
					</ol>
					<h2>バグなど</h2>
					<ol>
					<li id="com1">パスワード入力欄が<strong>予め表示されていないような場合は、画面左上のほうに表示</strong>されます。<br />
					また、パスワード入力欄の右に予めテキストまたは他の要素がある場合は、それらにかぶさってチェックボックスが表示されます。</li>
					<li id="com2">1と同じく、予めパスワード入力欄が表示されていないような場合は、画面左上のほうに表示されます。</li>
					<li id="com2">WordPressの管理ログイン画面でなんかずれてます。</li>
					<li id="com2">なんだか他にもありそうなので上記以外のバグはコメントなどで教えてください。。(解決できるかわかりませんが…)</li>
					</ol>
					<h2>メモ</h2>
					<p>CSS3プロパティのFirefox先攻拡張</p>
					<ul>
					<li>-moz-border-radius</li>
					<li>-moz-box-shadow</li>
					</ul>
					<p>はDOM Level1の</p>
					<pre>elm.style.***** = xxxxx;</pre>
<h3 id="e090805">修正しました</h3>
<pre>elm.style.MozBorderRadius</pre>
					<p>のように-(ハイフン)の後ろの文字を大文字にするルールに従うだけでした。<br />
					コメントありがとうございます:)</p>
					<p><span style="text-decoration: line-through;">では、うまくいかなかったのですが(というより頭文字のハイフンの扱い方も分からないし、書き方もわからない)</span><a href="#e090805"><strong>修正済*090805</strong></a>、<a href="http://blog.wonder-boys.net/">wonderさん</a>に<strong>setAttributeメソッドから直接書き込めばできるよ</strong>、と教えてもらいその方法で回避しました。</p>
					<pre>elm.setAttribute('style','-moz-border-radius: 5px');</pre>
<p>ただ、<strong>他にもstyleを指定している場合は、setAttributeを先に指定しておかないと、全て上書きしてしまいます</strong>。<strong>先にsetAttributeを指定しておけば</strong>、elm.style.****の分は後から追加されるので問題ないです。</p>
<h3>ダメ</h3>
<p><strong>setAttributeはstyle属性の値を更新する</strong>。</p>
<pre>elm.style.border = 'solid #006FFF 1px';
elm.style.padding = '5px';
elm.style.display = 'none';
elm.style.color = '#fff';
elm.style.backgroundColor = '#73adff' ;

elm.setAttribute('style','-moz-border-radius: 5px');</pre>
					<h3>イイ</h3>
					<p><strong>先にstyle属性を更新しておけばいい</strong>。</p>
					<pre>elm.setAttribute('style','-moz-border-radius: 5px');

elm.style.border = 'solid #006FFF 1px';
elm.style.padding = '5px';
elm.style.display = 'none';
elm.style.color = '#fff';
elm.style.backgroundColor = '#73adff' ;</pre>
					<p>今回は</p>
					<ul>
					<li>-moz-border-radius</li>
					<li>-moz-box-shadow</li>
					</ul>
					<p>を使っているのでこれらは1回のsetAttributeでまとめて記述する必要があります。</p>
					<pre>elm.setAttribute('style','-moz-border-radius: 5px; -moz-box-shadow: 3px 3px 3px #666');</pre>
<p>ところで、-moz-box-shadowはFirefox3.5でのプレフィクスなので3.5以上じゃないと適用されないです。ちょうど、3ping.orgのwuさんも<a href="http://3ping.org/2009/08/01/1259">CSSの実装状況で変わるボックスのデザイン方法</a>でCSS2,CSS3のプロパティ・セレクタを使って色んなdiv要素の見せ方を提示されてますが、CSS3までのプロパティ・セレクタが使えるようになると、CSSだけでもデザインの幅がかなり広がりますね。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/chkpasswduserjs/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>リニューアルのポイントまとめ(WordPressプラグイン、HTML5など)</title>
		<link>http://5509.me/log/renewal-memo</link>
		<comments>http://5509.me/log/renewal-memo#comments</comments>
		<pubDate>Mon, 20 Jul 2009 15:45:48 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[WebDev]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[memo]]></category>
		<category><![CDATA[まとめ]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1647</guid>
		<description><![CDATA[					色々と構成やら使ってるプラグインやらを変えたので一応メモ。今回のリニューアルでは実験要素を多く含んでいるので全てのブラウザーをサポートできていません(HTML,CSS的な意味で)。
					
					Wor [...]]]></description>
			<content:encoded><![CDATA[					<p>色々と構成やら使ってるプラグインやらを変えたので一応メモ。今回のリニューアルでは実験要素を多く含んでいるので<strong>全てのブラウザーをサポートできていません</strong>(HTML,CSS的な意味で)。</p>
					<p><span id="more-1647"></span></p>
					<h2>WordPress</h2>
					<h3>2.8.1</h3>
					<p>ちょうどいい機会なので2.7.1から<strong>2.8.1</strong>にアップグレード、というかインストールし直しました。と思ったら2.8.2が…</p>
					<h3>使ったWordPressプラグイン</h3>
					<p>をリストで挙げようと思ったんですけれど、<a href="/2009/04/16/using-wordpress-as-cms.html">CMSとしてのWordPressでサイト構築をするときに便利な13のプラグイン</a>で紹介したものとほぼ被りなのでやめます。</p>
					<p>ただ<a rel="nofollow" href="http://www.tinybeans.net/blog/2009/07/13-061303.html">Custom Field GUI Utility 2.0.0</a>は本当に便利なのでみなさん使ったほうがいいです。使うべきです。今回は一番ベタな使い方でアレですが、keywordsとdescriptionとして記事ページのmetaに出力させてます。<strong>All in One SEO Packがないと始まらないとか書いてた手前</strong>なんなんですが、出力されるHTMLソースが気に入らないし、wp_head()を入れたくなかったので<strong>使用をやめて</strong>、<a rel="nofollow" href="http://www.tinybeans.net/blog/2009/07/13-061303.html">Custom Field GUI Utility 2.0.0</a>で対応しました。使い方次第でどんな具合にも出来るので、他でも色々と使わせてもらってます。</p>
					<p>(過去記事のmeta移行はまだやってないので、空になってますね。地道にやるつもりですが、その辺うまいことひっぱれたら…)</p>
					<p>配布元の<a href="http://www.tinybeans.net/blog/">かたつむりくんのWWW</a>の<a href="http://www.tinybeans.net/blog/2009/07/13-061303.html">記事</a>を見れば分かることですが一応メモ。</p>
					<h3>Custom Field GUI Utility 2.0.0の設定メモ</h3>
					<p>使うものだけ表示させればいいので、conf-post.iniの中身を全部削除して</p>
					<pre>[cf_keywords]
fieldname = Keywords
type = textfield
size = 60
sample = jQuery,WordPress,Plugin
must = 1

[cf_description]
fieldname = Description
type = textfield
size = 60
sample = input the example or the caption
must = 1</pre>
					<p>だけに。他のconf-common.iniとconf-page.iniは削除(コメントアウトでも可)。<br />
					準備ができたら記事投稿ページに下のように表示されます。</p>
					<p><img class="alignnone size-full wp-image-1670" title="Custom Field GUI Utility" src="http://5509.me/wp-content/uploads/2009/07/cfguiu.gif" alt="Custom Field GUI Utility" width="400" height="196" /></p>
					<p>次はmetaで出力する方法ですが、カスタムフィールドの値は<strong>post_custom(key)で取得</strong>できます。またconf-post.iniで記述した<strong>[]内の値がkeyになる</strong>ので、例えばKeywordsを取得する場合は</p>
					<pre>post_custom('cf_keywords');</pre>
<p>になります。また<strong>カスタムフィールドの値はWordPressループの中でしか使えない</strong>ことも覚えておいてください。これらを踏まえて記事とページのみに表示させたい場合は、header.phpのmetaを以下のようにします。</p>
<pre>&lt;?php if (is_singular() &amp;&amp; have_posts() ) : while ( have_posts() ) : the_post(); ?&gt;
 &lt;meta name="keywords" content="&lt;?php echo post_custom('cf_keywords'); ?&gt;"&gt;
 &lt;meta name="description" content="&lt;?php echo post_custom('cf_description'); ?&gt;"&gt;
&lt;?php endwhile; else: ?&gt;
 &lt;meta name="keywords" content="jQuery,プラグイン,plugin,WordPress"&gt;
 &lt;meta name="description" content="jQueryとか気になったことなど"&gt;
&lt;?php endif; ?&gt;</pre>
					<p>(これだけならデフォルトのカスタムフィールドでも出来ますが、他にも使う予定があるので:) )</p>
					<h3>Commentの返信</h3>
					<p><strong>WordPressに実装されてるReplyを使えるように</strong>しました。ただJSは自分で書きました。<strong>OperaとIEではJSが機能しない</strong>ようになってます。でもReply自体はできるので別にいいですよね…</p>
					<p>実装方法は色々と紹介されてるので、下記リンクなどを参考にすればいいと思います。<br />
					(JSは自分で書いてるのでちょっと違います)</p>
					<ul>
					<li><a href="http://dogmap.jp/2009/02/17/wordpress_comment_thread/">WordPress コメントをスレッド対応にする : dogmap.jp</a></li>
					<li><a href="http://www.hide10.com/?p=12154">WordPress、vicuna CMSテーマのコメント欄をスレッド表示に対応させた &#8211; Hinemosu</a></li>
					</ul>
					<h2>HTML5</h2>
					<p><img class="alignnone size-full wp-image-1676" title="html5" src="http://5509.me/wp-content/uploads/2009/07/html5.gif" alt="html5" width="400" height="260" /></p>
					<p>ちょうど<a href="http://rewish.org/etc/transition">1ヶ月くらい前にHTML5でリニューアルしたrewish.org</a>にインスパイア？されて<strong>HTML5</strong>にしてみました。とりあえず現段階でわかってる情報だけでやってます。なので正しいのかどうかはわからないですが、楽しいですね新しいことは。そんなわけで<strong>IEは残念な結果になります</strong>。むしろIEが残念です。</p>
					<h2>CSS</h2>
					<h3>角丸</h3>
					<p><img class="alignnone size-full wp-image-1677" title="Rounded Corner" src="http://5509.me/wp-content/uploads/2009/07/ピクチャ-10.png" alt="Rounded Corner" width="121" height="70" /></p>
					<p>rounded-cornerプロパティをブラウザがネイティブでサポートしてる<strong>FirefoxとWebkitだけ</strong>に使ってます。OperaとIEはJSで対応しようと思ったけど、案の定調整が必要でやめました。</p>
					<p>とりあえず、<strong>-moz-border-radius</strong>は素晴らしいですね！</p>
					<h3>CSS Sprite</h3>
					<p><img class="alignnone size-full wp-image-1678" title="CSS Sprite" src="http://5509.me/wp-content/uploads/2009/07/ピクチャ-11.png" alt="CSS Sprite" width="32" height="119" /></p>
					<p>これはいまさらです。いまさらすぎて言うこともありません。。<br />
					ただ配置方法をしきつめすぎてて、文字サイズを大きくするとなんか見えたりします。</p>
					<h2>その他</h2>
					<h3>AutoPagerize</h3>
					<p>自作のを入れてたんですけど、GreasemonkeyのAutoPagerize対応に切り替えました。</p>
					<h3>Blogパーツ</h3>
					<p>パフォーマンスが落ちるのと、なんせ見た目がアレなのでとりあえず外しました。</p>
					<h3>SBMカウンタ</h3>
					<p><img class="alignnone size-full wp-image-1659" title="SBM Counter" src="http://5509.me/wp-content/uploads/2009/07/ピクチャ-5.png" alt="SBM Counter" width="175" height="53" /></p>
					<p>僕は毛の生えた程度しかPHPを触れないのですが、<a href="http://rewish.org/">rewish.org</a>のrewさんに<strong>SBMサービスから登録者数を取得</strong>するシンプルなAPIを書いてもらいました。近いうちにWordPressのプラグインになるかも…？サイドバーで使うと読み込み時間が2倍くらいになったので使ってないのですが、もともと使ってた<strong>はてなのブクマカウンタ画像も遅延の原因になってた</strong>ので、やめてしまいました。でも目安がないとちょっとわかりにくいですね。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/renewal-memo/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>iframe内のコンテンツを親からスクロールさせる</title>
		<link>http://5509.me/log/scroll-content-is-contained-in-iframe</link>
		<comments>http://5509.me/log/scroll-content-is-contained-in-iframe#comments</comments>
		<pubDate>Fri, 10 Jul 2009 04:25:02 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[memo]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1600</guid>
		<description><![CDATA[					iframe内コンテンツのスクロールを親のボタンから操作する方法です。
					普通にWeb制作をしている上でiframeを使う事はあまりないと思うので実用的かどうかは…。
					Demo
					Do [...]]]></description>
			<content:encoded><![CDATA[					<p>iframe内コンテンツのスクロールを親のボタンから操作する方法です。<br />
					普通にWeb制作をしている上でiframeを使う事はあまりないと思うので実用的かどうかは…。</p>
					<p class="link"><a href="http://5509.me/sample/frameslider">Demo</a><br />
					<a href="http://5509.me/sample/archive/frameslider.zip">Download demo files</a></p>
					<p><span id="more-1600"></span></p>
					<p>今回は、iframe内コンテンツでfunctionを作っておいて、それを親から実行することで実現させてます。<br />
					なのでiframe内に表示するコンテンツは外部のサイトとかはだめです。自分で作ったやつだけです。<br />
					以降面倒なので、親コンテンツは「親」、iframe内コンテンツを「子」とします。</p>
					<p>ところで、例によってjQueryを使っているので親・子共にjQueryを読ませておきます。<br />
					サンプルでは一番上にきたら↑が押せなくなったり、下にきたら↓が押せなくなったりしますがそれは考えないでおきましょう。それが気になる人はサンプルのソースを見てください。</p>
					<h2>用意するHTML</h2>
					<p>input#up, input#downを押したときにスクロールできるようにします。</p>
					<pre id="line84">&lt;iframe id="frame" src="sample.html" scrolling="no"&gt;インラインフレーム&lt;/iframe&gt;

&lt;p&gt;&lt;input type="button" id="down" value="↑" /&gt;
&lt;input type="button" id="up" value="↓" /&gt;&lt;/p&gt;</pre>
					<h2>子で記述しておくスクリプト</h2>
					<p>これ自体はとてもシンプルでeasingScrollで使ったように、コンテンツをスクロールさせるスクリプトを記述してます。親から実行するときに動作を決めるために、引数を2つ取るようにしてます。</p>
					<p>condは&#8217;starter&#8217;, &#8216;up&#8217;, &#8216;down&#8217;、optionsは下の通りdurationとか決めれます。<br />
					starterは開始時にずれてたら一番上にスクロールさせるための指定です。</p>
					<p>ちなみに親から参照する関係で、(function($){})(jQuery);内に記述できないので$はjQueryとしました。</p>
					<pre>function frameScroll(cond,options){

	// オプション - 呼び出し元で指定
	var c = jQuery.extend({
		duration: 200,
		easing: 'swing',
		step: 300
	},options || {});

	// frameScroll内で使う変数
	var d = document,
		content = jQuery.support.boxModel ? navigator.appName.match(/Opera/) ? 'html' : 'html,body' : 'body',
		scrollPos = d.body.scrollTop || d.documentElement.scrollTop;

	// starterなら一番上、upなら上へ、downなら下へ
	this.scrollTop = cond.match(/starter/) ? 0 : cond.match(/up/) ? scrollPos+c.step : scrollPos-c.step;

	// すくろおおおる
	jQuery(content).animate(
		{
			scrollTop: this.scrollTop
		},
		{
			duration: c.duration,
			easing: c.easing,
			queue: false
		}
	);
}</pre>
					<h2>親に記述するスクリプト</h2>
					<p>親からiframe内のスクリプトを実行する、と冒頭で書きましたが実行方法など含めて<a href="http://d.hatena.ne.jp/cyokodog/20090616/iframe01">iframe関連処理はcyokodogさんがまとめてくれてます</a>。</p>
					<pre>$('iframe')[0].contentWindow</pre>
<p>でiframe内のオブジェクトを参照できるので、iframe内で書かれたfunctionは</p>
<pre>$('iframe')[0].contentWindow.func()</pre>
					<p>で実行できます。さっきのframeScrollを実行するときは</p>
					<pre>$('iframe')[0].contentWindow.frameScroll('up',{
	step: 400
});</pre>
					<p>のように実行できます。これらをふまえると</p>
					<pre id="line1">jQuery(function($){

	// iframe内のドキュメントの読み込み完了時
	$('#frame').load(function(){
		// iframe内のドキュメントがスクロールした状態であれば一番上に移動させる
		$('#frame')[0].contentWindow.frameScroll('starter');
	});

	// #upをクリック
	$('#up').click(function(){
		// スクロールさせる
		$('#frame')[0].contentWindow.frameScroll('up');
	});

	// #downをクリック(処理は↑と同じ
	$('#down').click(function(){
		$('#frame')[0].contentWindow.frameScroll('down');
	});

	$('#up,#down').hover(function(){
		$(this).addClass('hover');
	},function(){
		$(this).removeClass('hover');
	});

});</pre>
					<p>こっちも説明の必要がないくらいかなりシンプルに書けました。<br />
					親では読み込み時に実行してしまえばいいので、jQuery(function($){});内に記述しています。</p>
					<p>実際のサンプルではこれに加えて、一番上・一番下に移動したらボタンを押せなくするという処理を加えています。あと横に移動させたいときはanimateのscrollTopをscrollLeftにしたりして対応できます。</p>
					<p>忘れてた、、今回使ってないですが、スクロールにanimateを使っているのでeasingプロパティでeasingが使えます。easeOutBounceでぼよんぼよんしてください。</p>
					<p class="link"><a href="http://5509.me/sample/frameslider">Demo</a><br />
					<a href="http://5509.me/sample/archive/frameslider.zip">Download demo files</a></p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/scroll-content-is-contained-in-iframe/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Codaのプラグイン ConvertKanaが便利</title>
		<link>http://5509.me/log/convertkana</link>
		<comments>http://5509.me/log/convertkana#comments</comments>
		<pubDate>Wed, 08 Jul 2009 04:34:31 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[WebDev]]></category>
		<category><![CDATA[Coda]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1586</guid>
		<description><![CDATA[					
					クライアントからもらったデータの全角率になんとも言えない感情を覚えたことはないですか？
					Mac専用のCodaをメインにコーディングしている人には
					ProveさんのLABで公開され [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://www.prove-wsc.com/lab.html"><img class="alignnone size-full wp-image-1587" title="convertkana" src="http://5509.me/wp-content/uploads/2009/07/convertkana.gif" alt="convertkana" width="376" height="190" /></a></p>
					<p>クライアントからもらったデータの全角率になんとも言えない感情を覚えたことはないですか？<br />
					Mac専用の<a href="http://www.panic.com/jp/coda/">Coda</a>をメインにコーディングしている人には<a href="http://www.prove-wsc.com/"><br />
					Prove</a>さんのLABで公開されてるプラグイン <a href="http://www.prove-wsc.com/lab.html">ConvertKana</a>が便利です。</p>
					<blockquote><p>Mac用Web制作ソフト「<a href="http://www.panic.com/jp/coda/">Coda</a>」のプラグイン。<br />
					選択された文字列を指定文字列に変換します。<br />
					英数字、カタカナ、数字、英文字の全角、半角を相互に変換します。</p>
					<p><cite>via: <a href="http://www.prove-wsc.com/lab.html">http://www.prove-wsc.com/lab.html</a></cite></p></blockquote>
					<p>Codaはそれなりに強力な検索・置換エンジンを持っているので<br />
					正規表現でも検索・置換もできますが、ConvertKanaを使えばあっという間に変換できます。</p>
					<p>Codaは一度使うと手放せないくらい使い心地がいいんですけど<br />
					まだまだCodaのマニュアルとか記事が少ないですね。。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/convertkana/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>これまでに使った20のjQueryプラグイン</title>
		<link>http://5509.me/log/jqueryplugins-i-have-used</link>
		<comments>http://5509.me/log/jqueryplugins-i-have-used#comments</comments>
		<pubDate>Tue, 07 Jul 2009 04:35:23 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[まとめ]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1545</guid>
		<description><![CDATA[					delicious(nori_17/tagged:jquery)から実際に使ったものをメモ。
					順番はたぶん登録が古い順なはず。たまに自作がまじってます。自作のは5509って振ってます。
					de [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://delicious.com/nori_17/jquery">delicious(nori_17/tagged:jquery)</a>から実際に使ったものをメモ。<br />
					順番はたぶん登録が古い順なはず。たまに自作がまじってます。自作のは5509って振ってます。<br />
					deliciousからのみ抜き出したので使ったけど入ってないのがたくさんありそう。20なはずがない…</p>
					<p><span id="more-1545"></span></p>
					<h3><strong>Galleria</strong></h3>
					<p><a href="http://devkick.com/lab/galleria/"><img class="alignnone size-full wp-image-1560" title="Galleria" src="http://5509.me/wp-content/uploads/2009/07/m-l-ga.jpg" alt="m-l-ga" width="300" height="129" /></a><br />
					<a href="http://devkick.com/lab/galleria/">http://devkick.com/lab/galleria/</a><br />
					画像ギャラリープラグイン。これはきれいですよね。でもちょっと重い。</p>
					<h3><strong>FancyBox</strong></h3>
					<p><a href="http://fancy.klade.lv/"><img class="alignnone size-full wp-image-1559" title="FancyBox" src="http://5509.me/wp-content/uploads/2009/07/m-l-fan.jpg" alt="FancyBox" width="300" height="129" /></a><br />
					<a href="http://fancy.klade.lv/">http://fancy.klade.lv/</a><br />
					確か商用でも使えるhighslideみたいなのを探してた気がする。</p>
					<h3><strong>tablesorter</strong></h3>
					<p><a href="http://tablesorter.com/docs/"><img class="alignnone size-full wp-image-1567" title="tablesorter" src="http://5509.me/wp-content/uploads/2009/07/m-l-tabsrt.jpg" alt="tablesorter" width="300" height="129" /></a><br />
					<a href="http://tablesorter.com/docs/">http://tablesorter.com/docs/</a><br />
					シンプルにデータ並び替え。管理画面には欠かせないですね。</p>
					<h3><strong>prettyPhoto</strong></h3>
					<p><a href="http://www.no-margin-for-errors.com/projects/prettyPhoto-jquery-lightbox-clone/"><img class="alignnone size-full wp-image-1563" title="PrettyPhoto" src="http://5509.me/wp-content/uploads/2009/07/m-l-prepho.jpg" alt="PrettyPhoto" width="300" height="129" /></a><br />
					<a href="http://www.no-margin-for-errors.com/projects/prettyPhoto-jquery-lightbox-clone/">http://www.no-margin-for-errors.com/projects/prettyPhoto-jquery-lightbox-clone/</a><br />
					角丸がかわいいLightboxクローン。</p>
					<h3><strong>AjaxZip2</strong></h3>
					<p><a href="http://www.kawa.net/works/ajax/ajaxzip2/ajaxzip2.html"><img class="alignnone size-full wp-image-1561" title="AjaxZip2" src="http://5509.me/wp-content/uploads/2009/07/ml-l-2zip.jpg" alt="Ajax2Zip" width="300" height="129" /></a><br />
					<a href="http://www.kawa.net/works/ajax/ajaxzip2/ajaxzip2.html">http://www.kawa.net/works/ajax/ajaxzip2/ajaxzip2.html</a><br />
					これはもう本当に便利ですよね。</p>
					<h3><strong>ColorPicker</strong></h3>
					<p><a href="http://eyecon.ro/colorpicker/"><img class="alignnone size-full wp-image-1555" title="ColorPicker" src="http://5509.me/wp-content/uploads/2009/07/m-l-color.jpg" alt="ColorPicker" width="300" height="129" /></a><br />
					<a href="http://eyecon.ro/colorpicker/">http://eyecon.ro/colorpicker/</a><br />
					管理画面に使いました。クオリティが素晴らしいです。</p>
					<h3><strong>Masked Input</strong></h3>
					<p><a href="http://digitalbush.com/projects/masked-input-plugin/"><img class="alignnone size-full wp-image-1562" title="Masked Input" src="http://5509.me/wp-content/uploads/2009/07/m-l-mask.jpg" alt="Masked Input" width="300" height="129" /></a><br />
					<a href="http://digitalbush.com/projects/masked-input-plugin/">http://digitalbush.com/projects/masked-input-plugin/</a><br />
					入力文字の制御。こういう処理はユーザーに気にさせず行うのがベストですね。</p>
					<h3><strong>[</strong><strong>5509</strong><strong>] jQuery.validation.js</strong></h3>
					<p><a href="http://5509.me/2008/08/22/realtimeformvalidation.html"><img class="alignnone size-full wp-image-1551" title="jQuery.validation.js" src="http://5509.me/wp-content/uploads/2009/07/m-l-vali.jpg" alt="jQuery.validation.js" width="300" height="129" /></a><br />
					<a href="http://5509.me/2008/08/22/realtimeformvalidation.html">http://5509.me/2008/08/22/realtimeformvalidation.html</a><br />
					フォームバリデーション。割と高機能らしいです。</p>
					<h3><strong>Anti-aliased Rounded corners</strong></h3>
					<p><a href="http://blue-anvil.com/archives/anti-aliased-rounded-corners-with-jquery"><img class="alignnone size-full wp-image-1556" title="Anti-aliased Rounded corners" src="http://5509.me/wp-content/uploads/2009/07/m-l-cor2.jpg" alt="Anti-aliased Rounded corners" width="300" height="129" /></a><br />
					<a href="http://blue-anvil.com/archives/anti-aliased-rounded-corners-with-jquery">http://blue-anvil.com/archives/anti-aliased-rounded-corners-with-jquery</a><br />
					アンチエイリアス付きでしかも軽量角丸プラグイン。</p>
					<h3><strong>jFeed</strong></h3>
					<p><a href="http://www.hovinne.com/blog/index.php/2007/07/15/132-jfeed-jquery-rss-atom-feed-parser-plugin">http://www.hovinne.com/blog/index.php/2007/07/15/132-jfeed-jquery-rss-atom-feed-parser-plugin</a><br />
					今なら自分で書きますね。</p>
					<h3><strong>jCarousel</strong></h3>
					<p><a href="http://sorgalla.com/jcarousel/"><img class="alignnone size-full wp-image-1554" title="jCarousel" src="http://5509.me/wp-content/uploads/2009/07/m-l-carou.jpg" alt="jCarousel" width="300" height="129" /></a><br />
					<a href="http://sorgalla.com/jcarousel/">http://sorgalla.com/jcarousel/</a><br />
					色々なところで使ったような気がする。</p>
					<h3><strong>[</strong><strong>5509</strong><strong>] jQuery.selectable.js</strong></h3>
					<p><a href="http://5509.me/2008/09/14/jqueryselectable.html"><img class="alignnone size-full wp-image-1565" title="jQuery.selectable.js" src="http://5509.me/wp-content/uploads/2009/07/m-l-sele.jpg" alt="jQuery.selectable.js" width="300" height="129" /></a><br />
					<a href="http://5509.me/2008/09/14/jqueryselectable.html"> http://5509.me/2008/09/14/jqueryselectable.html</a><br />
					セレクトボックスを拡張する。これは見やすいですね！</p>
					<h3><strong>Using Progressive Enhancement to Convert a Select&#8230;<br />
					</strong></h3>
					<p><a href="http://www.filamentgroup.com/lab/progressive_enhancement_convert_select_box_to_accessible_jquery_ui_slider/"><img class="alignnone size-full wp-image-1566" title="Using Progressive Enhancement to Convert a Select Box Into an Accessible jQuery UI Slider" src="http://5509.me/wp-content/uploads/2009/07/m-l-slid.jpg" alt="Using Progressive Enhancement to Convert a Select Box Into an Accessible jQuery UI Slider" width="300" height="129" /></a><br />
					<a href="http://www.filamentgroup.com/lab/progressive_enhancement_convert_select_box_to_accessible_jquery_ui_slider/">http://www.filamentgroup.com/lab/progressive_enhancement_convert_select_box_to_accessible_jquery_ui_slider/</a><br />
					セレクトボックスをスライダーに置き換え。タイトルもURLもとても長いですが、これは便利です。<br />
					(Using Progressive Enhancement to Convert a Select Box Into an Accessible jQuery UI Slider)</p>
					<h3><strong>seekAttention</strong></h3>
					<p><a href="http://enhance.qd-creative.co.uk/demo/seekAttention/"><img class="alignnone size-full wp-image-1553" title="seekAttention" src="http://5509.me/wp-content/uploads/2009/07/m-l-atte.jpg" alt="seekAttention" width="300" height="129" /></a><br />
					<a href="http://enhance.qd-creative.co.uk/demo/seekAttention/">http://enhance.qd-creative.co.uk/demo/seekAttention/</a><br />
					指定した要素をハイライト。こういう配慮って大切ですよね。</p>
					<h3><strong>history plugin</strong></h3>
					<p><a href="http://www.mikage.to/jquery/jquery_history.html">http://www.mikage.to/jquery/jquery_history.html</a><br />
					Ajax遷移を記憶させる。</p>
					<h3><strong>jQuery Alert Dialogs</strong></h3>
					<p><a href="http://abeautifulsite.net/notebook/87"><img class="alignnone size-medium wp-image-1552" title="jQuery Alert Dialogs" src="http://5509.me/wp-content/uploads/2009/07/m-l-alert.jpg" alt="m-l-alert" width="300" height="129" /></a><br />
					<a href="http://abeautifulsite.net/notebook/87">http://abeautifulsite.net/notebook/87</a><br />
					色々できるアラートダイアログ。</p>
					<h3><strong>jQuery pageSlide</strong></h3>
					<p><a href="http://srobbin.com/blog/jquery-pageslide/"><img class="alignnone size-full wp-image-1564" title="jQuery Pageslide" src="http://5509.me/wp-content/uploads/2009/07/m-l-pslilde.jpg" alt="jQuery Pageslide" width="300" height="129" /></a><br />
					<a href="http://srobbin.com/blog/jquery-pageslide/">http://srobbin.com/blog/jquery-pageslide/</a><br />
					横から出てくるやつです。発想がいいですね！</p>
					<h3><strong>Scroll Follow</strong></h3>
					<p><a href="http://kitchen.net-perspective.com/open-source/scroll-follow/">http://kitchen.net-perspective.com/open-source/scroll-follow/</a><br />
					wrapscrollみたいなやつですね。easingを使えば鬱陶しさがなくなりますよ！</p>
					<h3><strong>Uploadify</strong></h3>
					<p><a href="http://www.uploadify.com/"><img class="alignnone size-full wp-image-1568" title="Uploadify" src="http://5509.me/wp-content/uploads/2009/07/m-l-upl.jpg" alt="m-l-upl" width="300" height="129" /></a><br />
					<a href="http://www.uploadify.com/">http://www.uploadify.com/</a><br />
					複数アップロードに対応したアップローダー。UIもとてもわかりやすいです。</p>
					<h3><strong>[5509] easingScroll</strong></h3>
					<p><a href="http://5509.me/2009/05/18/page-scrolling-with-jqueryeasing.html"><img class="alignnone size-full wp-image-1558" title="easingScroll" src="http://5509.me/wp-content/uploads/2009/07/m-l-eas.jpg" alt="easingScroll" width="300" height="129" /></a><br />
					<a href="http://5509.me/2009/05/18/page-scrolling-with-jqueryeasing.html">http</a><a href="http://5509.me/2009/05/18/page-scrolling-with-jqueryeasing.html">://5509.me/2009/05/18/page-scrolling-with-jqueryeasing.html</a><br />
					ページスクロールをeasingで。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/jqueryplugins-i-have-used/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Thickboxをドラッグ可能にしてユーザビリティを向上させる</title>
		<link>http://5509.me/log/make-thickbox-draggable</link>
		<comments>http://5509.me/log/make-thickbox-draggable#comments</comments>
		<pubDate>Mon, 06 Jul 2009 04:10:56 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[ユーザビリティ]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1526</guid>
		<description><![CDATA[					
					ThickboxとかLightboxでコンテンツや写真を表示するとすっきり見えていいですよね。
					でもあのボックス自体が邪魔なときないですか？ちょうど比較したいコンテンツの上に表示されたり… [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://5509.me/sample/draggable-thickbox"><img class="alignnone size-full wp-image-1535" title="draggablethickbox" src="http://5509.me/wp-content/uploads/2009/07/draggablethickbox.gif" alt="draggablethickbox" width="450" height="194" /></a></p>
					<p><a href="http://jquery.com/demo/thickbox/">Thickbox</a>とかLightboxでコンテンツや写真を表示するとすっきり見えていいですよね。<br />
					でもあのボックス自体が邪魔なときないですか？ちょうど比較したいコンテンツの上に表示されたり…<a href="http://docs.jquery.com/UI/API/1.7.1/Draggable"><br />
					jQuery UI Draggable</a>を使ってドラッグできるようにしてしまいましょう。</p>
					<p>これだけのためにわざわざDraggableを…とかそういうのは抜きにしてドラッグできると結構便利です。<br />
					しかもUI Draggableを使えばあっという間にドラッグできるようになります。</p>
					<p>…便利じゃないですか？(今回はThickboxを対象にしてます)</p>
					<p><a href="http://5509.me/sample/draggable-thickbox">サンプル</a><br />
					<a href="http://5509.me/sample/archive/draggable-thickbox.zip">サンプルファイルのダウンロード</a></p>
					<p><span id="more-1526"></span></p>
					<h2>Thickboxをダウンロードする</h2>
					<p><a href="http://jquery.com/demo/thickbox/">http://jquery.com/demo/thickbox/</a></p>
					<p>から一式をダウンロードするか、<a href="http://5509.me/sample/archive/draggable-thickbox.zip">サンプルファイルに全て入ってるのでそれをダウンロード</a>します。</p>
					<h2>jQuery UI Draggableをダウンロードする</h2>
					<p><a href="http://jqueryui.com/download">http://jqueryui.com/download</a></p>
					<p>からUI CoreとDraggableを選択してダウンロードするか、<a href="http://5509.me/sample/archive/draggable-thickbox.zip">サンプルファイルに全て入ってるのでそれをダウンロード</a>します。</p>
					<h2>必要なファイルを読み込む</h2>
					<pre>&lt;link type="text/css" rel="stylesheet" href="css/thickbox.css" /&gt;
&lt;script type="text/javascript" src="js/lib/jquery.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/lib/jquery.ui.draggable.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/lib/thickbox.js"&gt;&lt;/script&gt;</pre>
					<h2>thickbox.jsにソースを追加する</h2>
					<p>thickbox.jsの19～35行目</p>
					<pre>//add thickbox to href &amp; area elements that have a class of .thickbox
function tb_init(domChunk){
    $(domChunk).click(function(){
    var t = this.title || this.name || null;
    var a = this.href || this.alt;
    var g = this.rel || false;
    tb_show(t,a,g);
    this.blur();
    return false;
    });
}</pre>
					<p>の tb_show(t,a,g); の後辺りに</p>
					<pre>// Make TB Draggable
$('#TB_window').draggable({
	handle: '#TB_title'
});</pre>
					<p>を追加するだけです。<br />
					オプションのhandleでドラッグのハンドル(掴める要素)を決めてます。サンプルでは#TB_titleにしていますが、たとえばハンドル指定をなくすと、#TB_window自体がハンドルになってどこを掴んでもドラッグできるようになります。スクロールバーを動かすときにちょっと不便になるので、ここでは#TB_titleをハンドルに指定しています。ハンドル指定ができる要素はdraggableにする要素の子要素なら何でも、です。</p>
					<p>追加したソースは以下になります。</p>
					<pre>//add thickbox to href &amp; area elements that have a class of .thickbox
function tb_init(domChunk){
    $(domChunk).click(function(){
    var t = this.title || this.name || null;
    var a = this.href || this.alt;
    var g = this.rel || false;
    tb_show(t,a,g);

    // Make TB Draggable
    $('#TB_window').draggable({
        handle: '#TB_title'
    });

    this.blur();
    return false;
    });
}</pre>
					<p>あとはドラッグできることがわかるように、ハンドルのカーソルを変えましょう。</p>
					<h2>thickbox.cssにソースを追加する</h2>
					<p>thickbox.cssの103～106行目に#TB_titleがあるので<br />
					これにcursor: move; を追加します。</p>
					<pre>#TB_title{
    background-color:#e8e8e8;
    height:27px;
    cursor: move;
}</pre>
					<p>ちなみに今回の例では、AjaxコンテンツかInlineコンテンツのようにタイトルを含んだThickboxを対象にしています。タイトルを含まない場合は、draggableオプションのhandle指定をなくすとかハンドル自体を変えればいいです。</p>
					<p><a href="http://5509.me/sample/draggable-thickbox">サンプル</a><br />
					<a href="http://5509.me/sample/archive/draggable-thickbox.zip">サンプルファイルのダウンロード</a></p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/make-thickbox-draggable/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>データを扱うテーブルなどにインクリメンタルサーチをjQueryを利用して実装する</title>
		<link>http://5509.me/log/incremental-search-with-jquery</link>
		<comments>http://5509.me/log/incremental-search-with-jquery#comments</comments>
		<pubDate>Fri, 03 Jul 2009 02:26:46 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[tuts]]></category>
		<category><![CDATA[ユーザビリティ]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1494</guid>
		<description><![CDATA[					
					返ってくる結果が膨大になりがちな検索結果(特に管理画面など)などでは、そこからさらにデータを絞り込みを行いたい場合もあるかと思います。毎回ページの遷移があったのではユーザーの負担になりがちです。
	 [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://5509.me/sample/incrementalsearch"><img class="alignnone size-full wp-image-1517" title="インクリメンタルサーチ" src="http://5509.me/wp-content/uploads/2009/07/e38394e382afe38381e383a3-3.png" alt="インクリメンタルサーチ" width="396" height="203" /></a></p>
					<p>返ってくる結果が膨大になりがちな検索結果(特に管理画面など)などでは、そこからさらにデータを絞り込みを行いたい場合もあるかと思います。毎回ページの遷移があったのではユーザーの負担になりがちです。</p>
					<p>そこでjQueryを利用してインクリメンタルサーチを実装する方法をメモもかねて紹介します。</p>
					<p><a href="http://5509.me/sample/incrementalsearch">サンプル<br />
					</a><a href="http://5509.me/sample/archive/incrementalsearch.zip">サンプルファイルのダウンロード</a><a href="/sample/incrementalsearch"></a></p>
					<p><span id="more-1494"></span></p>
					<h2>テーブルのデータでインクリメンタルサーチを行う</h2>
					<h3>考え方</h3>
					<p>今回は「A B C D &#8230;.」のように単語を半スペースで区切ることを前提に考えます。</p>
					<p>考え方は簡単で、</p>
					<ol>
					<li>半スペースで区切られた単語を配列(value=[])に保存する。</li>
					<li>まず最初の単語(value[0])が含まれているTDをmatchで検索する。</li>
					<li>含んでいない場合は親のTRを非表示にする。</li>
					<li>さらに2つ目以降の単語(value[1〜x])が存在すれば<br />
					value[1]からvalue[x]までを順番にmatchで検索する。</li>
					<li>含んでいないTDの親TRを非表示にする。</li>
					</ol>
					<p>で実装できます。</p>
					<h3>スクリプト</h3>
					<p>上の項目をスクリプトで記述すると以下のようになります。<br />
					対象にする項目、テキストを変えればテーブル以外でも使えるので試してみてください。</p>
					<pre id="line1">var tr = $('tr','#item_table'); // TRを保存する

// 単語が入力される度に評価する
$('#incrementalSearch').keyup(function(){

	// 1. 入力された単語を配列に保存する
	var value = this.value.split(" ");

	// 全てのTRで処理を行う
	for(var i=0;i&lt;tr.length;i++){

		// 対象にするTDのテキストを一時保存
		var itemName = $('td:nth-child(3)',tr[i]).text();

		// 2. テキストが最初の単語(value[0])を含んでいるかどうか
		// RegExpの第二引数iはアルファベットの大文字小文字を区別しない
		if(itemName.match(new RegExp(value[0]),'i')){

			// 表示しておく(前回の検索結果で非表示の場合もあるので)
			$(tr[i]).show();

			// 4. さらに単語が2つ以上入力されている場合
			if(value.length&gt;1){

				// 4. 2つ目以降の単語が含まれていなければ順番に非表示にしていく
				for(var j=1;j&lt;value.length;j++){
					// 5. マッチングで検索してfalseなら非表示
					if(!itemName.match(new RegExp(value[j]),'i')){
						$(tr[i]).hide();
					}
				}
			}
		// 3. 含んでいない場合は非表示にする
		}else{
			$(tr[i]).hide();
		}
	}
});</pre>
					<p><a href="/sample/incrementalsearch">サンプル<br />
					</a><a href="/sample/archive/incrementalsearch.zip">サンプルファイルのダウンロード</a><a href="/sample/incrementalsearch"><br />
					</a></p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/incremental-search-with-jquery/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>パスワード入力欄の最後の文字列をヒントとして表示するjQueryプラグイン</title>
		<link>http://5509.me/log/hintmask</link>
		<comments>http://5509.me/log/hintmask#comments</comments>
		<pubDate>Wed, 01 Jul 2009 23:50:10 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[プラグイン]]></category>
		<category><![CDATA[ユーザビリティ]]></category>

		<guid isPermaLink="false">http://moto-mono.net/2009/07/02/hintmaskjs.html</guid>
		<description><![CDATA[					
					IT Mediaの記事でパスワードの「****」は不要…という記事(以下参照)がありましたが、ブコメにiPhone UIが〜〜というのがあったので、じゃあということでついカッとなってjQueryプラ [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://5509.me/sample/editableselect"></a><a href="http://5509.me/sample/hintmask"><img class="alignnone size-full wp-image-1480" title="hintmask" src="http://5509.me/wp-content/uploads/2009/07/e38394e382afe38381e383a3-1.png" alt="hintmask" width="177" height="83" /></a></p>
					<p>IT Mediaの記事でパスワードの「****」は不要…という記事(以下参照)がありましたが、<a href="http://b.hatena.ne.jp/entry/http://www.itmedia.co.jp/news/articles/0907/01/news033.html">ブコメにiPhone UIが〜〜</a>というのがあったので、じゃあということでついカッとなってjQueryプラグインを書いた。</p>
					<blockquote><p>Webサイトなどでパスワードを入力する際、「****」を使って入力した文字が見えないようにする必要はないのではないか——。そんな提案をめぐり、研究者が賛否両論を展開している。</p>
					<p><cite>via: <a href="http://www.itmedia.co.jp/enterprise/articles/0907/01/news033.html">パスワード入力の「****」は不要？　研究者の間で激しい論議</a></cite></p></blockquote>
					<p>パスワード入力は僕もよくタイプミスをして全部打ち直します。どうにかしてください本当に。<br />
					それにしてもiPhoneのUIはとてもよくできてますね。使っていて本当に気持ちがいいです。<br />
					使っていて気持ちがいいサイト設計というのは簡単なようでとても難しいものなので、小さなことからでもユーザーの負担を減らしていければいいですね。</p>
					<p><a href="http://5509.me/sample/hintmask">サンプル</a><br />
					<a href="http://5509.me/sample/archive/hintmask.zip">サンプルファイルのダウンロード</a></p>
					<p><span id="more-1479"></span></p>
					<h2>導入方法</h2>
					<h3>1.<a href="http://5509.me/sample/hintmask/css/hintmask.css">CSS</a>、 jQueryと<a href="http://5509.me/sample/hintmask/js/hintmask.js">hintmask.js</a>を読み込む。</h3>
					<pre name="code" class="html">

&lt;link type=&quot;text/css&quot; rel=&quot;stylesheet&quot; href=&quot;css/hintmask.css&quot; /&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/hintmask.js&quot;&gt;&lt;/script&gt;
</pre>
					<h3>2. パスワード入力欄を用意する。</h3>
					<p>CLASSはなんでもいいです。あとで実行するときに指定するためのものなので、IDでも大丈夫です。</p>
					<pre name="code" class="html">

&lt;input type=&quot;password&quot; id=&quot;&quot; name=&quot;&quot; class=&quot;hintmask&quot; /&gt;
</pre>
					<h3>3. 実行する</h3>
					<p>$()で対象にする要素を指定します。</p>
					<pre name="code" class="js">

$(function(){
&nbsp;&nbsp;$(&#039;.hintmask&#039;).hintmask();
});
</pre>
					<h2>オプション</h2>
					<p>オプションでマスクの文字、ヒント位置の調整を指定できます。</p>
					<pre name="code" class="js">

$(function(){
&nbsp;&nbsp;$(&#039;.hintmask&#039;).hintmask({
&nbsp;&nbsp;&nbsp;&nbsp;mask: &#039;*&#039;,
&nbsp;&nbsp;&nbsp;&nbsp;top: 5,
&nbsp;&nbsp;&nbsp;&nbsp;left: 0
&nbsp;&nbsp;});
});
</pre>
					<p>本当にどうでもいいことですが mask の値を ＼(^O^)／ とかにするととてもうざくなるので注意が必要です。</p>
					<p>カッとなった勢いで<a href="http://5509.me/sample/hintmask/sample2.html">うざすぎるサンプル</a>も用意しました。</p>
					<p><a href="http://5509.me/sample/hintmask">サンプル</a><br />
					<a href="http://5509.me/sample/archive/hintmask.zip">サンプルファイルのダウンロード</a></p>
					<p><a href="http://5509.me/sample/archive/editableselect.zip"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/hintmask/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>セレクトボックスに新しいオプションを追加していけるスクリプト</title>
		<link>http://5509.me/log/editableselect</link>
		<comments>http://5509.me/log/editableselect#comments</comments>
		<pubDate>Wed, 17 Jun 2009 22:00:28 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[フォーム]]></category>
		<category><![CDATA[ユーザビリティ]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1452</guid>
		<description><![CDATA[					
					セレクトボックスの(value)を選択すると、セレクトボックスが消えて代わりにINPUT要素が選択状態で表示されるので、追加する単語を入力してドキュメント上の適当な箇所をクリックするか、return [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://5509.me/sample/editableselect"><a href="http://5509.me/sample/editableselect"><img class="alignnone size-full wp-image-1475" title="セレクトボックスに新しいオプションを追加していけるスクリプト" src="http://5509.me/wp-content/uploads/2009/06/editableselect1.gif" alt="セレクトボックスに新しいオプションを追加していけるスクリプト" width="450" height="190" /></a></a></p>
					<p>セレクトボックスの(value)を選択すると、セレクトボックスが消えて代わりにINPUT要素が選択状態で表示されるので、追加する単語を入力してドキュメント上の適当な箇所をクリックするか、returnキーで決定することで入力項目をセレクトボックスに新しく追加できるスクリプトです。説明がなにやらややこしい感じなので、実際に<a href="http://5509.me/sample/editableselect">サンプル</a>を見てもらったほうが早いと思います。</p>
					<p>先日のtangoHokanと同じような感じなので、使いどころは微妙ですが。<br />
					そもそも、それができる、ということを補足説明などでユーザに伝える必要があると思いますが、ひとつの選択肢としてあればそのうち使う日がくるかもしれません。。</p>
					<p><a href="http://5509.me/sample/editableselect">サンプル</a><br />
					<a href="http://5509.me/sample/archive/editableselect.zip">サンプルファイルのダウンロード</a></p>
					<p><span id="more-1452"></span></p>
					<h2>導入</h2>
					<h3>1. jQueryと<a href="http://5509.me/sample/editableselect/js/editableselect.js">editableselect</a>を読み込む。</h3>
					<pre name="code" class="html">

&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/editableselect.js&quot;&gt;&lt;/script&gt;
</pre>
					<h3>2. SELECT要素にIDを用意しておく。</h3>
					<pre name="code" class="html">

&lt;select id=&quot;select1&quot; name=&quot;select1&quot;&gt;
&nbsp;&nbsp;&lt;option value=&quot;1&quot;&gt;1&lt;/option&gt;
&nbsp;&nbsp;&lt;option value=&quot;2&quot;&gt;2&lt;/option&gt;
&nbsp;&nbsp;&lt;option value=&quot;3&quot;&gt;3&lt;/option&gt;
&nbsp;&nbsp;&lt;option value=&quot;4&quot;&gt;4&lt;/option&gt;
&nbsp;&nbsp;&lt;option value=&quot;5&quot;&gt;5&lt;/option&gt;
&lt;/select&gt;
</pre>
					<h3>3. 実行する</h3>
					<pre name="code" class="js">

$(function(){
&nbsp;&nbsp;$(&#039;select&#039;).editableSelect();
});
</pre>
					<h2>オプション追加のテキストを変える</h2>
					<p>editableSelectのvalueプロパティから変更することができます。</p>
					<pre name="code" class="js">

$(function(){
&nbsp;&nbsp;$(&#039;select&#039;).editableSelect({
&nbsp;&nbsp;&nbsp;&nbsp;value: &#039;ここをクリックするとテキストを編集できます&#039;
&nbsp;&nbsp;});
});
</pre>
					<p><a href="http://5509.me/sample/editableselect">サンプル</a><br />
					<a href="http://5509.me/sample/archive/editableselect.zip">サンプルファイルのダウンロード</a></p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/editableselect/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPressの複数アップロード機能が便利すぎる件</title>
		<link>http://5509.me/log/wordpress-multiple-upload</link>
		<comments>http://5509.me/log/wordpress-multiple-upload#comments</comments>
		<pubDate>Sun, 14 Jun 2009 09:13:09 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[WebDev]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[memo]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1424</guid>
		<description><![CDATA[					Skypeで話をしてて、WordPressの複数アップロードが便利すぎるって言うのを聞いたのですが、、、
					そうなんです。この複数アップロード機能がかなり強力で、いくつまで同時にアップロードできるのかは [...]]]></description>
			<content:encoded><![CDATA[					<p>Skypeで話をしてて、<strong>WordPressの複数アップロードが便利すぎる</strong>って言うのを聞いたのですが、、、</p>
					<p>そうなんです。この複数アップロード機能がかなり強力で、いくつまで同時にアップロードできるのかはちょっと試していませんが、20くらいはいけたはずです。確かバージョン2.5のFlash Uploaderから実装されてるんですけど、どうやら知らない人も多いのかも？と思ったので、紹介しておきます。</p>
					<p>と思ってたらちょうどいい動画がありました。動画は2.5のものですが、それ以降のバージョンでも同じ方法です。もちろん最新の2.8でも使えます。フォトログなどやってる人にはかなり便利だと思いますのでぜひ。</p>
					<p><object width="400" height="225" data="http://vimeo.com/moogaloop.swf?clip_id=857821&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=857821&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /></object></p>
					<p><a href="http://vimeo.com/857821">Multiple Image Upload</a> from <a href="http://vimeo.com/user425593">Len Kutchma</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/wordpress-multiple-upload/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[メモ]ワクワクマウスオーバー</title>
		<link>http://5509.me/log/wakuwakumouseover</link>
		<comments>http://5509.me/log/wakuwakumouseover#comments</comments>
		<pubDate>Thu, 11 Jun 2009 04:48:00 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[memo]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1411</guid>
		<description><![CDATA[					
					ワクワクマウスオーバー
					ウィンドウ内に散りばめた●にマウスオーバーするとびよんと拡大します(PNG使ってるのでIE6は見れません）。でかい丸に囲まれたかわいそうなちび丸を拡大できたときの気 [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://5509.me/sample/wakuwakumouseover/"><img class="alignnone size-full wp-image-1412" title="wakuwaku" src="http://5509.me/wp-content/uploads/2009/06/wakuwaku.gif" alt="wakuwaku" width="450" /></a></p>
					<p><a href="http://5509.me/sample/wakuwakumouseover/">ワクワクマウスオーバー</a></p>
					<p>ウィンドウ内に散りばめた●にマウスオーバーするとびよんと拡大します(PNG使ってるのでIE6は見れません）。でかい丸に囲まれたかわいそうなちび丸を拡大できたときの気持ちよさは…。一応言っておきますけど、Flashじゃないです。あと、別にタイトルなんかどうでもよくて、なにかできそうな感じなので自分用のメモです。周りではワクワクよりもムキムキが流行ってるみたいですね！</p>
					<p><span id="more-1411"></span></p>
					<p>サンプルは画像使ってますけど、Canvasでやったらもっと自由にできそう。<br />
					やっぱりeasing便利おもしろい！</p>
					<pre name="code" class="js">

$(function(){

&nbsp;&nbsp;// ブラウザのレンダリング部分の幅と高さを得る
&nbsp;&nbsp;var d = document,
&nbsp;&nbsp;&nbsp;&nbsp;client = {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;height: d.documentElement.clientHeight,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width: d.documentElement.clientWidth
&nbsp;&nbsp;&nbsp;&nbsp;};

&nbsp;&nbsp;// 円を配置していく とりあえず150個
&nbsp;&nbsp;for(var i=0;i&lt;150;i++){
&nbsp;&nbsp;&nbsp;&nbsp;var nImg = document.createElement(&quot;img&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;// wakuwaku0.png か wakuwaku1.png
&nbsp;&nbsp;&nbsp;&nbsp;nImg.src = &quot;img/wakuwaku&quot;+Math.round(Math.random(1))+&quot;.png&quot;;
&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;body&quot;).append(nImg);

&nbsp;&nbsp;}

&nbsp;&nbsp;$(&quot;img&quot;).each(function(){

&nbsp;&nbsp;&nbsp;&nbsp;// それぞれの画像のサイズをランダムで決める 0 ～ 100 の間
&nbsp;&nbsp;&nbsp;&nbsp;var size = Math.random()*100;
&nbsp;&nbsp;&nbsp;&nbsp;// 最大サイズ ここは画像のサイズに準拠しておく
&nbsp;&nbsp;&nbsp;&nbsp;var maxSize = 256;
&nbsp;&nbsp;&nbsp;&nbsp;// 画像に対して(0,0)で拡大するので
&nbsp;&nbsp;&nbsp;&nbsp;// 中央から広がるように(-mPos,-mPos)にずらすための値
&nbsp;&nbsp;&nbsp;&nbsp;var mPos = (maxSize-size)/2;
&nbsp;&nbsp;&nbsp;&nbsp;var self = $(this);

&nbsp;&nbsp;&nbsp;&nbsp;// サイズと位置を取得済みの乱数で配置
&nbsp;&nbsp;&nbsp;&nbsp;self.css({
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;position: &quot;absolute&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;top: Math.random()*client.height,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;left: Math.random()*client.width,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width: size,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;height: size
&nbsp;&nbsp;&nbsp;&nbsp;});

&nbsp;&nbsp;&nbsp;&nbsp;// ホバー
&nbsp;&nbsp;&nbsp;&nbsp;self.hover(function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// マウスオーバーで最前面にする
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.css(&quot;zIndex&quot;,100).animate(
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// 中央から広がるように(-mPos,-mPos)にずらす
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;marginTop: &quot;-&quot;+mPos,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;marginLeft: &quot;-&quot;+mPos,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width: maxSize,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;height: maxSize
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;duration: 300,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// びよよん
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;easing: &quot;easeOutBounce&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Queueを保存しない
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;queue: false
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);
&nbsp;&nbsp;&nbsp;&nbsp;},function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// マウスアウトで戻す
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.css(&quot;zIndex&quot;,1).animate(
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;marginTop: 0,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;marginLeft: 0,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width: size,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;height: size
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;duration: 300,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;easing: &quot;easeOutBounce&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;queue: false
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);
&nbsp;&nbsp;&nbsp;&nbsp;});

&nbsp;&nbsp;});

});
</pre>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/wakuwakumouseover/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Safari独自実装のinput type=&#8221;search&#8221;のような検索窓を実装する</title>
		<link>http://5509.me/log/using-type-search</link>
		<comments>http://5509.me/log/using-type-search#comments</comments>
		<pubDate>Tue, 09 Jun 2009 19:04:34 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[tuts]]></category>
		<category><![CDATA[ユーザビリティ]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1392</guid>
		<description><![CDATA[					
					先日、iPhone風のテキストボックスの文字を消去するボタンを実装するチュートリアルを書いたのですが、どうやらSafariの独自実装でinput type=&#8221;search&#8221;と [...]]]></description>
			<content:encoded><![CDATA[					<p><img class="alignnone size-full wp-image-1393" title="inputSearch" src="http://5509.me/wp-content/uploads/2009/06/e38394e382afe38381e383a3-61.png" alt="inputSearch" width="172" height="35" /></p>
					<p>先日、<a class="first-child" title="iPhone風のテキストボックスの文字を消去するボタンを実装するチュートリアル" href="http://5509.me/2009/06/04/turorial-using-iphone-like-input-delete-button.html">iPhone風のテキストボックスの文字を消去するボタンを実装するチュートリアル</a>を書いたのですが、どうやら<a href="http://developer.apple.com/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/Attributes.html">Safariの独自実装でinput type=&#8221;search&#8221;</a>というのがあるんですね。全然知らなかった…じゃあいっそのことplaceholderも付けてinput type=&#8221;search&#8221;っぽくしてみようということで、delval.jsをちょちょっと変えてinput type=&#8221;search&#8221;ぽい検索窓を実装してみます。これもかなり簡単にできるので、じゃあチュートリアル…？？</p>
					<p><img class="alignnone size-full wp-image-1393" title="inputSearch" src="http://5509.me/wp-content/uploads/2009/06/e38394e382afe38381e383a3-61.png" alt="inputSearch" width="172" height="35" /><img class="alignnone size-full wp-image-1394" title="こっちはSafari独自実装のtype=&quot;search&quot;" src="http://5509.me/wp-content/uploads/2009/06/e38394e382afe38381e383a3-71.png" alt="こっちはSafari独自実装のtype=&quot;search&quot;" width="172" height="35" /><br />
					左が今回作ったサンプルで、右がSafari独自実装のinput type=&#8221;search&#8221;。そっくり！</p>
					<p><a href="http://5509.me/sample/inputsearch">サンプル</a> &#8211; サンプルの下にあるINPUTをSafariで見ると…！<br />
					<a href="http://5509.me/sample/archive/inputsearch.zip">サンプルファイルのダウンロード</a></p>
					<p><span id="more-1392"></span></p>
					<h2>delval.jsとの違いをふまえてHTMLをマークアップする</h2>
					<p>delval.jsとの違いは</p>
					<ul>
					<li>optionでplaceholderのテキスト変更できる</li>
					<li>placeholderを追加</li>
					<li>わかりやすいようにID、CLASSをdelvalからinputSearchにした</li>
					</ul>
					<p>です。見た目はCSSでうまいことやればきれいにいけますので、それを採用してます。また検索窓なので、必然的にFORM要素の中に入れる必要があると思います。これをふまえて検索窓をマークアップすると以下のようになります。</p>
					<pre name="code" class="html">

&lt;form&gt; ^&lt;fieldset&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;legend&gt;Site Search&lt;/legend&gt;
&nbsp;&nbsp;&nbsp;&nbsp;

&lt;input id=&quot;s&quot; name=&quot;s&quot; type=&quot;text&quot; /&gt; ^&lt;/fieldset&gt;
&lt;/form&gt;
</pre>
					<h2>delval.jsにplaceholder機能を追加する</h2>
					<p>次はJS部分ですが、主にdelval.jsと同じです。jQueryで拡張したfunctionに追記していきますので、前もってjQueryを読み込んでおいてください。(サンプルに入ってます）9割delval.jsと同じなのでかぶってるところは割愛しますが、大きく違うのはplaceholderがあるかないかということです。placeholderの機能は</p>
					<ul>
					<li>INPUTのVALUEが空ならテキストを表示</li>
					<li>INPUTにfocus()でplaceholderを消去</li>
					</ul>
					<p>くらいでしょうか。<br />
					変更点にはコメントを加えているのでdelval.jsと比較してみてください。</p>
					<pre name="code" class="js">

$.fn.inputSearch = function(options){

&nbsp;&nbsp;// placeholderのテキストを変えるオプション
&nbsp;&nbsp;var c = $.extend({
&nbsp;&nbsp;&nbsp;&nbsp;placeholder: &quot;search...&quot;
&nbsp;&nbsp;},options);

&nbsp;&nbsp;$(this).each(function(i){

&nbsp;&nbsp;&nbsp;&nbsp;var self = $(this);

&nbsp;&nbsp;&nbsp;&nbsp;self.wrap(&quot;&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;span#inputSearch-&quot;+i)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.append(&quot;&quot;)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// グループにplaceholderを追加しておく
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.append(&quot;&lt;span class=&quot;placeholder&quot;&gt;&quot;+c.placeholder+&quot;&lt;/span&gt;&quot;)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.addClass(&quot;inputSearch-group&quot;);

&nbsp;&nbsp;&nbsp;&nbsp;var group = $(&quot;span#inputSearch-&quot;+i).css(&quot;height&quot;,self.attr(&quot;offsetHeight&quot;)),
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;btn = $(&quot;span.inputSearch&quot;,group).css(&quot;height&quot;,group.height()),
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// あとで何回か使うので変数にしておく
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;placeholder = $(&quot;span.placeholder&quot;,&quot;#inputSearch-&quot;+i);

&nbsp;&nbsp;&nbsp;&nbsp;if(self.val().length&amp;lt;1){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;btn.hide();
&nbsp;&nbsp;&nbsp;&nbsp;}else{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// selfに文字列がある場合は隠す
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;placeholder.hide();
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;self.focus(function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// focus()で隠す
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;placeholder.hide();
&nbsp;&nbsp;&nbsp;&nbsp;}).blur(function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// blur()時に文字列がなければ表示する
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(self.val().length&amp;lt;1) placeholder.show();
&nbsp;&nbsp;&nbsp;&nbsp;});

&nbsp;&nbsp;&nbsp;&nbsp;// placeholderをクリックしたらselfにfocus()する
&nbsp;&nbsp;&nbsp;&nbsp;placeholder.click(function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.focus();
&nbsp;&nbsp;&nbsp;&nbsp;});

&nbsp;&nbsp;&nbsp;&nbsp;self.keyup(function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(self.val().length&amp;gt;0) btn.show();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else btn.hide();
&nbsp;&nbsp;&nbsp;&nbsp;});

&nbsp;&nbsp;&nbsp;&nbsp;btn.click(function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.val(&quot;&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;btn.hide();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.focus();
&nbsp;&nbsp;&nbsp;&nbsp;});

&nbsp;&nbsp;});
}
</pre>
					<p>placeholderの実装原理は結局のところdeleteボタンと同じで、INPUT要素に重ねて表示しておいてINPUTにfocus()だとかその辺のイベントが発生したときに隠す、ということです。</p>
					<h2>背景などをCSSで定義する</h2>
					<p>最後に今までの実装方法をふまえてCSSをさらっと書きます。というか、ほとんどdelval.jsのときと同じです。背景に画像をしいて、placeholderの位置を追加しただけです。簡単です。Safariが実装しているtype=&#8221;search&#8221;が高さ、幅の指定を実装していなかったのでこれも高さと幅は可変じゃないです。// 幅も高さも固定なのでフォントサイズもptで固定したほうがいいかもしれません。</p>
					<pre name="code" class="css">

/* form要素自体に背景を表示させる */
form {
&nbsp;&nbsp;width: 148px;
&nbsp;&nbsp;height: 19px;
&nbsp;&nbsp;background: url(../img/input_search.gif) no-repeat;
}

&nbsp;&nbsp;/* legendは不要なので非表示にする */
&nbsp;&nbsp;form legend {
&nbsp;&nbsp;&nbsp;&nbsp;display: none;
&nbsp;&nbsp;}

/* これはJSがオフの場合 */
&nbsp;&nbsp;form input {
&nbsp;&nbsp;&nbsp;&nbsp;margin-left: 23px;
&nbsp;&nbsp;&nbsp;&nbsp;border: none;
&nbsp;&nbsp;&nbsp;&nbsp;padding: .1em 0;
&nbsp;&nbsp;&nbsp;&nbsp;width: 125px;
&nbsp;&nbsp;&nbsp;&nbsp;background: none;
&nbsp;&nbsp;}

/* ここから下はdelval.jsのときと同じ */
&nbsp;&nbsp;form span.inputSearch-group {
&nbsp;&nbsp;&nbsp;&nbsp;position: relative;
&nbsp;&nbsp;&nbsp;&nbsp;display: inline-block;
&nbsp;&nbsp;&nbsp;&nbsp;*display: inline;
&nbsp;&nbsp;&nbsp;&nbsp;zoom: 1;
&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;form span.inputSearch-group input {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;padding-right: 25px;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width: 100px;
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;form span.inputSearch-group span.inputSearch {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width: 17px;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;position: absolute;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;right: 2px;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;top: 1px;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;background: url(../img/delval.gif) no-repeat left center;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cursor: pointer;
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;/* 新しくplaceholderのスタイルを追加 */
&nbsp;&nbsp;&nbsp;&nbsp;form span.inputSearch-group span.placeholder {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;position: absolute;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;top: 2px;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;left: 23px;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;color: #888;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font-size: 93%;
&nbsp;&nbsp;&nbsp;&nbsp;}
</pre>
					<h2>実行とオプション</h2>
					<p>あとは好きなところで実行してください。</p>
					<pre name="code" class="js">

$(function(){
&nbsp;&nbsp;$(&quot;input#s&quot;).inputSearch();
});
</pre>
					<p>以下のようにすればplaceholderのテキストを変更できます。</p>
					<pre name="code" class="js">

$(function(){
&nbsp;&nbsp;$(&quot;input#s&quot;).inputSearch(
&nbsp;&nbsp;&nbsp;&nbsp;placeholder: &quot;検索窓やでここは&quot;
&nbsp;&nbsp;);
});
</pre>
					<p>というわけで、とても簡単に実装できましたね。ここまで作って気がつきましたが、Safariのは検索履歴が見れるんですね。なるほどー。tangoHokan.jsを使えば同じようなことできるなーとも思いながら面倒になったのでやめておきます…</p>
					<p><a href="http://5509.me/sample/inputsearch">サンプル</a> &#8211; サンプルの下にあるINPUTをSafariで見ると…！<br />
					<a href="http://5509.me/sample/archive/inputsearch.zip">サンプルファイルのダウンロード</a></p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/using-type-search/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TITLE属性を利用した簡単ツールチップの作り方 jQuery編</title>
		<link>http://5509.me/log/how-to-make-tooltip-using-jquery</link>
		<comments>http://5509.me/log/how-to-make-tooltip-using-jquery#comments</comments>
		<pubDate>Sun, 07 Jun 2009 23:00:31 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[ユーザビリティ]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1368</guid>
		<description><![CDATA[					
					散々既出な気がするネタシリーズ。TITLE属性をツールチップで表示させるやつです。簡単なヘルプとか表示してあげるとユーザビリティを向上させることができる場合がありますよね。jQueryを使うととても [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://5509.me/sample/makingtooltip"><img class="alignnone size-full wp-image-1370" title="title属性を利用した簡単ツールチップの作り方 jQuery編" src="http://5509.me/wp-content/uploads/2009/06/e38394e382afe38381e383a3-7.png" alt="title属性を利用した簡単ツールチップの作り方 jQuery編" width="326" height="46" /></a></p>
					<p>散々既出な気がするネタシリーズ。TITLE属性をツールチップで表示させるやつです。簡単なヘルプとか表示してあげるとユーザビリティを向上させることができる場合がありますよね。jQueryを使うととても簡単につくれます。というよりも、使いたいときにさらっとコピってすぐ使えると思うので頭の片隅にでも置いておくと便利かもしれません。</p>
					<p class="link"><a href="http://5509.me/sample/makingtooltip/">Demo</a><br />
					<a href="http://5509.me/sample/archive/makingtooltip.zip">Download demo files</a></p>
					<p><span id="more-1368"></span></p>
					<p>ポイントは</p>
					<ul>
					<li>TITLE属性を持っている要素にイベントを設定する ( *1</li>
					<li>mouseover()でツールチップを生成する ( *2</li>
					<li>mouseout()でツールチップを消去する ( *3</li>
					<li>mousemove()でツールチップの位置を変える ( *4</li>
					</ul>
					<p>です。今回はmouseout()で消去するにしてますが、別にいちいち消さなくてもいいです。textを変えればいいだけですから。上の項目をJSソースにすると以下のような感じになります。細かくはコメントを参照してください。</p>
					<p class="note">追記: mouseover時にTITLEがブラウザデフォルトのチップで表示されるので、一時的にTITLE属性を空にしてみました。</p>
					<pre name="code" class="js">

jQuery(function($){

&nbsp;&nbsp;// 全要素をからTITLE属性を持っている要素だけに絞る - *1
&nbsp;&nbsp;$(&quot;body *&quot;).filter(function(){
&nbsp;&nbsp;&nbsp;&nbsp;return this.title ＆＆ this.title.length&gt;0; // ＆は半角に打ち直してください。。
&nbsp;&nbsp;}).each(function(){
&nbsp;&nbsp;// TITLE属性を持っている要素に適用する

&nbsp;&nbsp;&nbsp;&nbsp;// あとで使う
&nbsp;&nbsp;&nbsp;&nbsp;var self = $(this), title = self.attr(&quot;title&quot;);

&nbsp;&nbsp;&nbsp;&nbsp;// TITLE属性を持っている要素にhover()で
&nbsp;&nbsp;&nbsp;&nbsp;self.hover(

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// mouseover - *2
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function(e){ // このeはevent自体を意味する

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// TITLEがあるとブラウザのチップが出るので一時的に空にしておく
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.attr(&quot;title&quot;,&quot;&quot;);

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// とりあえず表示するtip要素を生成しておく
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;body&quot;).append(&quot;&lt;div id=&#039;title-tip&#039;&gt;&quot;+title+&quot;&lt;/div&gt;&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;#title-tip&quot;).css({
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;position: &quot;absolute&quot;,

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// e.pageX(Y)でカーソルが要素に乗った時点でのX(Y)座標を取得する
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;top: e.pageY+(-15), // カーソルと表示したtipが重なるとチラつくので少しずらす
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;left: e.pageX+15
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// mouseout
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function(){

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// mouseoverで空にしたTITLEを戻す
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.attr(&quot;title&quot;,title);

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// 要素から離れた場合はtipを非表示にして削除しておく - *3
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;#title-tip&quot;).hide().remove();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;);

&nbsp;&nbsp;&nbsp;&nbsp;// 要素上でカーソルが移動した場合は、逐一tipの位置を変える - *4
&nbsp;&nbsp;&nbsp;&nbsp;self.mousemove(function(e){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;#title-tip&quot;).css({
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;top: e.pageY+(-15),
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;left: e.pageX+15
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;});

});
</pre>
					<p>全要素から絞り込んでいく方法は要素の量によって処理に時間がかかるので、できれば$(&#8220;a&#8221;).filter(などのように対象要素を決めてしまったほうがいいです。これでツールチップの表示と移動はできたので後は、CSSで見た目を整えるだけです。例えばサンプルのツールチップは以下のようなスタイルで定義してます。-moz(-webkit)-border-radiusでFirefoxとSafariではツールチップを角丸にしてます。CSSは単純なので問題はないと思います。</p>
					<pre name="code" class="css">

div#title-tip {
&nbsp;&nbsp;margin: 0 1em 0 0;
&nbsp;&nbsp;border: solid #ccc 1px;
&nbsp;&nbsp;-moz-border-radius: 4px;
&nbsp;&nbsp;-webkit-border-radius: 4px;
&nbsp;&nbsp;padding: .3em .5em;
&nbsp;&nbsp;background: #fff;
&nbsp;&nbsp;opacity: .8;
&nbsp;&nbsp;filter: alpha(opacity=80);
&nbsp;&nbsp;font-size: 86%;
}
</pre>
					<p>あとは背景をちょっと吹き出し風にするとか、色々遊べますので試してみてください。例えば</p>
					<pre name="code" class="js">

// とりあえず表示するtip要素を生成しておく
$(&quot;body&quot;).append(&quot;&lt;div id=&#039;title-tip&#039;&gt;&lt;div class=&#039;tip-right&#039;&gt;&quot;+title+&quot;&lt;/div&gt;&lt;/div&gt;&quot;);
</pre>
					<p>のようにDIV要素を入れ子にすることで縦横可変の角丸ツールチップとかできるようになります。</p>
					<p class="link"><a href="http://5509.me/sample/makingtooltip/">Demo</a><br />
					<a href="http://5509.me/sample/archive/makingtooltip.zip">Download demo files</a></p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/how-to-make-tooltip-using-jquery/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery.validation.jsを使ったフォームでチェックによって必須項目の分岐を行う</title>
		<link>http://5509.me/log/checkifvalidation</link>
		<comments>http://5509.me/log/checkifvalidation#comments</comments>
		<pubDate>Thu, 04 Jun 2009 04:40:56 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[memo]]></category>
		<category><![CDATA[フォーム]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1346</guid>
		<description><![CDATA[					たとえばチェックボックスAがcheckedの時に、テキストエリアXを必須にする、というようなフォーム間の依存関係なんかは定義できるのでしょうか？
					via: http://5509.me/2008/08 [...]]]></description>
			<content:encoded><![CDATA[					<blockquote><p>たとえばチェックボックスAがcheckedの時に、テキストエリアXを必須にする、というようなフォーム間の依存関係なんかは定義できるのでしょうか？</p>
					<p><cite>via: <a href="http://5509.me/2008/08/22/realtimeformvalidation.html#comments">http://5509.me/2008/08/22/realtimeformvalidation.html#comments</a></cite></p></blockquote>
					<p>コメントをもらったので対応方法をメモしておきます。</p>
					<p><a href="http://5509.me/sample/validation_if">完成サンプル</a></p>
					<p><span id="more-1346"></span></p>
					<p>普通に実行する場合は以下のようになるのですが</p>
					<pre name="code" class="js">

$(&quot;.validate&quot;).validation({
&nbsp;&nbsp;msgs: {
&nbsp;&nbsp;&nbsp;&nbsp;email: &quot;正しいEメールアドレスを入力してください&lt;br /&gt;例：info@5509.me&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;submit: &quot;入力が完了していない&lt;strong&gt;必須項目&lt;/strong&gt;があります。&lt;br /&gt;&lt;strong&gt;必須項目は全て入力&lt;/strong&gt;してください。&quot;
&nbsp;&nbsp;},
&nbsp;&nbsp;dialog: {
&nbsp;&nbsp;&nbsp;&nbsp;dialogOpacity: .8
&nbsp;&nbsp;}
});
</pre>
					<p>これは指定のFORM要素に対してvalidationを実行するということなので（そのままですけどｗ<br />
					たとえばチェックボックス &#8211; 今回はラジオボタンBにしておきますが &#8211; がチェックされたときに<br />
					テキストボックスAを必須にしたい場合</p>
					<ol>
					<li>ラジオBがチェックされる</li>
					<li>テキストボックスBにaddClass(&#8220;required&#8221;)する</li>
					<li>validationを実行する際に生成されている要素div.validationTip, div#dlgmat, div#dlgを削除する</li>
					<li>validationを再実行する</li>
					</ol>
					<p>の順番で実行していけば、できるようになります。</p>
					<pre name="code" class="js">

// 再実行する必要があるので、何度も書かなくていいように変数にしておく
var validateFunc = function(){
&nbsp;&nbsp;$(&quot;.validate&quot;).validation({
&nbsp;&nbsp;&nbsp;&nbsp;msgs: {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;email: &quot;正しいEメールアドレスを入力してください&lt;br /&gt;例：info@5509.me&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;submit: &quot;入力が完了していない&lt;strong&gt;必須項目&lt;/strong&gt;があります。&lt;br /&gt;&lt;strong&gt;必須項目は全て入力&lt;/strong&gt;してください。&quot;
&nbsp;&nbsp;&nbsp;&nbsp;},
&nbsp;&nbsp;&nbsp;&nbsp;dialog: {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dialogOpacity: .8
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;});
}
// 読み込み時の実行
validateFunc();

// ここからが本題
$(&quot;input[name=&#039;radio&#039;]&quot;).click(function(){

// ラジオボタンがクリックされたときに、それが$(&quot;#radio2&quot;)なら、指定のテキストボックスにaddClass(&quot;required&quot;)
&nbsp;&nbsp;if($(&quot;#radio2&quot;).is(&quot;:checked&quot;)) $(&quot;#other&quot;).addClass(&quot;required&quot;);

// じゃない場合はremoveClass(&quot;required&quot;)
&nbsp;&nbsp;else $(&quot;#other&quot;).removeClass(&quot;required&quot;);

// validationを実行する前に初回読み込み時に生成された要素をすべて削除(かぶるため
&nbsp;&nbsp;$(&quot;div.validationTip,div#dlgmat,div#dlg&quot;).each(function(){ $(this).remove(); });

// validationを実行する
&nbsp;&nbsp;validateFunc();

});
</pre>
					<p><a href="http://5509.me/sample/validation_if">完成サンプル</a><br />
					<a href="http://5509.me/sample/archive/validation_if.zip">サンプルファイルのダウンロード</a></p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/checkifvalidation/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>iPhone風のテキストボックスの文字を消去するボタンを実装するチュートリアル</title>
		<link>http://5509.me/log/turorial-using-iphone-like-input-delete-button</link>
		<comments>http://5509.me/log/turorial-using-iphone-like-input-delete-button#comments</comments>
		<pubDate>Wed, 03 Jun 2009 22:00:25 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[フォーム]]></category>
		<category><![CDATA[プラグイン]]></category>
		<category><![CDATA[ユーザビリティ]]></category>

		<guid isPermaLink="false">http://moto-mono.net/2009/06/04/turorial-iphone-like-input-delete-button.html</guid>
		<description><![CDATA[					iPhoneユーザーにはお馴染みこのボタン
					
					いつのまにかYahoo検索でも採用されてました同じようなボタン
					
					ちょっとした配慮で少しでも入力する手間を軽減できるいい例で [...]]]></description>
			<content:encoded><![CDATA[					<p>iPhoneユーザーにはお馴染みこのボタン</p>
					<p><a href="http://5509.me/wp-content/uploads/2009/06/delval-iphone.gif"><img class="alignnone size-full wp-image-1309" title="iPhoneキャプチャ" src="http://5509.me/wp-content/uploads/2009/06/delval-iphone.gif" alt="iPhoneキャプチャ" width="150" /></a></p>
					<p>いつのまにか<a href="http://search.yahoo.co.jp/search?p=yahoo&amp;ei=UTF-8&amp;fr=moz2&amp;rls=org.mozilla:ja-JP:official">Yahoo検索</a>でも採用されてました同じようなボタン</p>
					<p><img class="alignnone size-full wp-image-1311" title="Yahoo検索キャプチャ" src="http://5509.me/wp-content/uploads/2009/06/delval-yahoo1.gif" alt="Yahoo検索キャプチャ" width="396" height="77" /></p>
					<p>ちょっとした配慮で少しでも入力する手間を軽減できるいい例ですね。<br />
					お問い合わせなどのフォームではあんまり役に立たないかもしれませんが<br />
					検索窓のテキストボックスなどでは割と使えるかも…？</p>
					<p>というわけでこの<strong>テキストボックスの中身を消去するボタンを実装する方法</strong>を紹介します。<br />
					最終的にjQueryプラグインにしているのでサンプルはプラグイン版です。</p>
					<p><span id="more-1337"></span></p>
					<p>チュートリアルなんかいらない人は<a href="#plugin">プラグインの項目にどうぞ</a>。</p>
					<p><a href="http://5509.me/sample/delval"><img class="alignnone size-full wp-image-1312" title="delval実装キャプチャ" src="http://5509.me/wp-content/uploads/2009/06/delval.gif" alt="delval実装キャプチャ" width="190" height="36" /></a></p>
					<p><a href="http://5509.me/sample/delval">サンプル</a><br />
					<a href="http://5509.me/sample/archive/delval.zip">サンプルファイルのダウンロード</a></p>
					<h2>iPhoneのようなテキストボックスの中身を消去するボタンを実装するチュートリアル</h2>
					<h3>まずはINPUT要素を用意します</h3>
					<pre name="code" class="html">

&lt;input type=&quot;text&quot; id=&quot;search&quot; name=&quot;search&quot; value=&quot;&quot; class=&quot;delval&quot; /&gt;
</pre>
					<p>わかりやすいようにIDにはsearch、CLASSにはdelvalを指定しています。</p>
					<h3>次は削除ボタンを表示しているときを考えます</h3>
					<p>削除ボタンを表示した状態を考えると</p>
					<p><img class="alignnone size-full wp-image-1312" title="delval実装キャプチャ" src="http://5509.me/wp-content/uploads/2009/06/delval.gif" alt="delval実装キャプチャ" width="190" height="36" /></p>
					<p>のようになると思いますが<br />
					INPUT要素に削除ボタンが重なっています。<br />
					これを実現するためには、INPUT要素と削除ボタンを親要素でくくって<br />
					親要素をposition: relativeにした上で削除ボタンを右側に絶対配置すればよさそうです。</p>
					<p><img class="alignnone size-full wp-image-1326" title="delval-s1" src="http://5509.me/wp-content/uploads/2009/06/delval-s1.gif" alt="delval-s1" width="227" height="88" /><br />
					これをHTMLとCSSでマークアップすると</p>
					<pre name="code" class="html">

&lt;span class=&quot;delval-group&quot;&gt;
&nbsp;&nbsp;&lt;input type=&quot;text&quot; id=&quot;search&quot; name=&quot;search&quot; value=&quot;&quot; class=&quot;delval&quot; /&gt;
&nbsp;&nbsp;&lt;span class=&quot;delval&quot; /&gt;
&lt;/span&gt;
</pre>
					<pre name="code" class="css">

span.delval-group {
&nbsp;&nbsp;height: 23px;
&nbsp;&nbsp;position: relative;
&nbsp;&nbsp;display: inline-block;
&nbsp;&nbsp;*display: inline;
&nbsp;&nbsp;zoom: 1;
}

&nbsp;&nbsp;span.delval-group input {
&nbsp;&nbsp;&nbsp;&nbsp;padding-right: 20px;
&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;span.delval-group span.delval {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width: 17px;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;height: 23px;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;position: absolute;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;right: 2px;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;top: 1px;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;background: url(../img/delval.png) no-repeat left center;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cursor: pointer;
&nbsp;&nbsp;&nbsp;&nbsp;}
</pre>
					<p>display: inline-blockを使っていますが、floatでも構いません。<br />
					親要素がblock要素の場合、幅がその親に対して100%になってしまうので<br />
					どちらにしても、floatかinline-blockにする必要があります。</p>
					<p><a href="http://5509.me/sample/delval/rev.html">ここまでのサンプル</a></p>
					<h3>JSで置き換えるようにする</h3>
					<p>これで削除ボタンを表示しているときを実装できました。<br />
					できたましたが、結局これはJSが使えないと意味がないので<br />
					JSで実装させてしまいましょう。</p>
					<p>上で変更したHTMLに元のHTMLからDOM操作で変更します。</p>
					<pre name="code" class="js">

$(&quot;input.delval&quot;).each(function(i){
&nbsp;&nbsp;var self = $(this);

&nbsp;&nbsp;self.replaceWith(&quot;&lt;span id=&#039;delval-&quot;+i+&quot;&#039;&gt;&lt;/span&gt;&quot;);
&nbsp;&nbsp;$(&quot;span#delval-&quot;+i)
&nbsp;&nbsp;&nbsp;&nbsp;.append(self)
&nbsp;&nbsp;&nbsp;&nbsp;.append(&quot;&lt;span class=&#039;delval&#039;&gt;&lt;/span&gt;&quot;)
&nbsp;&nbsp;&nbsp;&nbsp;.addClass(&quot;delval-group&quot;);
});
</pre>
					<p>ここまでです。<br />
					複数に対応できるようにeach関数を使って各要素にIDを割り当てています。</p>
					<h3>高さもJSまとめて取得・指定する</h3>
					<p>さらにCSSで親要素のSPAN要素とボタンに高さを与えていましたが<br />
					これもその要素によって変わるしいちいち設定するのは面倒なので<br />
					JSでまとめて設定してしまいましょう。</p>
					<p>あとあと指定する必要が出てくるので<br />
					変数に入れるついでに高さを指定することにします。</p>
					<pre name="code" class="js">

var group = $(&quot;span#delval-&quot;+i).css(&quot;height&quot;,self.attr(&quot;offsetHeight&quot;)),
&nbsp;&nbsp;btn = $(&quot;span.delval&quot;,group).css(&quot;height&quot;,group.height());
</pre>
					<p>offsetHeightはpadding, borderも含めた要素の高さです。<br />
					詳しくは<a class="taggedlink" rel="nofollow" href="http://d.hatena.ne.jp/cyokodog/20090224/jQueryPosSet01" target="_blank">jQuery の位置・サイズ関連メソッドまとめ &#8211; Cyokodog::Diary</a><span class="taggedlink">に書かれています。</span></p>
					<h3><span class="taggedlink">消去ボタンを押したときの動作<br />
					</span></h3>
					<p>あとは</p>
					<ul>
					<li>INPUT要素が空ならボタンは表示しない</li>
					<li>INPUT要素に文字が1文字でも入力されたらボタンを表示</li>
					<li>削除ボタンをクリックでINPUT要素を空にして、ボタンを非表示にする</li>
					</ul>
					<p>で、実装できそうです。<br />
					どれも非常に簡単なのでまとめてしまうと</p>
					<pre name="code" class="js">

if(self.val().length&lt;1) btn.hide();

self.keyup(function(){
&nbsp;&nbsp;if(self.val().length&gt;0) btn.show();
&nbsp;&nbsp;else btn.hide();
});

btn.click(function(){
&nbsp;&nbsp;self.val(&quot;&quot;);
&nbsp;&nbsp;btn.hide();
&nbsp;&nbsp;self.focus();
});
</pre>
					<p>となるので、JSソースをすべてまとめると</p>
					<h3>ここまでのまとめ</h3>
					<pre name="code" class="js">

$(&quot;input.delval&quot;).each(function(i){
&nbsp;&nbsp;var self = $(this);

// 消去ボタンを実装するためにHTMLを改変
&nbsp;&nbsp;self.replaceWith(&quot;&lt;span id=&#039;delval-&quot;+i+&quot;&#039;&gt;&lt;/span&gt;&quot;);
&nbsp;&nbsp;$(&quot;span#delval-&quot;+i)
&nbsp;&nbsp;&nbsp;&nbsp;.append(self)
&nbsp;&nbsp;&nbsp;&nbsp;.append(&quot;&lt;span class=&#039;delval&#039;&gt;&lt;/span&gt;&quot;)
&nbsp;&nbsp;&nbsp;&nbsp;.addClass(&quot;delval-group&quot;);

// 変数に入れるついでに高さを指定
&nbsp;&nbsp;var group = $(&quot;span#delval-&quot;+i).css(&quot;height&quot;,self.attr(&quot;offsetHeight&quot;)),
&nbsp;&nbsp;&nbsp;&nbsp;btn = $(&quot;span.delval&quot;,group).css(&quot;height&quot;,group.height());

// INPUT要素が空なら消去ボタンを隠す
&nbsp;&nbsp;if(self.val().length&lt;1) btn.hide();

// keyupイベント時にINPUT要素の文字列を見て表示非表示
&nbsp;&nbsp;self.keyup(function(){
&nbsp;&nbsp;&nbsp;&nbsp;if(self.val().length&gt;0) btn.show();
&nbsp;&nbsp;&nbsp;&nbsp;else btn.hide();
&nbsp;&nbsp;});

// 消去ボタンを押したらINPUT要素を空にしてフォーカスしておく
&nbsp;&nbsp;btn.click(function(){
&nbsp;&nbsp;&nbsp;&nbsp;self.val(&quot;&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;btn.hide();
&nbsp;&nbsp;&nbsp;&nbsp;self.focus();
&nbsp;&nbsp;});
});
</pre>
					<p>になって完成です。<a href="http://5509.me/sample/delval/rev2.html">ここまでのサンプル</a></p>
					<h2 id="plugin">プラグイン</h2>
					<p>上で作成したものを一応プラグインにしておきました。</p>
					<h3>必要ファイルを読み込む</h3>
					<pre name="code" class="html">

&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;css/delval.css&quot; /&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/delval.js&quot;&gt;&lt;/script&gt;
</pre>
					<h3>対象にしたいINPUT要素に対して実行する</h3>
					<pre name="code" class="html">

&lt;script type=&quot;text/javascript&quot;&gt;
&nbsp;&nbsp;$(function(){
&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;input.delval&quot;).delval();
&nbsp;&nbsp;});
&lt;/script&gt;
</pre>
					<p>だけです。</p>
					<p><a href="http://5509.me/sample/delval">サンプル</a><br />
					<a href="http://5509.me/sample/archive/delval.zip">サンプルファイルのダウンロード</a></p>
					<h2>動作確認済ブラウザ</h2>
					<p>IE6〜8, Firefox3, Opera9.6, Safari3, Chrome2</p>
					<p>でもOperaが…IMEがONの場合Enterキーを押しても<br />
					次にBackSpaceなどを押さない限り動作しません。</p>
					<p>IMEとOperaの問題なのでMacでは問題ないです。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/turorial-using-iphone-like-input-delete-button/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>入力補助でユーザーの負担を減らそう 予約語を表示するtangoHokan.js</title>
		<link>http://5509.me/log/tangohokanjs</link>
		<comments>http://5509.me/log/tangohokanjs#comments</comments>
		<pubDate>Mon, 01 Jun 2009 23:50:08 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[フォーム]]></category>
		<category><![CDATA[プラグイン]]></category>
		<category><![CDATA[ユーザビリティ]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1292</guid>
		<description><![CDATA[					
					どんな場面でもフォームの項目入力はどうしても面倒くさいもの。
					ある程度決まった単語が入力されるとわかっているなら
					よく使う単語を表示して選べれば便利ですよね。
					tang [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://5509.me/sample/tangohokan"><img class="alignnone size-full wp-image-1294" title="登録後から入力補完ができるjQueryプラグイン" src="http://5509.me/wp-content/uploads/2009/06/e38394e382afe38381e383a3-1.png" alt="登録後から入力補完ができるjQueryプラグイン" width="209" height="185" /></a></p>
					<p>どんな場面でもフォームの項目入力はどうしても面倒くさいもの。</p>
					<p>ある程度決まった単語が入力されるとわかっているなら<br />
					よく使う単語を表示して選べれば便利ですよね。</p>
					<p>tangoHokanはINPUT入力時に予約語を表示して<br />
					少しでもユーザーの負担を減らすための補助スクリプトです。<br />
					また入力文字に応じて予約語から絞り込みができます。</p>
					<p>Google検索のような予測ではないですが<br />
					使い方次第ではシステム連携でそれらしいこともできると思います。</p>
					<p><a href="http://5509.me/sample/tangohokan">サンプルを見る</a><br />
					<a href="http://5509.me/sample/archive/tangohokan.zip">サンプルファイルをダウンロードする</a></p>
					<p><span id="more-1292"></span></p>
					<h2>導入方法</h2>
					<h3>tangohokan.cssとjQuery、tangohokan.jsをHTMLヘッダで読み込む</h3>
					<pre name="code" class="html">

&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;css/tangohokan.css&quot; /&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/tangohokan.js&quot;&gt;&lt;/script&gt;
</pre>
					<h3>HTMLを記述しておく</h3>
					<p>例えば以下のような入力項目を用意します。<br />
					各INPUT要素には<strong>IDが必須</strong>になります。<br />
					さらに<strong>IDは予約語を引っ張る際のキーになるので半角英数字(頭文字は数字不可)にします</strong>。<br />
					結局実行する要素は指定するのでCLASSは別になくても構いません。<br />
					わかりやすいようにCLASSを指定しているだけです。</p>
					<pre name="code" class="html">

&lt;dl&gt;
&nbsp;&nbsp;&lt;dt&gt;趣味&lt;/dt&gt;
&nbsp;&nbsp;&lt;dd&gt;&lt;input type=&quot;text&quot; id=&quot;hobby&quot; name=&quot;hobby&quot; value=&quot;&quot; class=&quot;tangoHokan&quot; /&gt;&lt;/dd&gt;
&nbsp;&nbsp;&lt;dt&gt;乗っているバイク&lt;/dt&gt;
&nbsp;&nbsp;&lt;dd&gt;&lt;input type=&quot;text&quot; id=&quot;bike&quot; name=&quot;bike&quot; value=&quot;&quot; class=&quot;tangoHokan&quot; /&gt;&lt;/dd&gt;
&nbsp;&nbsp;&lt;dt&gt;使っているブラウザ&lt;/dt&gt;
&nbsp;&nbsp;&lt;dd&gt;&lt;input type=&quot;text&quot; id=&quot;browser&quot; name=&quot;browser&quot; value=&quot;&quot; class=&quot;tangoHokan&quot; /&gt;&lt;/dd&gt;
&lt;/dl&gt;
</pre>
					<h3>予約語を決める</h3>
					<p>予約語はJSONファイルに記述します。<br />
					JSONってなに？という方は<a href="http://www.thinkit.co.jp/article/70/1/">Think ITの記事</a>を参考にしてください。<br />
					今回の場合は特にJSONが何かわかってなくても使えるようになってるので<br />
					そんなに気にしなくても大丈夫です。</p>
					<p>サンプルファイルで使っている<a href="http://5509.me/sample/tangohokan/data.json">JSONファイル</a>を見てください。</p>
					<pre name="code" class="js">

({
&nbsp;&nbsp;&quot;hobby&quot;: [
&nbsp;&nbsp;&nbsp;&nbsp;&quot;ちろると散歩&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;ちろると公園で遊ぶ&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;ちろると寝る&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;ちろると一緒にランニング&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;ゆにと散歩&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;ゆにと公園で遊ぶ&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;ゆにと寝る&quot;
&nbsp;&nbsp;],
&nbsp;&nbsp;&quot;bike&quot;: [
&nbsp;&nbsp;&nbsp;&nbsp;&quot;SR400&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;Estrella&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;250TR&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;Grass Tracker&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;ST250&quot;
&nbsp;&nbsp;],
&nbsp;&nbsp;&quot;browser&quot;: [
&nbsp;&nbsp;&nbsp;&nbsp;&quot;IE6&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;IE7&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;IE8&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;Firefox3&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;Opera9&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;Safari3&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&quot;Chrome2&quot;
&nbsp;&nbsp;]
})
</pre>
					<p>&#8220;hobby&#8221;, &#8220;bike&#8221;, &#8220;browser&#8221;がそれぞれ予約語に対する見出しのようなものです。<br />
					この<strong>見出しはデータを引っ張る際のキーになるので半角英数字(頭文字は数字不可)にします</strong>。<br />
					要は<strong>HTML側のIDとJSONの見出し部分が同じ項目の予約語がそれぞれ表示</strong>されます。</p>
					<p>予約語の種類を増やしたい場合は、カンマで区切って追加していきます。</p>
					<p>サンプルではこのJSONデータはHTMLファイルと同じディレクトリにあることを想定しています。<br />
					違う場所に置きたい場合は、オプションから指定できます。</p>
					<h3>tangoHokanを実行したいINPUT要素を指定して実行する</h3>
					<p>以下をHTMLヘッダか任意のJSファイルで記述します。</p>
					<pre name="code" class="js">

$(function(){
&nbsp;&nbsp;$(&quot;input.tangoHokan&quot;).tangoHokan();
});
</pre>
					<h2>オプション項目</h2>
					<p>オプション指定で</p>
					<p>JSONファイルの場所/補完単語表示の位置/<br />
					予約語がない場合の文章/閉じるボタンのタイトル</p>
					<p>を変更できます。デフォルトは以下になってます。</p>
					<pre name="code" class="js">

$(function(){
&nbsp;&nbsp;$(&quot;input.tangoHokan&quot;).tangoHokan({
&nbsp;&nbsp;&nbsp;&nbsp;json: &quot;data.json&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;top: 2,
&nbsp;&nbsp;&nbsp;&nbsp;left: 0,
&nbsp;&nbsp;&nbsp;&nbsp;noResult: &quot;No word matched.&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;close: &quot;Close&quot;
&nbsp;&nbsp;});
});
</pre>
					<h2>動作確認済ブラウザ</h2>
					<p>IE6〜8, Firefox3, Opera9.6, Safari3, Chrome2</p>
					<h2>今回何となく見送ったものとかその他のこと</h2>
					<ul>
					<li>項目が多すぎる際の処理 (上位10件を表示して、絞り込みの際に再表示にするつもり</li>
					<li>ドキュメントクリックでプルダウンを閉じたい</li>
					<li>対象ユーザーによっては逆にユーザビリティを低下させるかもしれない</li>
					<li>それを言い出したら全部そうかも。。</li>
					</ul>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/tangohokanjs/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>JSとCookieを使った新規ユーザーのみに表示するコンテンツで心を掴もう</title>
		<link>http://5509.me/log/attracting-new-visitor-with-cookie</link>
		<comments>http://5509.me/log/attracting-new-visitor-with-cookie#comments</comments>
		<pubDate>Thu, 28 May 2009 04:23:03 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[cookie]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[LPO]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1275</guid>
		<description><![CDATA[					
					サイト運営において
					目標はそれぞれ異なると思いますが、そもそも目標を達成するためにはどうすればいいでしょうか。
					LPOもそれなりに浸透してきましたが
					新規ユーザーの心を [...]]]></description>
			<content:encoded><![CDATA[					<p><img class="alignnone size-full wp-image-1284" title="contentfornewvisitors" src="http://5509.me/wp-content/uploads/2009/05/contentfornewvisitors.gif" alt="contentfornewvisitors" width="364" height="149" /></p>
					<p>サイト運営において<br />
					目標はそれぞれ異なると思いますが、そもそも目標を達成するためにはどうすればいいでしょうか。</p>
					<p>LPOもそれなりに浸透してきましたが<br />
					<strong>新規ユーザーの心を掴めるかどうか（ユーザーの目的に合った情報を提示してあげること）</strong><br />
					が重要になってくると思います。</p>
					<p>注目を惹くための手段は色々とあると思いますが</p>
					<ul>
					<li><strong>新規ユーザーのみに提示するようなコンテンツを表示してあげる</strong></li>
					</ul>
					<p>というのもひとつの手段になります。<br />
					今回は<strong>JavaScript</strong>と<strong>Cookie</strong>を使って表示する情報をコントロールする方法を紹介します。<br />
					この方法は<strong>とても簡単に導入できるので覚えておいて損はないと思います</strong>。</p>
					<p>まずは<a href="http://5509.me/sample/contents-for-new-visitors/">何もしていない状態のサンプルを見てください</a>。<br />
					では次に<a href="http://5509.me/sample/contents-for-new-visitors/sample1.html">新規ユーザーのみに提示するようなコンテンツを表示してあげるサンプルを見てください</a>。</p>
					<p class="note">サンプルをもう一度見たい場合は<br />
					タイトルの下の <strong>新規ユーザーに戻る リンクをクリックしてください</strong>。</p>
					<p>一度表示されたらF5を押してページを更新してみてください。<br />
					こうするだけで印象が違いませんか？</p>
					<p>やっていることは簡単で<br />
					Cookieを使って一度訪れたことがあるユーザーかどうかを判別して<br />
					そうでなければ（新規ユーザーなら）指定の要素を表示している、だけです。</p>
					<p><span id="more-1275"></span></p>
					<h2>導入方法</h2>
					<p>まずは、<a href="http://5509.me/sample/contents-for-new-visitors/js/lib/cookie.js">cookie.jsをダウンロード</a>して読み込みます。</p>
					<p class="note">このcookie.jsは<a href="http://plugins.jquery.com/project/cookie">jQuery Cookieプラグイン</a>を<br />
					<a href="http://d.hatena.ne.jp/monjudoh/20080724/1216871110">JavaScriptでcookieを操作する時はjquery.cookie.jsを使おう &#8211; 文殊堂<br />
					</a>を参考にjQueryなしで使えるように書き換えたものです。</p>
					<pre name="code" class="html">

&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/cookie.js&quot;&gt;&lt;/script&gt;
</pre>
					<p>今回は以下のような要素を新規ユーザーに表示することにします。</p>
					<pre name="code" class="html">

&lt;div id=&quot;welcome&quot;&gt;
&nbsp;&nbsp;&lt;p&gt;ようこそ！はじめての方は以下のエントリーがおすすめです。&lt;/p&gt;
&nbsp;&nbsp;&lt;p id=&quot;close&quot;&gt;閉じる&lt;/p&gt;
&nbsp;&nbsp;&lt;ul&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;http://5509.me/2009/04/16/using-wordpress-as-cms.html&quot;&gt;CMSとしてのWordPressでサイト構築をするときに便利な13のプラグイン
&nbsp;&nbsp;&nbsp;&nbsp;&lt;img src=&quot;http://b.hatena.ne.jp/entry/image/http://5509.me/2009/04/16/using-wordpress-as-cms.html&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;http://5509.me/2008/08/22/realtimeformvalidation.html&quot;&gt;リアルタイムフォームバリデーション jQuery.validation.js&lt;/a&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;img src=&quot;http://b.hatena.ne.jp/entry/image/http://5509.me/2008/08/22/realtimeformvalidation.html&quot; /&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;http://5509.me/2008/09/14/jqueryselectable.html&quot;&gt;selectボックスをシンプルなプルダウンに拡張するjQuery.selectable.js
&nbsp;&nbsp;&nbsp;&nbsp;&lt;img src=&quot;http://b.hatena.ne.jp/entry/image/http://5509.me/2008/09/14/jqueryselectable.html&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&lt;/ul&gt;
&lt;/div&gt;
</pre>
					<p>まずはＣＳＳで↑の要素(p#welcome)を非表示にしておきます。</p>
					<pre name="code" class="css">

div#welcome {
&nbsp;&nbsp;display: none;
}
</pre>
					<p>次に、JSとCookieを使って新規ユーザーにのみ表示するスクリプトを加えます。<br />
					サンプルではHTMLのHEAD内に書いています。</p>
					<pre name="code" class="js">

window.onload = function(){
&nbsp;&nbsp;// Cookieに値が保存されているか
&nbsp;&nbsp;var visited = cookie(&quot;visited&quot;) ＆＆ cookie(&quot;visited&quot;)!=null ? false : true;

&nbsp;&nbsp;// Cookieが空の場合（新規ユーザー）p#welcome を表示する
&nbsp;&nbsp;if(visited){
&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById(&quot;welcome&quot;).style.display = &quot;block&quot;;
&nbsp;&nbsp;&nbsp;&nbsp;cookie(&quot;visited&quot;,&quot;visited&quot;); // Cookieに値を保存して以降はリピーター扱いにする
&nbsp;&nbsp;}
}
</pre>
					<p><strong>＆だけ半角に打ちなおしてください。。</strong></p>
					<p>JSがわからない人はそのまま貼って、<br />
					getElementById(&#8220;welcome&#8221;)の<strong>welcome部分を表示したい要素のIDに</strong>すれば大丈夫です。</p>
					<h2>jQueryを使えば…</h2>
					<p><a href="http://5509.me/sample/contents-for-new-visitors/sample2.html">jQueryを使って表示方法を変えたサンプル</a></p>
					<p>表示方法ちょっと変えるだけで印象も全然違いますね。<br />
					jQueryを使えば簡単にできますので、興味がある人は試してみてください <img src='http://5509.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
					<h2>サンプルファイルのダウンロード</h2>
					<dl>
					<dt>JSのみ</dt>
					<dd><a href="http://5509.me/sample/contents-for-new-visitors/js/lib/cookie.js">cookie.js</a>(1KB) &#8211; オリジナルソース <a href="http://plugins.jquery.com/project/cookie">jQuery Cookieプラグイン</a> </dd>
					<dt>サンプルファイル</dt>
					<dd><a href="http://5509.me/sample/archive/contents-for-new-visitors.zip">contents-for-new-visitors.zip</a></dd>
					</dl>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/attracting-new-visitor-with-cookie/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bit.lyで短縮された元のURLをプレビューする jQueryプラグイン</title>
		<link>http://5509.me/log/preview_default_url_shorten_by_bitly</link>
		<comments>http://5509.me/log/preview_default_url_shorten_by_bitly#comments</comments>
		<pubDate>Mon, 25 May 2009 22:21:15 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[bit.ly]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[アクセシビリティ]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1245</guid>
		<description><![CDATA[					
					prebitlyの動作サンプル
					prebitlyのサンプルファイルダウンロード
					自分のサイト、ブログでbit.ly（短縮URL）を使いたいけど
					ユーザー目線で考えると目 [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://5509.me/sample/prebitly"><img class="alignnone size-full wp-image-1254" title="prebitlyキャプチャ" src="http://5509.me/wp-content/uploads/2009/05/prebitly.gif" alt="prebitlyキャプチャ" width="309" height="171" /></a></p>
					<p><a href="http://5509.me/sample/prebitly">prebitlyの動作サンプル</a><br />
					<a href="http://5509.me/sample/archive/prebitly.zip">prebitlyのサンプルファイルダウンロード</a></p>
					<p>自分のサイト、ブログで<a href="http://bit.ly/">bit.ly</a>（短縮URL）を使いたいけど<br />
					ユーザー目線で考えると目的地がはっきりしないURLは不安じゃないですか？</p>
					<p>短縮URLで飛ばした先でウイルス感染…とかもあるみたいですし。<br />
					慣れてる人はFirefoxのアドオンとか、Greasemonkeyを使えばいいんですけど<br />
					それだけじゃだめですよね。</p>
					<p>prebitlyプラグインを導入すれば、bit.lyを使った短縮URLでも<br />
					プレビューチップで元のURLを表示するので、みんなが安心してリンクをクリックできます。<br />
					（さすがに、音声ブラウザまでは無理です…）</p>
					<p><span id="more-1245"></span></p>
					<h2>トピックス</h2>
					<ul>
					<li><a href="#download">ダウンロード</a></li>
					<li><a href="#install">導入方法</a></li>
					<li><a href="#setting">設定</a></li>
					<li><a href="http://5509.me/sample/prebitly">サンプル</a></li>
					<li><a href="#spec">動作環境</a></li>
					</ul>
					<h2 id="#download">ダウンロード</h2>
					<dl>
					<dt>JSのみ</dt>
					<dd><a href="http://5509.me/sample/prebitly/js/prebitly.js">prebitly.js(1KB)</a></dd>
					<dt>サンプルファイル</dt>
					<dd><a href="http://5509.me/sample/archive/prebitly.zip">prebitly.zip</a></dd>
					</dl>
					<h2 id="install">導入方法</h2>
					<p>prebitlyプラグインを使うには、<strong>bit.lyのアカウントとAPIキーが必要</strong>です。<br />
					作成、取得は非常に簡単です。</p>
					<h3>bit.lyのアカウントを作成する</h3>
					<p><a href="http://bit.ly/account/register?rd=/">このページ</a>左の<strong>Create a Free bit.ly Account</strong>から項目に入力して<strong>Sign Up</strong>します。</p>
					<h3>AccountのページからAPIキーを取得する</h3>
					<p><img class="alignnone size-full wp-image-1263" title="e38394e382afe38381e383a3-11" src="http://5509.me/wp-content/uploads/2009/05/e38394e382afe38381e383a3-11.png" alt="e38394e382afe38381e383a3-11" width="128" height="51" /></p>
					<p>右上のリンクから移動します。<br />
					そうすると左側に↓のように「API Login」「API Key」が表示されています。</p>
					<p><img class="alignnone size-full wp-image-1264" title="e38394e382afe38381e383a3-2" src="http://5509.me/wp-content/uploads/2009/05/e38394e382afe38381e383a3-2.png" alt="e38394e382afe38381e383a3-2" width="137" height="111" /></p>
					<h3>ファイルを読み込む</h3>
					<p>prebitly.jsを読み込む前に、Login IDとAPI KeyでAPIにアクセスできる状態にします。<br />
					login= /ここにAPI Login<br />
					apiKey= /ここにAPI Key</p>
					<pre name="code" class="html">

&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;css/prebitly.css&quot; /&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://bit.ly/javascript-api.js?version=latest&amp;amp;login=norinorinori&amp;amp;apiKey=R_e3f7b535791f579489b605e30356993b&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/prebitly.js&quot;&gt;&lt;/script&gt;
</pre>
					<p>デザインを変える場合はCSSファイルから行ってください。<br />
					最後に実行します。</p>
					<pre name="code" class="html">

&lt;script type=&quot;text/javascript&quot;&gt;
&nbsp;&nbsp;$(function(){
&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;a[href*=&#039;http://bit.ly&#039;]&quot;).prebitly();
&nbsp;&nbsp;});
&lt;/script&gt;
</pre>
					<p>これだけで bit.ly で短縮されたURLにマウスカーソルが乗ったときに<br />
					プレビューが表示されるようになります。</p>
					<h2 id="setting">設定</h2>
					<p>チップ表示位置の微調整、読み込み中の文言を変えることができます。<br />
					変更するときは以下のように記述します。</p>
					<pre name="code" class="html">

&lt;script type=&quot;text/javascript&quot;&gt;
&nbsp;&nbsp;$(function(){
&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;a[href*=&#039;http://bit.ly&#039;]&quot;).prebitly({
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;top: -40,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;left: 5,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;loadingText: &quot;loading...&quot;
&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;});
&lt;/script&gt;
</pre>
					<p><a href="http://5509.me/sample/prebitly">prebitlyの動作サンプル</a><br />
					<a href="http://5509.me/sample/archive/prebitly.zip">prebitlyのサンプルファイルダウンロード</a></p>
					<h2 id="spec">動作環境</h2>
					<ul>
					<li>IE6（後方互換モードは未確認）</li>
					<li>IE7</li>
					<li>Firefox3</li>
					<li>Opera9.5</li>
					<li>Safari3</li>
					<li>Chrome</li>
					</ul>
					<h2>ちなみに…</h2>
					<p>プレビューにサムネイルなど<br />
					もっと拡張した機能がほしい場合は <a href="http://code.google.com/p/bitly/">bitly</a> というプラグインがあります。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/preview_default_url_shorten_by_bitly/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>角丸幅可変ボタンでクロスフェードをする</title>
		<link>http://5509.me/log/cross-fade-with-rounded-corner-button</link>
		<comments>http://5509.me/log/cross-fade-with-rounded-corner-button#comments</comments>
		<pubDate>Thu, 21 May 2009 21:00:29 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[memo]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1225</guid>
		<description><![CDATA[					
					角丸の幅可変ボタンを作ろうと思うと割と面倒くさいんですけど
					さらにクロスフェードさせたい（実質クロスフェードではないんですが）
					という欲望に負けてやってみました。
					完成 [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://5509.me/sample/cross-fade-with-css-sprite/"><img class="alignnone size-full wp-image-1234" title="角丸幅可変ボタン" src="http://5509.me/wp-content/uploads/2009/05/e38394e382afe38381e383a3-1.png" alt="角丸幅可変ボタン" width="130" height="54" /></a></p>
					<p>角丸の幅可変ボタンを作ろうと思うと割と面倒くさいんですけど<br />
					さらにクロスフェードさせたい（実質クロスフェードではないんですが）<br />
					という欲望に負けてやってみました。</p>
					<p><a href="http://5509.me/sample/cross-fade-with-css-sprite/">完成サンプル</a><br />
					<a href="http://5509.me/sample/archive/cross-fade-with-css-sprite.zip">サンプルファイルのダウンロード</a></p>
					<p><span id="more-1225"></span></p>
					<p class="note"><span style="text-decoration: line-through;">とりあえずMacでしか確認してないのでIEとかどうなるかわかりません。<br />
					</span><strong>IE6で崩れてたのでCSSを修正しました。</strong></p>
					<h2>角丸可変ボタンのHTML</h2>
					<p>そもそも角丸幅可変のボタンを作ろうと思うと要素の入れ子は避けられません。<br />
					下のような感じになります。</p>
					<pre name="code" class="html">

&lt;a href=&quot;#&quot;&gt;&lt;span&gt;SUBMIT&lt;/span&gt;&lt;/a&gt;
</pre>
					<p>ムダな要素はJSで…<br />
					でもいいですけど、ここはデザインに直接影響するところなので<br />
					HTML+CSSだけでやったほうがいいです。<br />
					中のSPANはあきらめてください。僕は気にしてません。</p>
					<h2>角丸可変ボタンのCSS</h2>
					<p>これにCSSを書いていくと<br />
					たぶん以下みたいな感じになると思います。<br />
					ボタンは2つ以上並ぶ事も想定します。</p>
					<p>使う画像は次の2つです。</p>
					<p><img src="http://5509.me/sample/cross-fade-with-css-sprite/img/btn_left.gif" alt="ボタン左" width="5" height="70" /> <img src="http://5509.me/sample/cross-fade-with-css-sprite/img/btn_right.gif" alt="ボタン右" width="303" height="70" /></p>
					<pre name="code" class="css">

p.btn {
&nbsp;&nbsp;overflow: hidden;
}

&nbsp;&nbsp;p.btn a {
&nbsp;&nbsp;&nbsp;&nbsp;float: left;
&nbsp;&nbsp;&nbsp;&nbsp;padding-left: 5px;
&nbsp;&nbsp;&nbsp;&nbsp;color: #fff;
&nbsp;&nbsp;&nbsp;&nbsp;background: url(../../img/btn_left.gif) no-repeat left top;
&nbsp;&nbsp;&nbsp;&nbsp;text-decoration: none;
&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;p.btn a span {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;padding: 0 20px 0 15px;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display: block;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;height: 35px;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;background: url(../../img/btn_right.gif) no-repeat right top;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;line-height: 35px;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cursor: pointer; /* for IE */
&nbsp;&nbsp;&nbsp;&nbsp;}
</pre>
					<p><span style="text-decoration: line-through;">最近は結構普通にinline-block使ってます。</span><br />
					floatで書きなおしました。</p>
					<h2>クロスフェードを実現するには</h2>
					<p>問題はここからですが<br />
					クロスフェードをさせるとなると、背景画像を2枚重ねていないとできません。<br />
					背景画像を入れ替えれば…CSS Spriteを使ってたらそういうわけにもいきません。</p>
					<p>元々あるボタンの下にフェード後のボタンを配置して<br />
					mouseover時に上のボタンをフェードアウトさせればうまくいきそうです。</p>
					<p>構造としては<br />
					- フェード後のボタン<br />
					- 元々あるボタン<br />
					を並列に並べて、<br />
					フェード後のボタンが元々あるボタンの下にくるようにする必要があるので<br />
					2つのボタンをグループ化して、<br />
					フェード後のボタンを絶対配置でグループの左上に配置します。</p>
					<p>具体的には下のHTMLのようになります。</p>
					<pre name="code" class="html">

&lt;span class=&quot;cfGroup&quot;&gt;&lt;!-- ボタンを重ねるのでグループ化する --&gt;
&nbsp;&nbsp;&lt;span class=&quot;cfGM&quot;&gt;&lt;!-- これが下に敷いておくボタン --&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;span class=&quot;cfGLeft&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;span class=&quot;cfGRight&quot;&gt;SUBMIT&lt;/span&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/span&gt;
&nbsp;&nbsp;&lt;/span&gt;
&nbsp;&nbsp;&lt;a href=&quot;#&quot;&gt;&lt;!-- こっちが元々あるボタン --&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;span&gt;SUBMIT&lt;/span&gt;
&nbsp;&nbsp;&lt;/a&gt;
&lt;/span&gt;
</pre>
					<h3>jQueryを使って構造を変える</h3>
					<p>さすがにこれは汚いので、jQueryで構造を変更しましょう。<br />
					グループを識別するためにidを割り当ててます。</p>
					<pre name="code" class="js">

$(&quot;a&quot;,&quot;p.btn&quot;).each(function(){
&nbsp;&nbsp;$(this).replaceWith(&quot;&lt;span id=&#039;cfG&quot;+i+&quot;&#039; class=&#039;cfGroup&#039;&gt;&lt;/span&gt;&quot;);
&nbsp;&nbsp;// 既存のボタンをグループと置き換える
&nbsp;&nbsp;$(&quot;span#cfG&quot;+i)
&nbsp;&nbsp;&nbsp;&nbsp;.append(&quot;&lt;span class=&#039;cfGM&#039;&gt;&lt;span class=&#039;cfGLeft&#039;&gt;&lt;span class=&#039;cfGRight&#039;&gt;&quot;+$(this).text()+&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&quot;)
&nbsp;&nbsp;&nbsp;&nbsp;.append($(this).clone());
&nbsp;&nbsp;&nbsp;&nbsp;// フェード後のボタンを追加したのち
&nbsp;&nbsp;&nbsp;&nbsp;// 既存のボタンをその後ろに追加する
});
</pre>
					<h3>CSSを追記する</h3>
					<p>さらにCSSを追記します。</p>
					<pre name="code" class="css">

p.btn span.cfGroup {
&nbsp;&nbsp;float: left;
&nbsp;&nbsp;position: relative;
}

&nbsp;&nbsp;p.btn span.cfGroup span.cfGM {
&nbsp;&nbsp;&nbsp;&nbsp;position: absolute;
&nbsp;&nbsp;&nbsp;&nbsp;top: 0;
&nbsp;&nbsp;&nbsp;&nbsp;left: 0;
&nbsp;&nbsp;&nbsp;&nbsp;z-index: 10;
&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;p.btn span.cfGroup span.cfGLeft {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;float: left;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;padding-left: 5px;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;color: #fff;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;background: url(../../img/btn_left.gif) no-repeat left -35px;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text-decoration: none;
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p.btn span.cfGroup span.cfGLeft span.cfGRight {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;padding: 0 20px 0 15px;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display: block;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;height: 35px;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;background: url(../../img/btn_right.gif) no-repeat right -35px;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;line-height: 35px;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
</pre>
					<p>さらにこのままだと、<br />
					既存のボタンとフェード後のボタンの重なりが逆になるので<br />
					z-indexを大きい数値にしておきます。<br />
					z-indexを使う場合は、position: relativeにする必要があります。</p>
					<pre name="code" class="css">

p.btn a {
&nbsp;&nbsp;float: left;
&nbsp;&nbsp;padding-left: 5px;
&nbsp;&nbsp;position: relative;
&nbsp;&nbsp;z-index: 100;
&nbsp;&nbsp;color: #fff;
&nbsp;&nbsp;background: url(../../img/btn_left.gif) no-repeat left top;
&nbsp;&nbsp;text-decoration: none;
}
</pre>
					<h3>上のボタンをフェードさせて実現する</h3>
					<p>ここまでくればあとは、<br />
					hover時に上に乗ってるボタンをフェードアウトさせるだけです。</p>
					<pre name="code" class="js">

$(&quot;a&quot;,&quot;p.btn&quot;).each(function(){
&nbsp;&nbsp;$(this).replaceWith(&quot;&lt;span id=&#039;cfG&quot;+i+&quot;&#039; class=&#039;cfGroup&#039;&gt;&lt;/span&gt;&quot;);
&nbsp;&nbsp;$(&quot;span#cfG&quot;+i)
&nbsp;&nbsp;&nbsp;&nbsp;.append(&quot;&lt;span class=&#039;cfGM&#039;&gt;&lt;span class=&#039;cfGLeft&#039;&gt;&lt;span class=&#039;cfGRight&#039;&gt;&quot;+$(this).text()+&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&quot;)
&nbsp;&nbsp;&nbsp;&nbsp;.append($(this).clone());

&nbsp;&nbsp;// ここから下がフェード
&nbsp;&nbsp;$(&quot;a&quot;,&quot;span#cfG&quot;+i).hover(function(){
&nbsp;&nbsp;&nbsp;&nbsp;$(this).fadeTo(&quot;normal&quot;,0);
&nbsp;&nbsp;},function(){
&nbsp;&nbsp;&nbsp;&nbsp;$(this).fadeTo(&quot;normal&quot;,1);
&nbsp;&nbsp;});
});
</pre>
					<h3>ポイント</h3>
					<p>フェードさせるときの注意がひとつだけあって<br />
					fadeOutにすると、最終的にdisplay: noneになるので<br />
					グループの幅と高さがなくなって、下にある要素が上に詰まります。<br />
					なので、ここではfadeToでOpacityのみを操作しています。</p>
					<p><a href="http://5509.me/sample/cross-fade-with-css-sprite/rev1.html">ここまでのサンプル</a></p>
					<h3>連続でホバーさせたときに動作が…</h3>
					<p>A要素にhoverするとfadeToが呼び出されて<br />
					フェードアニメーションが実行されますが連続でhoverさせると<br />
					アニメーションキューがたまっていって、ぴかぴかします。</p>
					<p>これを解決するにはfade実行時に<br />
					直前のアニメーションキューを削除すればいいので</p>
					<pre name="code" class="js">

// ここから下がフェード
$(&quot;a&quot;,&quot;span#cfG&quot;+i).hover(function(){
&nbsp;&nbsp;$(this).queue([]).fadeTo(&quot;normal&quot;,0);
},function(){
&nbsp;&nbsp;$(this).queue([]).fadeTo(&quot;normal&quot;,1);
});
</pre>
					<p>queue([])でアニメーションキューを空にすればぴかぴかしなくなります。</p>
					<p><a href="http://5509.me/sample/cross-fade-with-css-sprite/">完成サンプル<br />
					</a><a href="http://5509.me/sample/archive/cross-fade-with-css-sprite.zip">サンプルファイルのダウンロード</a></p>
					<h2>あ、、</h2>
					<p>このサンプルなら画像を2つに分ける必要はなかったですね…</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/cross-fade-with-rounded-corner-button/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQueryを使ったスライド開閉メニューをCookieでコントロールする</title>
		<link>http://5509.me/log/control-slide-navigation-with-jquery-cookie</link>
		<comments>http://5509.me/log/control-slide-navigation-with-jquery-cookie#comments</comments>
		<pubDate>Wed, 20 May 2009 23:40:47 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[cookie]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[memo]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1196</guid>
		<description><![CDATA[					
					サンプル
					サンプルファイルのダウンロード
					ちょっと前に流行った？アコーディオンメニューの開閉状態を
					Cookieで保存する方法をメモをかねて紹介します。
					
	 [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://5509.me/sample/slidenav-with-cookie/"><img class="alignnone size-full wp-image-1204" title="jQueryを使った開閉メニューをCookieでコントロールする" src="http://5509.me/wp-content/uploads/2009/05/slidenav-with-cookie.gif" alt="jQueryを使った開閉メニューをCookieでコントロールする" width="192" height="153" /></a></p>
					<p><a href="http://5509.me/sample/slidenav-with-cookie/">サンプル</a><br />
					<a href="http://5509.me/sample/archive/slidenav-with-cookie.zip">サンプルファイルのダウンロード</a></p>
					<p>ちょっと前に流行った？アコーディオンメニューの開閉状態を<br />
					Cookieで保存する方法をメモをかねて紹介します。</p>
					<p><span id="more-1196"></span></p>
					<h2>必要なファイルを集める</h2>
					<p>面倒だと思うのでサンプルにまとめました。<br />
					サンプルファイルをダウンロードして新しいHTMLでJSファイルを読み込んでください。</p>
					<p><a href="http://5509.me/sample/archive/slidenav-with-cookie.zip">サンプルファイルのダウンロード</a></p>
					<h2>HTMLを用意する</h2>
					<h3>CSSファイルを読み込む</h3>
					<p>この記事でCSSの解説はしてません。。</p>
					<pre name="code" class="html">

&lt;link type=&quot;text/css&quot; rel=&quot;stylesheet&quot; href=&quot;css/style.css&quot; /&gt;
</pre>
					<h3>JSファイルを読み込む</h3>
					<pre name="code" class="html">

&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jquery.easing.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jquery.cookie.js&quot;&gt;&lt;/script&gt;
</pre>
					<h3>HTMLをマークアップする</h3>
					<pre name="code" class="html">

&lt;div id=&quot;sub&quot;&gt;
&nbsp;&nbsp;&lt;div class=&quot;section nav&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2 class=&quot;sub_nav_heading toggle&quot;&gt;A&lt;/h2&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;ul class=&quot;sub_nav&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;&quot;&gt;A-1&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;&quot;&gt;A-2&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;&quot;&gt;A-3&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;&quot;&gt;A-4&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;&quot;&gt;A-5&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;&quot;&gt;A-6&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;&quot;&gt;A-7&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ul&gt;
&nbsp;&nbsp;&lt;/div&gt;
&nbsp;&nbsp;&lt;!--//Section--&gt;

&nbsp;&nbsp;&lt;div class=&quot;section nav&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2 class=&quot;sub_nav_heading toggle&quot;&gt;B&lt;/h2&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;ul class=&quot;sub_nav&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;&quot;&gt;B-1&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;&quot;&gt;B-2&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;&quot;&gt;B-3&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;&quot;&gt;B-4&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;&quot;&gt;B-5&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;&quot;&gt;B-6&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;&quot;&gt;B-7&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ul&gt;
&nbsp;&nbsp;&lt;/div&gt;
&nbsp;&nbsp;&lt;!--//Section--&gt;
&lt;/div&gt;
&lt;!--//Sub--&gt;
</pre>
					<p>HTMLがちょっと気持ち悪いと思う人もいるかもしれませんが<br />
					今回はこんな感じでマークアップしてます。</p>
					<h2>JSを書く</h2>
					<h3>普通にアコーディオンメニューにする</h3>
					<p>今回は特にアコーディオン部分の記述にはふれませんが<br />
					以下の記述でアコーディオンになります。</p>
					<p>jQuery Easingプラグインを使ってちょっと動きを変えてます。<br />
					何気ないアコーディオンもこういう動きなら面白いかもしれないですね。<br />
					単純に鬱陶しいだけにもなり得ますけど…</p>
					<p>ちなみに、前回のエントリ<a href="http://5509.me/easingScroll">jQuery.easingscroll.js</a>はEasingプラグインを<br />
					含んでいるので併せて使うと楽しい動き(≠うざい動き)のサイトになりますね！</p>
					<pre name="code" class="js">

/*
* @ スライドナビゲーション
*/
$(&quot;ul.sub_nav&quot;,&quot;div#sub&quot;).each(function(i){
// 開閉ナビで使う変数定義
&nbsp;&nbsp;var me = $(this),
&nbsp;&nbsp;&nbsp;&nbsp;box = me.parent(), // 親要素のdiv.nav
&nbsp;&nbsp;&nbsp;&nbsp;heading = me.prev().append(&quot;&lt;span class=&#039;toggle&#039;&gt;&lt;/span&gt;&quot;),
&nbsp;&nbsp;&nbsp;&nbsp;// 兄要素のh2にspan.toggleを追加して変数に保存
&nbsp;&nbsp;&nbsp;&nbsp;toggle = $(&quot;span.toggle&quot;,heading);// Toggle

&nbsp;&nbsp;// 下層ナビとToggleボタンを隠す
&nbsp;&nbsp;me.hide();
&nbsp;&nbsp;toggle.hide();

&nbsp;&nbsp;// Toggleボタンの表示非表示
&nbsp;&nbsp;heading.hover(function(){
&nbsp;&nbsp;&nbsp;&nbsp;toggle.show();
&nbsp;&nbsp;},function(){
&nbsp;&nbsp;&nbsp;&nbsp;// h2.openedの場合はToggleを表示したままにする
&nbsp;&nbsp;&nbsp;&nbsp;if(!heading.hasClass(&quot;opened&quot;)) toggle.hide();
&nbsp;&nbsp;});

&nbsp;&nbsp;// Toggleクリック時の動作
&nbsp;&nbsp;toggle.click(function(){
&nbsp;&nbsp;&nbsp;&nbsp;heading.toggleClass(&quot;opened&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;if(!box.hasClass(&quot;opened&quot;)) box.addClass(&quot;opened&quot;);

&nbsp;&nbsp;&nbsp;&nbsp;// アニメーション設定
&nbsp;&nbsp;&nbsp;&nbsp;me.animate({
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;height: &quot;toggle&quot;
&nbsp;&nbsp;&nbsp;&nbsp;},{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;easing: &quot;easeOutBounce&quot;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// jQuery Easingを使って開閉時に跳ねるようにしてみる
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;duration: 400,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;complete: function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(!heading.hasClass(&quot;opened&quot;)) box.removeClass(&quot;opened&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;});
});
</pre>
					<h3>jQuery Cookieを使うのでちょっと紹介</h3>
					<p><a href="http://plugins.jquery.com/project/Cookie">jQuery.cookieプラグイン</a>を使ってます。<br />
					jQueryを使う場合はこれが一番わかりやすく、簡単にCookieを扱えます。</p>
					<p>いちおう説明しておくと</p>
					<pre name="code" class="js">

$.cookie(&quot;Cookieの名前&quot;, &quot;Cookieの値&quot;); // 保存
$.cookie(&quot;Cookieの名前&quot;); // 値の読み出し
</pre>
					<p>という具合で使えます。<br />
					保存時、第3引数でオプションを指定することで保存日数などを指定できます。</p>
					<pre name="code" class="js">

$.cookie(&quot;Cookieの名前&quot;, &quot;Cookieの値&quot; { expires: 7, path: &quot;/&quot;, domain: &quot;jquery.com&quot;, secure: true });
</pre>
					<p>また、値にnullを入れることでCookieを削除することができます。</p>
					<pre name="code" class="js">

$.cookie(&quot;Cookieの名前&quot;, null); // Cookieの削除
</pre>
					<h3>Cookieを使うタイミング</h3>
					<p>開閉状態を保存する場合Cookieを扱う箇所が3つあって</p>
					<ul>
					<li>Toggleをクリックしたとき(開けるとき) &#8211; Cookieを保存</li>
					<li>Toggleをクリックしたとき(閉じるとき) &#8211; Cookieを保存</li>
					<li>ページをロードしたとき &#8211; Cookieを読み出す</li>
					</ul>
					<p>この3つのタイミングでCookieを保存したり、読み出すことで開閉状態を保存できます。</p>
					<h3>Cookieの保存方法をどうするのか</h3>
					<p>全てのアコーディオンでCookieを保存するのはきれいなやり方ではないので<br />
					開いた状態を記憶するためにCookieには[i]という値を保存していくことにします。</p>
					<p>例えば、1つめのパネルが開いた場合、Cookieには[0]が保存されることになります。<br />
					さらに、2つめも開いた場合、[0][1]という値が保存されます。</p>
					<p>閉じる場合には逆で[i]を取り除くことで元の状態になります。<br />
					これらの値はパネルが開いた順に保存されていくので<br />
					3-2-4という順番で開いた場合、[2][1][3]といったように保存されますが<br />
					値の削除時にはreplace関数を使うので、この順番は特に問題ありません。</p>
					<p>ちなみに[]を使う理由はパネル数が10を超える場合に<br />
					0と1〜9の区別がつかなくなるのを防ぐためです。</p>
					<h3>とりあえずCookieを使って保存していく</h3>
					<p>まずはCookieの値を変数に保存しておきます。<br />
					これはページロードのタイミングで行います。</p>
					<pre name="code" class="js">

var cookie = ($.cookie(&quot;menu&quot;) ＆＆ $.cookie(&quot;menu&quot;)!=null) ? $.cookie(&quot;menu&quot;) : &quot;&quot;;
</pre>
					<p>Cookieの名前はmenuにしています。<br />
					Cookiに値がある場合はcookieに値を保存<br />
					それ以外の場合は空の値を渡しておきます。</p>
					<p>あとCookieに保存する・識別用の値を宣言しておきます。</p>
					<pre name="code" class="js">

// 開閉ナビで使う変数定義に追記する
var pos = &quot;[&quot;+i+&quot;]&quot;; // Cookieに保存する
</pre>
					<p>この i はeach関数でループ時に得られる引数を使います。<br />
					準備ができたらClick時に保存するように記述します。</p>
					<pre name="code" class="js">

if(!box.hasClass(&quot;opened&quot;)){ // 開くとき
&nbsp;&nbsp;box.addClass(&quot;opened&quot;);
&nbsp;&nbsp;cookie += pos; // このパネルの識別用の値をCookieの値に追記
&nbsp;&nbsp;$.cookie(&quot;menu&quot;,cookie); // Cookieの値をCookie[&quot;menu&quot;]に保存する
}else{ // 閉じるとき
&nbsp;&nbsp;cookie = cookie.replace(pos,&quot;&quot;); // このパネルの識別用の値をCookieの値から削除する
&nbsp;&nbsp;$.cookie(&quot;menu&quot;,cookie.length==0 ? null : cookie);
&nbsp;&nbsp;// Cookieの値をCookie[&quot;menu&quot;]に保存する
&nbsp;&nbsp;// このとき値が空になったらCookie[&quot;menu&quot;]を削除する
}
</pre>
					<p>あとは初期表示パネルを最初に保存したCookieの値から決めます。<br />
					cookie.match(new RegExp(pos))の部分で判別してます。</p>
					<pre name="code" class="js">

// クッキーに[i]がある場合はナビを表示する
if($.cookie(&quot;menu&quot;)==null
|| !cookie.match(new RegExp(pos))){
&nbsp;&nbsp;me.hide();
&nbsp;&nbsp;toggle.hide();
}else{
&nbsp;&nbsp;box.addClass(&quot;opened&quot;);
&nbsp;&nbsp;heading.addClass(&quot;opened&quot;);
}
</pre>
					<p>これらのソースコードを追記した完成版が以下になります。</p>
					<pre name="code" class="js">

/*
* @ スライドナビゲーション
* @ Cookieを使って開閉をコントロール
*/
// ナビゲーションで使うCookieを読みこんでおく
var cookie = ($.cookie(&quot;menu&quot;) ＆＆ $.cookie(&quot;menu&quot;)!=null) ? $.cookie(&quot;menu&quot;) : &quot;&quot;;
$(&quot;ul.sub_nav&quot;,&quot;div#sub&quot;).each(function(i){
&nbsp;&nbsp;// 開閉ナビで使う変数定義
&nbsp;&nbsp;var me = $(this),
&nbsp;&nbsp;&nbsp;&nbsp;box = me.parent(), // 親要素のdiv.nav
&nbsp;&nbsp;&nbsp;&nbsp;heading = me.prev().append(&quot;&quot;),
&nbsp;&nbsp;&nbsp;&nbsp;// 兄要素のh2にspan.toggleを追加して変数に保存
&nbsp;&nbsp;&nbsp;&nbsp;toggle = $(&quot;span.toggle&quot;,heading), // Toggle
&nbsp;&nbsp;&nbsp;&nbsp;pos = &quot;[&quot;+i+&quot;]&quot;; // Cookieに保存する

&nbsp;&nbsp;// クッキーに[i]がある場合はナビを表示する
&nbsp;&nbsp;if($.cookie(&quot;menu&quot;)==null
&nbsp;&nbsp;|| !cookie.match(new RegExp(pos))){
&nbsp;&nbsp;&nbsp;&nbsp;me.hide();
&nbsp;&nbsp;&nbsp;&nbsp;toggle.hide();
&nbsp;&nbsp;}else{
&nbsp;&nbsp;&nbsp;&nbsp;box.addClass(&quot;opened&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;heading.addClass(&quot;opened&quot;);
&nbsp;&nbsp;}

&nbsp;&nbsp;// Toggleボタンの表示非表示
&nbsp;&nbsp;heading.hover(function(){
&nbsp;&nbsp;&nbsp;&nbsp;toggle.show();
&nbsp;&nbsp;},function(){
&nbsp;&nbsp;&nbsp;&nbsp;// h2.openedの場合はToggleを表示したままにする
&nbsp;&nbsp;&nbsp;&nbsp;if(!heading.hasClass(&quot;opened&quot;)) toggle.hide();
&nbsp;&nbsp;});

&nbsp;&nbsp;// Toggleクリック時の動作
&nbsp;&nbsp;toggle.click(function(){
&nbsp;&nbsp;&nbsp;&nbsp;heading.toggleClass(&quot;opened&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;if(!box.hasClass(&quot;opened&quot;)){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;box.addClass(&quot;opened&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cookie += pos;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$.cookie(&quot;menu&quot;,cookie);
&nbsp;&nbsp;&nbsp;&nbsp;}else{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cookie = cookie.replace(pos,&quot;&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$.cookie(&quot;menu&quot;,cookie.length==0 ? null : cookie);
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;// アニメーション設定
&nbsp;&nbsp;&nbsp;&nbsp;me.animate({
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;height: &quot;toggle&quot;
&nbsp;&nbsp;&nbsp;&nbsp;},{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;easing: &quot;easeOutBounce&quot;, // jQuery Easing
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;duration: 400,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;complete: function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(!heading.hasClass(&quot;opened&quot;)) box.removeClass(&quot;opened&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;});
});
</pre>
					<p><a href="http://5509.me/sample/slidenav-with-cookie/">完成サンプルを見る</a></p>
					<h2>というわけで</h2>
					<p>肝心のCookieはかなり簡単に使えるということが伝わったでしょうか。<br />
					Cookieの保存方法は色々考えられるので試してみると楽しいです。</p>
					<p><a title="jQueryとjquery.cookie.jsを使って開閉を保持するメニューを作ってみる" href="http://blog.caraldo.net/2009/03/jqcookiemenu.php">jQueryとjquery.cookie.jsを使って開閉を保持するメニューを作ってみる &#8211; caraldo.net</a><br />
					<a href="http://blog.caraldo.net/2009/03/newjqqookiemenu.php">jQueryを使用したCookie開閉保持メニューをよりjQueryっぽく書き直す &#8211; caraldo.net</a></p>
					<p>同じHTMLで2通りのやり方とか。後の記事の方がCookieがすっきりします。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/control-slide-navigation-with-jquery-cookie/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>ひと味違ったページ内スクロールをjQuery Easingプラグインで実装する jQuery.easing.scroll.js</title>
		<link>http://5509.me/log/page-scrolling-with-jqueryeasing</link>
		<comments>http://5509.me/log/page-scrolling-with-jqueryeasing#comments</comments>
		<pubDate>Mon, 18 May 2009 01:10:00 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://moto-mono.net/2009/05/18/page-scrolling-with-jqueryeasing.html</guid>
		<description><![CDATA[					
					サンプルを見る (IE6では確認できません
					jQueryを使うとかなり簡単にページ内スクロールが実装できるのですが、さらにjQuery Easingプラグインと合わせるとなかなか面白い動き [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://5509.me/sample/easingScroll/"><img class="alignnone size-full wp-image-1130" title="EasingScrollイメージ" src="http://5509.me/wp-content/uploads/2009/05/easingscroll.gif" alt="EasingScrollイメージ" width="256" height="141" /></a></p>
					<p><a href="http://5509.me/sample/easingScroll/">サンプルを見る (IE6では確認できません</a></p>
					<p>jQueryを使うとかなり簡単にページ内スクロールが実装できるのですが、さらに<a href="http://gsgd.co.uk/sandbox/jquery/easing/">jQuery Easingプラグイン</a>と合わせるとなかなか面白い動きができたりします。</p>
					<p>というわけで誰でも簡単に導入できるようにプラグインにしました。以前に<a href="http://5509.me/2008/12/25/slidescrolljs.html">slideScroll.js</a>(<a href="http://5509.me/2008/12/23/jqueryslidescrolljs.html">jQueryプラグイン版</a>）というページ内スクロールの記事を書きましたが、悲しいことに断然こちらのほうがおすすめです。動きが滑らか…そして自分の好きな動きから選べます。</p>
					<p>今回は<a href="#explanation">ソースの解説</a>もしてるので、興味のある人は見てみてください。</p>
					<p>ページ内スクロールプラグインなのに、7KBもあるのはEasingプラグインの容量が5KBだから…これを機に他のアニメーション部分でもEasingプラグインも使うと一石二鳥になったりしますのでぜひ。</p>
					<p>サンプルのセレクトボックスでEasingを選んで右の入力欄にDurationを入れて確認できます。<br />
					そもそもEasingが何かわからない人も、とりあえず左のセレクトボックスの値を変えて、右のテキストボックスには800あたりを入力して、中央のナビゲーションリンクをクリックしてみてください。</p>
					<p>おすすめをちょっとあげてみます。（右の数字はDuration）</p>
					<ul>
					<li>easeOutBounce, 800</li>
					<li>easeInOutExpo, 600</li>
					<li>easeOutElastic, 800</li>
					</ul>
					<p>具体的な動きの違いは<a href="http://semooh.jp/jquery/">jQuery日本語リファレンス</a>の<a href="http://semooh.jp/jquery/cont/doc/easing/">Easingページ</a>で確認できます。</p>
					<p><span id="more-1165"></span></p>
					<h2>トピックス</h2>
					<ul>
					<li><a href="#download">ダウンロード</a></li>
					<li><a href="#install">導入方法</a></li>
					<li><a href="#setting">設定</a></li>
					<li><a title="jQuery.seletable.jsサンプルへのリンク" href="http://5509.me/sample/easingScroll/">サンプル</a></li>
					<li><a href="#method">仕様など</a></li>
					<li><a href="#browser">動作環境</a></li>
					<li><a href="#explanation">ソース解説</a></li>
					</ul>
					<h2 id="download">ダウンロード</h2>
					<dl>
					<dt>JSのみ</dt>
					<dd><a href="http://5509.me/sample/easingScroll/js/jquery.easingscroll.js">jquery.easingscroll.js</a>(7KB)</dd>
					<dt>サンプルファイル</dt>
					<dd><a href="http://5509.me/sample/archive/easingScroll.zip">easingScroll.zip</a>(26KB)</dd>
					</dl>
					<h2 id="install">導入方法</h2>
					<pre name="code" class="html">

&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery.easingscroll.js&quot;&gt;&lt;/script&gt;
</pre>
					<p>HEAD内でスクリプトファイルを読み込んで、そのあと</p>
					<pre name="code" class="html">

&lt;script type=&quot;text/javascript&quot;&gt;
$(function(){
&nbsp;&nbsp;$(&quot;a[href=&#039;#&#039;]&quot;).easingScroll();
});
&lt;/script&gt;
</pre>
					<p>というように実行します。</p>
					<h2 id="setting">設定</h2>
					<p>実行時のプロパティではEasingとDurationが設定できます。また<a href="http://gsgd.co.uk/sandbox/jquery/easing/">jQuery Easingプラグイン</a>を内包しているので、<a href="#easingPp">さまざまなEasing</a>を利用できます。</p>
					<p>Easingは動き、Durationはアニメーションが始まって終わるまでの時間（ミリセカンド==msec）です。durationには&#8221;slow&#8221;(610msec), &#8220;normal&#8221;(410msec), &#8220;fast&#8221;(210msec)も指定できます。</p>
					<pre name="code" class="js">

$(&quot;a[href=&#039;#&#039;]&quot;).easingScroll({
&nbsp;&nbsp;easing: &quot;easeInQuad&quot;,
&nbsp;&nbsp;duration: 700
});
</pre>
					<h3 id="easingPp">指定できるEasing</h3>
					<p>linear, swing, jswing<br />
					easeInQuad, easeOutQuad, easeInOutQuad<br />
					easeInCubic, easeOutCubic, easeInOutCubic<br />
					easeInQuart, easeOutQuart, easeInOutQuart<br />
					easeInSine, easeOutSine, easeInOutSine<br />
					easeInExpo, easeOutExpo, easeInOutExpo<br />
					easeInCirc, easeOutCirc, easeInOutCirc<br />
					easeInElastic, easeOutElastic, easeInOutElastic<br />
					easeInBack, easeOutBack, easeInOutBack<br />
					easeInBounce, easeOutBounce, easeInOutBounce</p>
					<p>どういう動きかは<a href="http://semooh.jp/jquery/cont/doc/easing/">jQuery日本語リファレンスEasingページ</a>か<a href="http://5509.me/sample/easingScroll/">サンプル</a>で確認できます。</p>
					<p>easeIn~は始まりに~のエフェクトが入り、easeOut~はその逆で終わりにエフェクトがかかります。easeInBounceなら始まりに跳ねて、easeOutBounceは終わりに跳ねます。easeInOutBounceは文字通り両方に跳ねます。</p>
					<h2 id="method">仕様など</h2>
					<ul>
					<li>アニメーション時にドキュメントをクリックするとアニメーションが止まります。</li>
					<li>jQuery1.3.xから後方互換モードに正式に非対応になったため、後方互換モードには対応してません。</li>
					</ul>
					<h2 id="browser">動作環境</h2>
					<ul>
					<li>IE6（後方互換モードは未確認）（サンプルは確認できませんが動作はします）</li>
					<li>IE7</li>
					<li>Firefox3</li>
					<li>Opera9.5</li>
					<li>Safari3</li>
					<li>Chrome1.0</li>
					</ul>
					<h2 id="explanation">ソース解説</h2>
					<p>jQueryでページ内スクロールを実装する事自体はとても簡単で、HREF属性に&#8221;#&#8221;を持ったA要素をクリック</p>
					<pre name="code" class="js">

$(&quot;a[href*=&#039;#&#039;]&quot;).click(function(){});
</pre>
					<p>したときにまず</p>
					<pre name="code" class="js">

var c = $(this.hash).offset();
</pre>
					<p>で、ドキュメント内$(&#8220;#ID&#8221;)のOffsetを取得して、その後は単純にanimate関数を使って</p>
					<pre name="code" class="js">

$(&quot;html,body&quot;).animate({
&nbsp;&nbsp;scrollTop: c.top,
&nbsp;&nbsp;scrollLeft: c.left
},{
&nbsp;&nbsp;easing: &quot;linear&quot;,
&nbsp;&nbsp;duration: 400
});
</pre>
					<p>ドキュメントの見えている部分を動かしているだけです。jQueryのanimate関数を使えばブラウザの高さ(幅)や現在位置の取得などが必要なく、目的位置をscrollTop(scrollLeft)で指定するだけです。</p>
					<p>ただ、boxModelによって実装が違うみたいでたとえば、後方互換モードは&#8221;body&#8221;、標準準拠モードは&#8221;html&#8221;の指定にするようです。なので一般的には&#8221;html,body&#8221;をまとめて指定することで解決できそうですが、Operaは&#8221;html,body&#8221;の両方指定にすると、不具合が出るので結局</p>
					<pre name="code" class="js">

var t = $.support.boxModel ? navigator.appName.match(/Opera/) ? &quot;html&quot; : &quot;html,body&quot; : &quot;body&quot;;
</pre>
					<p>というように、boxModelで分けて、さらにOperaの場合だけは&#8221;html&#8221;のみの指定としています。</p>
					<p>クリック判定の箇所などはドキュメント内に&#8221;#ID&#8221;を持った要素が存在しているか等を一度each関数でループさせてその中のifで判断して、残ったものだけにclick関数でイベント登録しています。</p>
					<p>さらにそのままだと連続して&#8221;#ID&#8221;を含むA要素をクリックしたときに、アニメーションキューがたまっていってラグが発生するので、A要素クリック時には</p>
					<pre name="code" class="js">

$(&quot;html,body&quot;).queue([]).stop();
</pre>
					<p>でアニメーションキューを削除して、現在のアニメーションをストップさせてます。fadeIn(Out)などでもキューはたまっていくので動きが鬱陶しい感じになった場合はfadeを登録した要素に</p>
					<pre name="code" class="js">

$(elm).queue([]).stop();
</pre>
					<p>してみるとすっきりするかもしれません。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/page-scrolling-with-jqueryeasing/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CSS Nite in OSAKA, Vol.14に参加させて頂きました。</title>
		<link>http://5509.me/log/css-nite-in-osaka-14-over</link>
		<comments>http://5509.me/log/css-nite-in-osaka-14-over#comments</comments>
		<pubDate>Mon, 20 Apr 2009 09:16:36 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[Diary]]></category>
		<category><![CDATA[note]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1109</guid>
		<description><![CDATA[					
					もう先週の火曜日になるのですが、CSS Nite in OSAKA, vol.14に参加させていただきました。
					そうです、この記事、今更感がいなめません…WordPressの記事を書く前に [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://cssnite.jp/archives/post_1492.html"><img src="http://pencil-jp.net/weblog/data/090316/icon_cssnite_osaka14.jpg" alt="CSS Nite in OSAKA, Vol.14のバナー" /></a></p>
					<p>もう先週の火曜日になるのですが、CSS Nite in OSAKA, vol.14に参加させていただきました。<br />
					そうです、この記事、今更感がいなめません…WordPressの記事を書く前にこっちを書けよという声が…</p>
					<p>言い訳としては、WordPressの記事、あれは2日くらい前からの予約投稿だったんですね。<br />
					あ、こっちを予約しとけよ、という話ですかｗ</p>
					<p>とにかくスタッフの皆様、僕のセッションを見てくださった方、お疲れ様でした・ありがとうございました！<br />
					反省する点もいろいろとありましたが、非常にいい機会になりました。なにより楽しかったです。</p>
					<p>淡々と話をしているように見えたかもしれませんが、僕の中では色々な盛り上がりなどがあったんですｗ<br />
					その後の懇親会では印象が違いますね、と言われたりもしました…まったくそのとおりです笑</p>
					<p><a href="http://cssnite.jp/archives/post_1492.html">CSS Niteのフォローアップ記事</a>からも見れますが、当日のスライドのリンクを残しておきます。</p>
					<ul>
					<li><a href="http://5509.me/cssnite14/">jQueryプラグインを利用してユーザーフレンドリーなフォームを設計しよう</a></li>
					</ul>
					<p>ついでにjQuery.validation.jsの記事も…</p>
					<ul>
					<li><a href="http://5509.me/2008/08/22/realtimeformvalidation.html">jQuery.validation.js</a></li>
					</ul>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/css-nite-in-osaka-14-over/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery.validation.jsのアップデート</title>
		<link>http://5509.me/log/jqueryvalidationjs-updated4</link>
		<comments>http://5509.me/log/jqueryvalidationjs-updated4#comments</comments>
		<pubDate>Mon, 20 Apr 2009 05:26:53 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[note]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1104</guid>
		<description><![CDATA[					jQuery.validation.js
					一部対応が遅くなってしまいましたが、修正・更新をしました。
					前回まではjQuery1.2.6を同梱してましたが、今回から1.3.2を同梱してます。
 [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://5509.me/2008/08/22/realtimeformvalidation.html">jQuery.validation.js</a></p>
					<p>一部対応が遅くなってしまいましたが、修正・更新をしました。<br />
					前回まではjQuery1.2.6を同梱してましたが、今回から1.3.2を同梱してます。<br />
					主な修正・更新箇所は以下になります。</p>
					<ul>
					<li>AjaxZip2の指定方法を間違っていたので修正しました。</li>
					<li>Dialogを使わずにSUBMITボタンをDISABLEDにするオプションを追加しました。</li>
					<li>Safariで必須チェックが一番上にきていなかったので修正しました。</li>
					<li>Webkit系でdocumentを一度クリックするまで固まる不具合がありましたが、jQueryを1.3以降に更新することで解消されます。</li>
					</ul>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/jqueryvalidationjs-updated4/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CMSとしてのWordPressでサイト構築をするときに便利な13のプラグイン</title>
		<link>http://5509.me/log/using-wordpress-as-cms</link>
		<comments>http://5509.me/log/using-wordpress-as-cms#comments</comments>
		<pubDate>Wed, 15 Apr 2009 21:23:35 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[WebDev]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[まとめ]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1018</guid>
		<description><![CDATA[					MTをサイト構築に採用するケースは非常に多いと思いますが
					WordPressをサイト構築に採用するケースはあまりないんじゃないでしょうか？
					確かにWordPress単体ではCMSとしてはちょ [...]]]></description>
			<content:encoded><![CDATA[					<p>MTをサイト構築に採用するケースは非常に多いと思いますが<br />
					WordPressをサイト構築に採用するケースはあまりないんじゃないでしょうか？</p>
					<p>確かにWordPress単体ではCMSとしてはちょっと足りない機能が多いです。<br />
					そこでWordPressをブログではなくCMSとしてサイトを構築をするときに便利なプラグインを紹介します。<br />
					というかただの個人的なまとめです。</p>
					<p><span id="more-1018"></span></p>
					<h3><a href="http://www.tinybeans.net/blog/download/wp-plugin/cfg-utility-100.html">Custom Field GUI Utility</a></h3>
					<p><a href="http://www.tinybeans.net/blog/download/wp-plugin/cfg-utility-100.html"><img class="alignnone size-full wp-image-1060" title="Custom Field GUI Utility" src="http://5509.me/wp-content/uploads/2009/04/uw_03.gif" alt="Custom Field GUI Utilityキャプチャ" width="450" height="207" /></a></p>
					<p>カスタムフィールドを便利に使うプラグイン。</p>
					<p>これはかなりおすすめというかCMSとして使う場合は必須と言えるくらい便利。<br />
					MTにはカスタムフィールドという便利なものがあります。<br />
					WordPressにも一応あるにはあるんですがこれが使いにくい…<br />
					そんな不満を解決してくれるプラグイン。</p>
					<h3><a href="http://hello.lumiere-couleur.com/light_formatter/">Light Formatter</a></h3>
					<p><a href="http://hello.lumiere-couleur.com/light_formatter/"><img class="alignnone size-full wp-image-1064" title="Light Formatter" src="http://5509.me/wp-content/uploads/2009/04/uw_04.gif" alt="Light Formatter" width="450" height="207" /></a></p>
					<p>テーブルをPukiWiki記法のように書くことができるようになるプラグイン。<br />
					会社概要などの簡単なテーブルを使うときに便利。</p>
					<h3><a href="http://wordpress.org/extend/plugins/duplicate-post/">Duplicate-Post</a></h3>
					<p><a href="http://wordpress.org/extend/plugins/duplicate-post/"><img class="alignnone size-full wp-image-1073" title="Duplicate-Post" src="http://5509.me/wp-content/uploads/2009/04/uw_111.gif" alt="Duplicate-Post" width="450" height="207" /></a></p>
					<p>記事やページのコピーを作成するプラグイン。<br />
					同じ形式の記事やページを書くときに。</p>
					<h3><a href="http://www.laptoptips.ca/projects/tinymce-advanced/">TinyMCE Advanced</a></h3>
					<p><a href="http://www.laptoptips.ca/projects/tinymce-advanced/"><img class="alignnone size-full wp-image-1074" title="TinyMCE Advanced" src="http://5509.me/wp-content/uploads/2009/04/uw_12.gif" alt="TinyMCE Advanced" width="450" height="207" /></a></p>
					<p>記事（ページ）を書く時のエディタ（TinyMCE）をカスタマイズするプラグイン。<br />
					サイト更新に必要な項目だけを表示しておけば、きっとクライアントも更新しやすくなります。</p>
					<h3><a href="http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/">All in One SEO Pack</a></h3>
					<p><a href="http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/"><img class="alignnone size-full wp-image-1065" title="All in One SEO Pack" src="http://5509.me/wp-content/uploads/2009/04/uw_05.gif" alt="All in One SEO Packキャプチャ" width="450" height="207" /></a></p>
					<p>これなしにはWordPressが始まらないAll in One SEO Pack。<br />
					タイトル、各メタなどを最適化します。</p>
					<h3><a href="http://urbangiraffe.com/plugins/redirection/">Redirection</a></h3>
					<p><a href="http://urbangiraffe.com/plugins/redirection/"><img class="alignnone size-full wp-image-1054" title="Redirection" src="http://5509.me/wp-content/uploads/2009/04/uw_01.gif" alt="Redirectionキャプチャ" width="450" height="207" /></a></p>
					<p>指定したURIへのアクセスを任意のURIにリダイレクトするプラグイン。<br />
					サイトをリニューアルした際などに、ディレクトリ構成と一緒にURIが変わってしまうことがありますよね？<br />
					そういう場合に便利です。</p>
					<h3><a href="http://wordpress.org/extend/plugins/nice-trailingslashit/">Nice Trailingslashit</a></h3>
					<p><a href="http://wordpress.org/extend/plugins/nice-trailingslashit/"><img class="alignnone size-full wp-image-1061" title="Nice Trailingslashit" src="http://5509.me/wp-content/uploads/2009/04/uw_021.gif" alt="Nice Trailingslashitキャプチャ" width="450" height="207" /></a></p>
					<p>WordPressではページURIはデフォルトで http://5509.me/about  というようになるのですが<br />
					末尾にスラッシュを付加するプラグイン。スラッシュがないと気持ち悪いという人向け。</p>
					<h3><a href="http://wordpress.org/extend/plugins/stats/">WordPress.com Stats</a></h3>
					<p><a href="http://wordpress.org/extend/plugins/stats/"><img class="alignnone size-full wp-image-1067" title="WordPress.com Stats" src="http://5509.me/wp-content/uploads/2009/04/uw_06.gif" alt="WordPress.com Stats" width="450" height="207" /></a></p>
					<p>アクセス解析はGoogle Analyticsを使っていますが<br />
					Statsを使えば管理画面内に解析結果を表示することができます。</p>
					<p class="note">追記：StatsはGAとは別のアクセス解析です。ややこしくしてしまってすいません。。</p>
					<h3><a href="http://ocaoimh.ie/wp-super-cache/">WP Super Cache</a></h3>
					<p><a href="http://ocaoimh.ie/wp-super-cache/"><img class="alignnone size-full wp-image-1068" title="WP Super Cache" src="http://5509.me/wp-content/uploads/2009/04/uw_07.gif" alt="WP Super Cache" width="450" height="207" /></a></p>
					<p>全てのページをキャッシュ（静的HTML）としてサーバに保存しておき<br />
					アクセス時のレスポンス向上、サーバへの負荷を軽減するプラグイン。</p>
					<h3><a href="http://sw-guide.de/wordpress/plugins/maintenance-mode/">Maintenance Mode Plugin</a></h3>
					<p><a href="http://sw-guide.de/wordpress/plugins/maintenance-mode/"><img class="alignnone size-full wp-image-1071" title="Maintenance Mode" src="http://5509.me/wp-content/uploads/2009/04/uw_10.gif" alt="Maintenance Mode" width="450" height="207" /></a></p>
					<p>メンテナンス中を表示するプラグイン。<br />
					ログインしている場合は表示されずにサイトの確認ができます。</p>
					<h3><a href="http://www.dagondesign.com/articles/sitemap-generator-plugin-for-wordpress/">Sitemap Generator Plugin</a></h3>
					<p><a href="http://www.dagondesign.com/articles/sitemap-generator-plugin-for-wordpress/"><img class="alignnone size-full wp-image-1069" title="Dagon Design Sitemap Generator" src="http://5509.me/wp-content/uploads/2009/04/uw_08.gif" alt="Dagon Design Sitemap Generator" width="450" height="207" /></a></p>
					<p>投稿記事やページからサイトマップページを生成するプラグイン。</p>
					<h3><a href="http://www.arnebrachhold.de/2005/06/05/google-sitemaps-generator-v2-final">Google Sitemap Generator</a></h3>
					<p><a href="http://www.arnebrachhold.de/2005/06/05/google-sitemaps-generator-v2-final"><img class="alignnone size-full wp-image-1070" title="Google Sitemap Generator" src="http://5509.me/wp-content/uploads/2009/04/uw_09.gif" alt="Google Sitemap Generator" width="450" height="207" /></a></p>
					<p>こちらはGoogle Webmaster Centralなどを利用する際に必要なsitemap.xmlを生成するプラグイン。</p>
					<h3><a href="http://www.ilfilosofo.com/blog/wp-db-backup">WP-DB-Backup</a></h3>
					<p><a href="http://www.ilfilosofo.com/blog/wp-db-backup"><img class="alignnone size-full wp-image-1075" title="WP-DB-Backup" src="http://5509.me/wp-content/uploads/2009/04/uw_13.gif" alt="WP-DB-Backup" width="450" height="207" /></a></p>
					<p>最後は記事などのバックアップを取るプラグインです。<br />
					定期的にバックアップを指定メールアドレスに送ったりできます。</p>
					<p>他にも外せないプラグインなどあれば教えてください <img src='http://5509.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/using-wordpress-as-cms/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>シンプルなインターフェースで実装するHTMLのスライド simpleSlide.js</title>
		<link>http://5509.me/log/simpleslidejs</link>
		<comments>http://5509.me/log/simpleslidejs#comments</comments>
		<pubDate>Tue, 14 Apr 2009 10:00:07 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=1030</guid>
		<description><![CDATA[					
					simpleSlideを使えば誰でも簡単にHTMLスライドを導入できます。
					ファイルをダウンロードする
					
					simpleSlide.zip(23KB)
					
			 [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://5509.me/sample/simpleslide/"><img class="alignnone size-full wp-image-1032" title="simpleslide" src="http://5509.me/wp-content/uploads/2009/04/simpleslide.gif" alt="simpleslide" width="216" height="150" /></a></p>
					<p>simpleSlideを使えば誰でも簡単にHTMLスライドを導入できます。</p>
					<h2>ファイルをダウンロードする</h2>
					<ul>
					<li><a href="http://5509.me/sample/archive/simpleslide.zip">simpleSlide.zip(23KB)</a></li>
					</ul>
					<h2>要素をマークアップする</h2>
					<p>simpleSlideではマークアップに決まりがありますが非常に単純です。</p>
					<h3>ページを分ける</h3>
					<p>1つのdiv.sectionが1つのスライドページに相当します。</p>
					<pre name="code" class="html">

&lt;div class=&quot;section&quot;&gt;
&lt;/div&gt;
</pre>
					<h3>ページにタイトルを付ける</h3>
					<p>スライドページには必ずひとつのタイトルが必要です。<br />
					div.section直下の子要素はHN要素にします。</p>
					<pre name="code" class="html">

&lt;div class=&quot;section&quot;&gt;
&nbsp;&nbsp;&lt;h2&gt;これがタイトルになる&lt;/h2&gt;
&lt;/div&gt;
</pre>
					<p class="note">HN要素じゃなくてもいいんですが<br />
					とりあえずdiv.section &gt; * のテキストがタイトルとして扱われます。</p>
					<p>あとは適当に要素を入れていきます。<br />
					blockquoteとかpreとかその辺のスタイルは指定してないので<br />
					使う場合はCSSに追加してください。</p>
					<pre name="code" class="html">

&lt;div class=&quot;section&quot;&gt;
&nbsp;&nbsp;&lt;h2&gt;これがタイトルになる&lt;/h2&gt;
&nbsp;&nbsp;&lt;p&gt;テキストテキスト&lt;/p&gt;
&nbsp;&nbsp;&lt;ul&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;リストリスト&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;リストリスト&lt;/li&gt;
&nbsp;&nbsp;&lt;/ul&gt;
&lt;/div&gt;
</pre>
					<h2>必要なファイルを読み込む</h2>
					<pre name="code" class="html">

&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;css/simpleslide.css&quot; /&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/simpleslide.js&quot;&gt;&lt;/script&gt;
</pre>
					<h2>だけです。</h2>
					<p><a href="http://5509.me/sample/simpleslide/">こんな感じになります。</a></p>
					<h2>操作方法など</h2>
					<p>これまた簡単です。<br />
					ドキュメント上をクリックするとスライドを進めたり戻したりできます。<br />
					また矢印キーやスワイプでも操作できます。</p>
					<ul>
					<li> クリックはドキュメントの右半分なら進む、左なら戻る。</li>
					<li>矢印キーは↑・←は戻る、→・↓は進む。</li>
					<li>Macの場合は上スワイプは戻る、下スワイプは進む。</li>
					<li>メニューをクリックするとタイトル一覧が表示されて好きなスライドに移動できます。</li>
					<li>Back To Titleからいつでもタイトルスライドに戻れます。</li>
					</ul>
					<p>細かいところでは</p>
					<ul>
					<li>タイトルスライドは #slide-0 で数字部分が増えていきます。</li>
					<li>#slide-X をURI末尾に付けて呼び出すと対象のスライドで開けます。</li>
					<li>#slide-X の Xは(下部に表示されているスライドページナンバー -1)になります。</li>
					<li>タイトルはスライドのタイトルを付加したものに書き換えられます。</li>
					</ul>
					<h2>対応ブラウザ</h2>
					<p>IEには対応してません。。。<br />
					CSSのround-borderプロパティを使ってるので正式な対応ブラウザは以下だけです。</p>
					<ul>
					<li>Firefox3</li>
					<li>Safari3</li>
					</ul>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/simpleslidejs/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSS Nite in OSAKA, Vol.14に出演させて頂くことになりました</title>
		<link>http://5509.me/log/css-nite-osaka-14</link>
		<comments>http://5509.me/log/css-nite-osaka-14#comments</comments>
		<pubDate>Fri, 20 Mar 2009 03:43:32 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[Diary]]></category>
		<category><![CDATA[note]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=994</guid>
		<description><![CDATA[					
					自分でも実感が湧かないのですが、、、
					CSS Nite in OSAKAに出演させていただくことになりました。
					（先月から決まっていたのですけれど報告が遅れてしまいました。）
	 [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://cssnite.jp/osaka/vol14/"><img src="http://pencil-jp.net/weblog/data/090316/icon_cssnite_osaka14.jpg" alt="CSS Nite in OSAKA, Vol.14のバナー" /></a></p>
					<p>自分でも実感が湧かないのですが、、、<br />
					CSS Nite in OSAKAに出演させていただくことになりました。<br />
					（先月から決まっていたのですけれど報告が遅れてしまいました。）</p>
					<p>予定している内容は<br />
					<strong> 「jQueryプラグインを使って使いやすいフォームを設計しよう」</strong>です。</p>
					<p>jQueryプラグインと言ってますが<br />
					一般的に使いやすいフォームを作るためのマークアップから<br />
					プラグインの使い方までを紹介できればと思っています。<strong><br />
					</strong></p>
					<p>ちなみに人前で喋る、とかそういった類いのことをほとんどしたことがなくて<br />
					すでにガチガチに緊張してます…</p>
					<p>そういえば結婚式後にあった親族会食の挨拶で盛大に噛んだなぁ…<br />
					一度噛むとその後はもう噛みの連鎖でそれはもうすごいことに…笑</p>
					<p><strong>落ち着いてゆっくり喋り</strong>、というアドバイスを妻からもらいました。<br />
					まさにその通り…いや分かってはいるんやけど興奮すると。。</p>
					<p>こんな滑舌の悪い僕ですが、よければ応援にきてください:D</p>
					<div class="note">
					<p><strong>CSS Nite in OSAKA, Vol. 14</strong><br />
					4月14日（火）、19:00-20:30、アップルストア心斎橋2F<br />
					<a href="http://cssnite.jp/osaka/vol14/">http://cssnite.jp/osaka/vol14/</a></p>
					<p>参加表明はmixiコミュニティから：<br />
					<a href="http://mixi.jp/view_event.pl?id=39225485&amp;comment_count=19&amp;comm_id=1118970">http://mixi.jp/view_event.pl?id=39225485&amp;comment_count=19&amp;comm_id=1118970</a></div>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/css-nite-osaka-14/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>jQueryを使ってNews Tickerプラグインを作ってみよう[後編]</title>
		<link>http://5509.me/log/newsticker2</link>
		<comments>http://5509.me/log/newsticker2#comments</comments>
		<pubDate>Sun, 15 Mar 2009 16:46:40 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[tuts]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=957</guid>
		<description><![CDATA[					前編でニュースティッカーができたので 後編ではjQueryプラグインにしてみましょう。
					jQueryを使ってNews Tickerプラグインを作ってみよう[前編]
					
					jQueryを [...]]]></description>
			<content:encoded><![CDATA[					<h2>前編でニュースティッカーができたので 後編ではjQueryプラグインにしてみましょう。</h2>
					<h3><strong>jQueryを使ってNews Tickerプラグインを作ってみよう[前編]</strong></h3>
					<ul>
					<li><a title="jQueryを使ってNews Tickerプラグインを作ってみよう[前編][1]" href="../2009/03/09/newsticker1-1.html">jQueryを使ってNews Tickerプラグインを作ってみよう[前編][1]</a></li>
					<li><a title="jQueryを使ってNews Tickerプラグインを作ってみよう[前編][2]" href="../2009/03/10/newsticker1-2.html">jQueryを使ってNews Tickerプラグインを作ってみよう[前編][2]</a></li>
					</ul>
					<p>jQueryプラグインのメリットは</p>
					<ul>
					<li>要素をjQueryのメソッドチェーンで繋いで実行できる</li>
					<li>オプション項目の指定が簡単にできる</li>
					</ul>
					<p>といったところでしょうか。</p>
					<p><span id="more-957"></span></p>
					<h2>前回作成したnewsFaderメソッドをより汎用的なものにする</h2>
					<p>前回、前々回で以下のnewsFaderメソッドを作成しました。</p>
					<p class="note">ところでnewsFaderとnewsTickerを間違えて記述していたので<br />
					プラグインはnewsTickerにして作成します。</p>
					<pre name="code" class="js">

function newsFader(){
&nbsp;&nbsp;if($(&quot;li&quot;,&quot;div#newsTicker ul&quot;).length==1) return false;

&nbsp;&nbsp;$(&quot;li&quot;,&quot;div#newsTicker ul&quot;).each(function(i){
&nbsp;&nbsp;&nbsp;&nbsp;$(this).attr(&quot;id&quot;,&quot;news-&quot;+i);
&nbsp;&nbsp;&nbsp;&nbsp;if(i!=0) $(this).hide();
&nbsp;&nbsp;});

&nbsp;&nbsp;var start = count = 0,
&nbsp;&nbsp;&nbsp;&nbsp;end = $(&quot;li&quot;,&quot;div#newsTicker ul&quot;).length-1,
&nbsp;&nbsp;&nbsp;&nbsp;interval = 1500,
&nbsp;&nbsp;&nbsp;&nbsp;fadeTimer = setInterval(function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;li#news-&quot;+(start==1 ? count==0 ? end : count-1 : count)).hide();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;#news-&quot;+(start==1 ? (++count)-1 : ++count)).fadeIn(&quot;slow&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(start==0 ＆＆ count&gt;=end){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;count = 0;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;start = 1;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}else if(start==1 ＆＆ count&gt;end){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;count = 0;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;},interval);
}
newsFader();
</pre>
					<h3>汎用性を持たせる</h3>
					<p>まずは newsFaderメソッドに記述している<br />
					<strong>要素$(&#8220;li&#8221;,&#8221;div#newsTicker ul&#8221;)</strong>、<strong>切り替えの間隔interval</strong>、<strong>フェードアウトの速度&#8221;slow&#8221;</strong><br />
					を引数指定で実行時できるようにします。</p>
					<p class="note"><strong>$(&#8220;li&#8221;,&#8221;div#newsTicker ul&#8221;) は $(&#8220;div#newsTicker ul li&#8221;) と同じ意味</strong>です。<br />
					どの要素を指定しているか分かりやすくするために前者のように記述しています。</p>
					<pre name="code" class="js">

function newsFader(elm,fadeSpeed,fadeInterval){
&nbsp;&nbsp;if(elm.length==1) return false;

&nbsp;&nbsp;elm.each(function(i){
&nbsp;&nbsp;&nbsp;&nbsp;$(this).attr(&quot;id&quot;,&quot;news-&quot;+i);
&nbsp;&nbsp;&nbsp;&nbsp;if(i!=0) $(this).hide();
&nbsp;&nbsp;});

&nbsp;&nbsp;var start = count = 0,
&nbsp;&nbsp;&nbsp;&nbsp;end = elm.length-1,
&nbsp;&nbsp;&nbsp;&nbsp;fadeTimer = setInterval(function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;#news-&quot;+(start==1 ? count==0 ? end : count-1 : count)).hide();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;#news-&quot;+(start==1 ? (++count)-1 : ++count)).fadeIn(fadeSpeed);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(start==0 ＆＆ count&gt;=end){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;count = 0;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;start = 1;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}else if(start==1 ＆＆ count&gt;end){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;count = 0;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;},fadeInterval);
}
</pre>
					<p>上記のように書き換えることで <strong>3つの項目を実行時に引数で指定できる</strong>ようになりました。</p>
					<p class="note">fadeTimer の最初の行で li#news- となっていましたが<br />
					li が入っていると LI要素にしか適用できないので、汎用性を持たせるために li を消去しています。</p>
					<pre name="code" class="js">

newsFader($(&quot;li&quot;,&quot;div#newsTicker ul&quot;),&quot;fast&quot;,1000);
</pre>
					<p>のように実行できます。<br />
					ここまでを前回の記事に含めればよかった…</p>
					<p><a href="http://5509.me/sample/newsTicker/rev5.html">サンプル（引数指定）</a></p>
					<h2>メソッドチェーン</h2>
					<p>jQueryではメソッドチェーンでメソッドを繋いでいくようにコードを書いて行きますが<br />
					ところでメソッドチェーンとは何でしょうか。</p>
					<blockquote><p>これは、それぞれのjQueryオブジェクトのメソッドの戻り値の多くがjQueryオブジェクトになっているからです。 つまり、使いたいメソッドを「.」でつないでいくだけで、まるでレゴを組み立てるようにプログラムが書きあがるというわけです。</p>
					<p>これは、メソッドチェーンと呼ばれている仕組みです。</p>
					<p><cite>via: All About &#8211; <a href="http://allabout.co.jp/internet/javascript/closeup/CU20071020A/">jQueryの魔法</a></cite></p></blockquote>
					<p>まずjQueryプラグインを作るにあたって<br />
					指定の要素にメソッドチェーンで繋ぐことができる状態をつくります。</p>
					<pre name="code" class="js">

$.fn.メソッド = function(){}
</pre>
					<p>上記のように $.fn.メソッド とすることで任意の$()で渡した要素に対して<br />
					メソッドを実行できるようになります。</p>
					<p>具体的には $() の要素をメソッド内で<br />
					<strong>this</strong> として扱うことができるようになります。</p>
					<p>下のような拡張メソッドを作成して実際に実行してみましょう。</p>
					<pre name="code" class="js">

$.fn.sampleChain = function(){
&nbsp;&nbsp;alert(this.length);
}
</pre>
					<p>最初なので単純に渡した要素の長さをアラートで表示するだけのものです。<br />
					これを実行してみます。</p>
					<p>jQueryのメソッドを実行するときは</p>
					<pre name="code" class="js">

$(function(){});
</pre>
					<p>の中に記述すればいいだけなので</p>
					<pre name="code" class="js">

$(function(){
&nbsp;&nbsp;$(&quot;p&quot;).sampleChain();
});
</pre>
					<p>で実行できます。<br />
					<a href="http://5509.me/sample/newsTicker/rev6.html">サンプル（メソッドチェーンサンプル）</a></p>
					<p>サンプルHTMLにはP要素は3つ含まれているので<br />
					<strong>アラートの中には 3 と表示されます。</strong></p>
					<h2>プラグインにする</h2>
					<p>メソッドチェーンでは親になっている要素をthisとして渡すことができるので</p>
					<h3>これにもとづいて newsFaderメソッドを $.fn.newsTickerメソッドに書き換えると…</h3>
					<pre name="code" class="js">

$.fn.newsTicker(fadeSpeed,fadeInterval){
&nbsp;&nbsp;if(this.length==1) return false;

&nbsp;&nbsp;this.each(function(i){
&nbsp;&nbsp;&nbsp;&nbsp;$(this).attr(&quot;id&quot;,&quot;news-&quot;+i);
&nbsp;&nbsp;&nbsp;&nbsp;if(i!=0) $(this).hide();
&nbsp;&nbsp;});

&nbsp;&nbsp;var start = count = 0,
&nbsp;&nbsp;&nbsp;&nbsp;end = this.length-1,
&nbsp;&nbsp;&nbsp;&nbsp;fadeTimer = setInterval(function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;#news-&quot;+(start==1 ? count==0 ? end : count-1 : count)).hide();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;#news-&quot;+(start==1 ? (++count)-1 : ++count)).fadeIn(fadeSpeed);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(start==0 ＆＆ count&gt;=end){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;count = 0;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;start = 1;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}else if(start==1 ＆＆ count&gt;end){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;count = 0;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;},interval);
}
</pre>
					<p>となります。<strong>引数で渡していたelmがthisとして渡せる</strong>ようになっています。<br />
					これを実行する場合は</p>
					<pre name="code" class="js">

$(&quot;li&quot;,&quot;div#newsTicker ul&quot;).newsTicker(&quot;fast&quot;,1000);
</pre>
					<p><a href="http://5509.me/sample/newsTicker/rev7.html">サンプル（プラグイン化）</a></p>
					<p>となります。jQueryらしくなってきました。</p>
					<h3>次は残りの変数をオプションとして扱えるようにしてみましょう。</h3>
					<p>上のメソッドでは fadeSpeed、fadeIntervalを指定しない限りエラーを返すので<br />
					指定しない場合は何かデフォルトの値が入っているようにしてみます。</p>
					<pre name="code" class="js">

$.fn.newsTicker(options){

&nbsp;&nbsp;var c = $.extend({
&nbsp;&nbsp;&nbsp;&nbsp;interval: 3500,
&nbsp;&nbsp;&nbsp;&nbsp;fade: 1000
&nbsp;&nbsp;},options);
</pre>
					<p>他の箇所は省いていますが、上記のようにすることで<br />
					デフォルトの値を設定することができます。</p>
					<p>これらの変数は c.interval、c.fadeのように変数cのプロパティとして参照できます。<br />
					また</p>
					<pre name="code" class="js">

$(&quot;li&quot;,&quot;div#newsTicker ul&quot;).newsTicker({
&nbsp;&nbsp;interval: 1500,
&nbsp;&nbsp;fade: &quot;slow&quot;
});
</pre>
					<p>のように実行時にnewsTickerメソッドの引数にハッシュで値を渡すことで<br />
					任意の値で実行することができます。</p>
					<p>fadeはjQueryのfadeInメソッドを使っているので<br />
					値にはミリセカンド、&#8221;slow&#8221;、&#8221;normal&#8221;、&#8221;fast&#8221;をとることができます。</p>
					<h3>以下が完成したnewsTickerメソッドです。</h3>
					<pre name="code" class="js">

$.fn.newsTicker = function(options){

&nbsp;&nbsp;var c = $.extend({
&nbsp;&nbsp;&nbsp;&nbsp;interval: 3500,
&nbsp;&nbsp;&nbsp;&nbsp;fade: 1000
&nbsp;&nbsp;},options);

&nbsp;&nbsp;if(this.length==1) return false;
&nbsp;&nbsp;this.each(function(i){
&nbsp;&nbsp;&nbsp;&nbsp;$(this).attr(&quot;id&quot;,&quot;newsFader-&quot;+i);
&nbsp;&nbsp;&nbsp;&nbsp;if(i!=0) $(this).hide();
&nbsp;&nbsp;});

&nbsp;&nbsp;var count = 0,
&nbsp;&nbsp;&nbsp;&nbsp;end = this.length-1,
&nbsp;&nbsp;&nbsp;&nbsp;fadeTimer = setInterval(function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;#news-&quot;+(start==1 ? count==0 ? end : count-1 : count)).hide();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;#news-&quot;+(start==1 ? (++count)-1 : ++count)).fadeIn(c.fade);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(count&gt;end) count = 0;
&nbsp;&nbsp;&nbsp;&nbsp;},c.interval);
}
</pre>
					<p>さっそく実行してみましょう。</p>
					<pre name="code" class="js">

$(&quot;li&quot;,&quot;div#news ul&quot;).newsTicker();
</pre>
					<p><a href="http://5509.me/sample/newsTicker/rev8.html">サンプル（完成）</a></p>
					<h2>応用</h2>
					<p>ところで気付いている人もいるかもしれませんが<br />
					このnewsTickerメソッドはニュースティッカー以外にも使えます。</p>
					<h3>スライドショーに使ってみる</h3>
					<p>たとえば</p>
					<pre name="code" class="xhtml">

&lt;div id=&quot;image&quot;&gt;
&nbsp;&nbsp;&lt;img src=&quot;slideImage01.jpg&quot; alt=&quot;&quot; /&gt;
&nbsp;&nbsp;&lt;img src=&quot;slideImage02.jpg&quot; alt=&quot;&quot; /&gt;
&nbsp;&nbsp;&lt;img src=&quot;slideImage03.jpg&quot; alt=&quot;&quot; /&gt;
&nbsp;&nbsp;&lt;img src=&quot;slideImage04.jpg&quot; alt=&quot;&quot; /&gt;
&lt;/div&gt;
</pre>
					<pre name="code" class="css">

div#image {
&nbsp;&nbsp;width: 500px;
&nbsp;&nbsp;height: 333px;
&nbsp;&nbsp;position: relative;
}
&nbsp;&nbsp;div#image img {
&nbsp;&nbsp;&nbsp;&nbsp;position: absolute;
&nbsp;&nbsp;&nbsp;&nbsp;top: 0;
&nbsp;&nbsp;&nbsp;&nbsp;left: 0;
&nbsp;&nbsp;}
</pre>
					<pre name="code" class="js">

$(&quot;img&quot;,&quot;div#image&quot;).newsTicker();
</pre>
					<p>のようにすれば 簡単にスライドショーを作ることができます。<br />
					実用性はアレですけど…</p>
					<p><a href="http://5509.me/sample/newsTicker/image.html">サンプル（スライドショー）</a></p>
					<h3>スライドショーに使ってみる2</h3>
					<p>このままだと 画像が切り替わるときに チラっと白くなるので<br />
					前の画像を非表示にするところに fadeOut を使うときれいに切り替わるようになります。</p>
					<p>hideをfadeOutに書き換えて、fadeOutの速度もオプションに追加します。</p>
					<pre name="code" class="js">

$.fn.newsTicker = function(options){

&nbsp;&nbsp;var c = $.extend({
&nbsp;&nbsp;&nbsp;&nbsp;interval: 3500,
&nbsp;&nbsp;&nbsp;&nbsp;out: 1000,
&nbsp;&nbsp;&nbsp;&nbsp;set: 1000
&nbsp;&nbsp;},options);

&nbsp;&nbsp;if(this.length==1) return false;
&nbsp;&nbsp;this.each(function(i){
&nbsp;&nbsp;&nbsp;&nbsp;$(this).attr(&quot;id&quot;,&quot;newsFader-&quot;+i);
&nbsp;&nbsp;&nbsp;&nbsp;if(i!=0) $(this).hide();
&nbsp;&nbsp;});

&nbsp;&nbsp;var count = 0,
&nbsp;&nbsp;&nbsp;&nbsp;end = this.length-1,
&nbsp;&nbsp;&nbsp;&nbsp;fadeTimer = setInterval(function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;#news-&quot;+(start==1 ? count==0 ? end : count-1 : count)).fadeOut(c.out);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;#news-&quot;+(start==1 ? (++count)-1 : ++count)).fadeIn(c.set);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(count&gt;end) count = 0;
&nbsp;&nbsp;&nbsp;&nbsp;},c.interval);
}
</pre>
					<p>これできれいに切り替わるようになりましたね。<br />
					<a href="http://5509.me/sample/newsTicker/image2.html">サンプル（スライドショー完成）</a></p>
					<p>ちなみに写真のワンコはうちのかわいい ゆに です。<br />
					誕生日にケーキをあげたら 口のまわりをクリームまみれになるくらい必死に食べてました。<br />
					かわいい…</p>
					<h2>まとめとサンプルファイルのzip</h2>
					<p>こんな感じでnewsTickerプラグインは他にも色々と応用できるかもしれないです。</p>
					<p>それはさておき 「<strong>jQueryプラグインの作成方法は結構簡単</strong>」<br />
					ということを伝えたかったのですが、いかがだったでしょうか？？？</p>
					<p>間違いなどあればコメント等で指摘していただけると助かります。</p>
					<p>今回のサンプルファイルをまとめたものをあげておきますので必要な方は自由に使ってください。<br />
					作成したプラグインもライセンスなしで自由に使えます。</p>
					<p><a href="http://5509.me/sample/archive/newsTicker.zip">newsTicker.zip(33KB)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/newsticker2/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>jQueryを使ってNews Tickerプラグインを作ってみよう[前編][2]</title>
		<link>http://5509.me/log/newsticker1-2</link>
		<comments>http://5509.me/log/newsticker1-2#comments</comments>
		<pubDate>Mon, 09 Mar 2009 18:00:26 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[tuts]]></category>

		<guid isPermaLink="false">http://moto-mono.net/2009/03/10/newsticker1-2.html</guid>
		<description><![CDATA[					前回までのおさらい。
					前回の記事
					まずは前回最後のサンプルを見てください。
					ここまでのサンプル（フェードを実行）
					サンプルを見ればわかるように
					ニュースティッカ [...]]]></description>
			<content:encoded><![CDATA[					<h2>前回までのおさらい。</h2>
					<p><a href="http://5509.me/2009/03/09/newsticker1-1.html">前回の記事</a></p>
					<p>まずは前回最後のサンプルを見てください。</p>
					<p><a href="http://5509.me/sample/newsTicker/rev3.html">ここまでのサンプル（フェードを実行）</a></p>
					<p>サンプルを見ればわかるように<br />
					ニュースティッカーの実装まではできましたが不具合があるようです。</p>
					<ul>
					<li>最後のニュースが表示された後に何も表示されない</li>
					</ul>
					<p>よくあるパターンは最後が表示されると最初に戻る というものです。<br />
					これを実装してみようと思います。</p>
					<p><span id="more-931"></span></p>
					<h2>JSソースを書く 3</h2>
					<h3>どうすればいいか考える</h3>
					<p>最後のニュースを表示したあとに 最初のニュースに戻るにはどうすればよいのか<br />
					とりあえず順を追って考えてみることにしましょう。<br />
					僕の全然プログラマではない思考でやってみます。</p>
					<ol>
					<li>count&gt;=end なら count = 0 にしたのち li#news-(end) を非表示にして</li>
					<li>li#news-(count) を表示</li>
					</ol>
					<p>count&gt;=end になった後をどう判別するかが必要になりますので 新しく<br />
					var start = 0; を追記します。それもふまえて実装してみましょう。</p>
					<pre name="code" class="js">

var start = count = 0,
end = $(&quot;li&quot;,&quot;div#newsTicker ul&quot;).length-1,
interval = 1500,
fadeTimer = setInterval(function(){
&nbsp;&nbsp;$(&quot;li#news-&quot;+(start==1 ? end : count)).hide();
&nbsp;&nbsp;$(&quot;li#news-&quot;+(start==1 ? count++ : ++count)).fadeIn(&quot;slow&quot;);

&nbsp;&nbsp;if(count&gt;=end{
&nbsp;&nbsp;&nbsp;&nbsp;count = 0;
&nbsp;&nbsp;&nbsp;&nbsp;start = 1;
&nbsp;&nbsp;}

},interval);
</pre>
					<p>実行してみましたか？<br />
					<a href="http://5509.me/sample/newsTicker/rev4.html">ここまでのサンプル</a></p>
					<p>最後のニュースから最初のニュースに戻るようにはなりましたが<br />
					そのあとがだめですね。</p>
					<p>ちなみに</p>
					<pre name="code" class="js">

a ? b : c;
</pre>
					<p>は a を判別してtrue を返せば b, falseなら c になります。</p>
					<pre name="code" class="js">

if(a){
&nbsp;&nbsp;return b;
}else{
&nbsp;&nbsp;return c;
}
</pre>
					<p>と同じような意味になります。<br />
					たとえば上の例では</p>
					<pre name="code" class="js">

start==1 ? end : count
</pre>
					<p>は start==1 なら end、それ以外なら（0なら）count</p>
					<pre name="code" class="js">

start==1 ? count++ : ++count
</pre>
					<p>も同じように start==1 なら count++、それ以外なら ++count<br />
					がそれぞれ入ることになります。</p>
					<h3>結局どうしたらいいのか</h3>
					<p>順を追って解決していこうと思ってたんですけれど<br />
					次が結構ややこしくなってしまって…結論から言うと</p>
					<pre name="code" class="js">

$(&quot;li#news-&quot;+(start==1 ? count==0 ? end : count-1 : count)).hide();
$(&quot;li#news-&quot;+(start==1 ? (++count)-1 : ++count)).fadeIn(&quot;slow&quot;);
if(start==0 ＆＆ count&gt;=end){
&nbsp;&nbsp;count = 0;
&nbsp;&nbsp;start = 1;
}else if(start==1 ＆＆ count&gt;end){
&nbsp;&nbsp;count = 0;
}
</pre>
					<p>となります。<br />
					見た感じ非常にややこしくなってしまったので 順番に説明していきます。</p>
					<ol>
					<li>1週目と2週目以降は count の動きが変わるので それを判別する 変数startを用意する。</li>
					<li>start == 0 なら1週目、start == 1 なら2週目以降</li>
					<li>start==1 ? は2週目以降かどうか</li>
					<li>count==0 ? は最後のニュースから最初のニュースにもどるときがどうか</li>
					<li>1週目は 非表示：li#news-count、表示：li#news-(++count)</li>
					<li>2週目以降は 非表示：li#news-(count==0 ? end : count-1)、表示：li#news-((++count)-1)</li>
					<li>つまり、li#news-endが表示される → count = 0 → 非表示にするのは li#news-end</li>
					<li>さらに li#news-endが非表示になる → li#news-(++count &#8211; 1)(ようはli#news-0) を表示</li>
					<li>この -1 のずれを戻すために 非表示にする方にも count-1 を</li>
					<li>最初の週の終わりには count = 0; start = 1;にする。</li>
					<li>次週以降の終わりには count = 0; にする。</li>
					</ol>
					<pre name="code" class="js">

start==1 ? count==0 ? end : count-1 : count
</pre>
					<p>は start==1 &amp;&amp; count==0 なら end、start==1 &amp;&amp; count!=0 なら count-1<br />
					start!=1 なら count ということです。</p>
					<p>説明すればするほど難解になっているような気もしますが…;;;<br />
					もっとキレイに説明したいんですけれど…<br />
					そんなことよりももっとスマートな書き方がきっとあるはずです。。。</p>
					<p>というわけで、完成したスクリプトは以下になります。</p>
					<pre name="code" class="js">

$(function(){
&nbsp;&nbsp;function newsFader(){
&nbsp;&nbsp;&nbsp;&nbsp;if($(&quot;li&quot;,&quot;div#newsTicker ul&quot;).length==1) return false;

&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;li&quot;,&quot;div#newsTicker ul&quot;).each(function(i){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).attr(&quot;id&quot;,&quot;news-&quot;+i);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(i!=0) $(this).hide();
&nbsp;&nbsp;&nbsp;&nbsp;});

&nbsp;&nbsp;&nbsp;&nbsp;var start = count = 0,
&nbsp;&nbsp;&nbsp;&nbsp;end = $(&quot;li&quot;,&quot;div#newsTicker ul&quot;).length-1,
&nbsp;&nbsp;&nbsp;&nbsp;interval = 1500,
&nbsp;&nbsp;&nbsp;&nbsp;fadeTimer = setInterval(function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;li#news-&quot;+(start==1 ? count==0 ? end : count-1 : count)).hide();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;#news-&quot;+(start==1 ? (++count)-1 : ++count)).fadeIn(&quot;slow&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(start==0 ＆＆ count&gt;=end){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;count = 0;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;start = 1;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}else if(start==1 ＆＆ count&gt;end){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;count = 0;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;},interval);
&nbsp;&nbsp;}
&nbsp;&nbsp;newsFader();
});
</pre>
					<p class="note">＆は半角に直してください。</p>
					<p>では実行してみましょう。<br />
					<a href="http://5509.me/sample/newsTicker/">サンプル（完成）</a></p>
					<p>後半の流れが若干（結構）アヤシイ感じもしますけど<br />
					とりあえずはこれでニュースティッカーが完成しました。</p>
					<h2>次回は…</h2>
					<p>次回はこのファンクションを利用してjQueryのプラグインにしてみましょう。<br />
					たとえば interval、フェードの速度をオプションで設定できるようになります。</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/newsticker1-2/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>jQueryを使ってNews Tickerプラグインを作ってみよう[前編][1]</title>
		<link>http://5509.me/log/newsticker1-1</link>
		<comments>http://5509.me/log/newsticker1-1#comments</comments>
		<pubDate>Sun, 08 Mar 2009 18:10:28 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[tuts]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=894</guid>
		<description><![CDATA[					
					まずは今回つくるものをご覧ください。
					ニュースティッカー1（完成）
					jQueryプラグインでも見たことがあるような よくあるフェードで切り替えるやつです。
					これを作って [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://5509.me/sample/newsTicker/"><img class="alignnone size-full wp-image-927" title="newsticker" src="http://5509.me/wp-content/uploads/2009/03/newsticker.gif" alt="newsticker" width="404" height="57" /></a></p>
					<p>まずは今回つくるものをご覧ください。</p>
					<p><a href="http://5509.me/sample/newsTicker/">ニュースティッカー1（完成）</a></p>
					<p>jQueryプラグインでも見たことがあるような よくあるフェードで切り替えるやつです。<br />
					これを作ってみましょう。</p>
					<p>前編では ニュースティッカーを実装するところまで<br />
					後編では 前編で作成したニュースティッカースクリプトをjQueryのプラグインにしていく予定です。<br />
					結構長いので数回に分けて投稿していきます。。。</p>
					<p>JavaScriptとjQueryがちょっとわかる人なら理解できる…はずです。</p>
					<p><span id="more-894"></span></p>
					<h2>用意するもの</h2>
					<ul>
					<li>jQuery &#8211; 公式でもいいですし、<a href="http://5509.me/sample/newsTicker/js/lib/jquery.js">僕がつくったサンプルに含まれてるやつ</a>でも大丈夫です。</li>
					<li><a href="http://mozilla.jp/firefox/">Firefox</a>と<a href="https://addons.mozilla.org/ja/firefox/addon/1843">Firebug</a></li>
					</ul>
					<p>だけです。<br />
					FirefoxとFirebugは開発に必須のツールなので 特に説明してません。</p>
					<h2>とりあえず…</h2>
					<p>jQueryを読み込んで…</p>
					<pre name="code" class="xhtml">

&lt;script type=&quot;text/javascript&quot; src=&quot;js/lib/jquery.js&quot;&gt;&lt;/script&gt;
</pre>
					<p>要素をマークアップしましょう。</p>
					<pre name="code" class="xhtml">

&lt;div id=&quot;newsTicker&quot;&gt;
&nbsp;&nbsp;&lt;ul&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;ニュースティッカーサンプル1&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;ニュースティッカーサンプル2&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;ニュースティッカーサンプル3&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;ニュースティッカーサンプル4&lt;/li&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;ニュースティッカーサンプル5&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&lt;/ul&gt;
&lt;/div&gt;
</pre>
					<p>こんな感じでリストなっているニュース一覧を切り替えることにします。</p>
					<h2>CSSでデザインを決める</h2>
					<p>枠になる画像を用意して<br />
					その中に1行で表示されるようにします。</p>
					<p>画像を用意するのが面倒な場合は↓の画像をどうぞ。<br />
					borderでもなんでもいいです。</p>
					<p><img src="http://5509.me/sample/newsTicker/img/bg_ticker.gif" alt="" /></p>
					<p>ちなみに今回のニュースティッカーの前提として<br />
					ニュースの文章は 枠内に1行で表示できる文字数であることとします。</p>
					<pre name="code" class="xhtml">

div#newsTicker {
&nbsp;&nbsp;width: 579px;
&nbsp;&nbsp;height: 35px;
&nbsp;&nbsp;background: url(../img/bg_ticker.gif) no-repeat;
&nbsp;&nbsp;overflow: hidden;
}
&nbsp;&nbsp;&nbsp;&nbsp;div#newsTicker ul {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;padding: 0 1em;
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;div#newsTicker ul li {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;line-height: 35px;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
</pre>
					<p>ここまでニュースが切り替わらない1行ニュースができたと思います。</p>
					<p><a href="http://5509.me/sample/newsTicker/rev1.html">ここまでのサンプル（切り替わらない1行ニュース）</a></p>
					<h2>JSソースを書く 1</h2>
					<p>ようやく準備ができたので 次はスクリプトを書いて実際に動かしていきます。</p>
					<h3>まずは newsTicker というfunctionをつくります。</h3>
					<pre name="code" class="js">

function newsTicker(){
}
</pre>
					<p>以降とくに指定がない限りこのfunction内に記述していきます。<br />
					まずは ニュースがひとつしかない場合は動かせるものがないので</p>
					<pre name="code" class="js">

if($(&quot;li&quot;,&quot;div#newsTicker ul&quot;).length&lt;=1) return false;
</pre>
					<p>というように LI要素がひとつ（またはそれ以下）の場合は<br />
					何もしないで終了するようにしておきます。<br />
					（これでCMSの自動吐き出しにも対応できるようになりました。）</p>
					<h3>次は識別しやすいように すべてのLI要素のIDを当てていきます。</h3>
					<p>今回は news-*（*は連番）というようにします。</p>
					<p>ひとつひとつやっていくのは面倒なので<br />
					each関数を使って楽をしたいと思います。</p>
					<p>jQueryのeach関数はforと同じように使うことができます。<br />
					たとえば</p>
					<pre name="code" class="js">

for(var i=0;i&lt;x.length;i++){
&nbsp;&nbsp;alert(i);
}
</pre>
					<p>は</p>
					<pre name="code" class="js">

$(x).each(function(i){
&nbsp;&nbsp;alert(i)
});
</pre>
					<p>のように書くことができます。<br />
					ではeach関数を利用して<br />
					「すべてのLI要素のID：news-*（*は連番）を割り当てる」<br />
					コードを記述してみましょう。</p>
					<pre name="code" class="js">

$(&quot;li&quot;,&quot;div#newsTicker ul&quot;).each(function(i){
&nbsp;&nbsp;$(this).attr(&quot;id&quot;,&quot;news-&quot;+i);
});
</pre>
					<p>ついでに 最初のLI要素以外をdisplay: noneにしておきます。</p>
					<pre name="code" class="js">

$(&quot;li&quot;,&quot;div#newsTicker ul&quot;).each(function(i){
&nbsp;&nbsp;$(this).attr(&quot;id&quot;,&quot;news-&quot;+i);
&nbsp;&nbsp;if(i!=0) $(this).hide();
});
</pre>
					<h3>試しにここまでのスクリプトを実行してみましょう。</h3>
					<p>ページ読み込み時にスクリプトを実行する場合</p>
					<pre name="code" class="js">

window.onload = function(){}
</pre>
					<p>とかaddEventListenerに登録したりしますが<br />
					jQueryでは</p>
					<pre name="code" class="js">

$(function(){
});
</pre>
					<p>の中で実行するだけです。<br />
					厳密に言うとwindow.onloadのタイミングではなく<br />
					DOM構築後のタイミングで実行されることになります。</p>
					<pre name="code" class="js">

$(function(){
&nbsp;&nbsp;function newsFader(){
&nbsp;&nbsp;&nbsp;&nbsp;if($(&quot;li&quot;,&quot;div#newsTicker ul&quot;).length&lt;=1) return false;
&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;li&quot;,&quot;div#newsTicker ul&quot;).each(function(i){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).attr(&quot;id&quot;,&quot;news-&quot;+i);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(i!=0) $(this).hide();
&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;}
&nbsp;&nbsp;newsFader();
});
</pre>
					<p><a href="http://5509.me/sample/newsTicker/rev2.html">ここまでのサンプル（IDを割り当てて最初のLI要素以外を非表示）<br />
					</a>- ひとつ前のサンプルと同じに見えますがFirebugで要素を確認すると状態が分かります。</p>
					<h2>JSソースを書く 2</h2>
					<p>LI要素にIDを割り当てて、最初のLI要素以外はdisplay: noneにしたので<br />
					フェードで入れ替える部分を作ります。</p>
					<h3>まずは最初のIDと終わりのIDを決めておきます。</h3>
					<p>現在表示しているニュースの番号は count という変数に入れることにします。<br />
					始まりは news-0 で終わりは news-4 ですが<br />
					終わりの数字を決めてしまうと 要素が増えたときにいちいち面倒くさいので<br />
					LI要素の数（ニュースの数）を取得して、それから-1したものを終わりの数字にします。<br />
					（JSでは数は0始まりなので終わりの数字は配列の長さ-1になります）</p>
					<pre name="code" class="js">

var count = 0,
end = $(&quot;li&quot;,&quot;div#newsTicker ul&quot;).length-1;
</pre>
					<h3>ニュースが入れ替わるまでの時間を決めます。</h3>
					<pre name="code" class="js">

var interval = 1500;
</pre>
					<p>特に指定はないですが、ある程度効果が分かるように1500ミリセカンドにします。</p>
					<h3>1500ミリセカンド毎にニュースを入れ替える。</h3>
					<p>ニュースの入れ替えは簡単に書くと<br />
					<strong>現在表示されてるニュースを非表示にして 次のニュースをフェードイン</strong><br />
					でできそうな気がしませんか？</p>
					<p>現在表示されているニュースは 例えば一番最初に表示されているのは<br />
					li#news-0 になるので 次のニュースは li#news-1 ですね。</p>
					<p>ということは手順としては</p>
					<ol>
					<li>li#news-(count) を非表示にする</li>
					<li>countに1を加える</li>
					<li>li#news-(count) をフェードインさせる</li>
					</ol>
					<p>これをスクリプトにするとこうなります。</p>
					<pre name="code" class="js">

$(&quot;li#news-&quot;+count).hide();
$(&quot;li#news-&quot;+(++count)).fadeIn(&quot;slow&quot;);
</pre>
					<p>とても簡単ですね。これをさっき決めたinterval毎に切り替えるには</p>
					<p><strong>setInterval</strong>という関数を使います。<br />
					setIntervalは</p>
					<pre name="code" class="js">

setInterval(function(){},interval);
</pre>
					<p>のように記述して、intervalの間隔毎にfunctionを実行します。<br />
					functionはあらかじめ定義した変数でも可。</p>
					<p>今回は特に タイマーを解除する必要がないので変数にしなくてもいいのですが<br />
					いつものくせで変数に入れています。</p>
					<pre name="code" class="js">

var fadeTimer = setInterval(function(){
&nbsp;&nbsp;$(&quot;li#news-&quot;+count).hide();
&nbsp;&nbsp;$(&quot;li#news-&quot;+(++count)).fadeIn(&quot;slow&quot;);
},interval)
</pre>
					<p>上記の記述で interval の間隔で setInterval の内容を実行するようになりました。<br />
					ここまでのスクリプトは以下になります。</p>
					<pre name="code" class="js">

$(function(){
&nbsp;&nbsp;function newsFader(){
&nbsp;&nbsp;&nbsp;&nbsp;if($(&quot;li&quot;,&quot;div#newsTicker ul&quot;).length&lt;=1) return false;

&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;li&quot;,&quot;div#newsTicker ul&quot;).each(function(i){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(this).attr(&quot;id&quot;,&quot;news-&quot;+i);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(i!=0) $(this).hide();
&nbsp;&nbsp;&nbsp;&nbsp;});

&nbsp;&nbsp;&nbsp;&nbsp;var count = 0,
&nbsp;&nbsp;&nbsp;&nbsp;end = $(&quot;li&quot;,&quot;div#newsTicker ul&quot;).length-1,
&nbsp;&nbsp;&nbsp;&nbsp;interval = 1500,
&nbsp;&nbsp;&nbsp;&nbsp;fadeTimer = setInterval(function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;li#news-&quot;+count).hide();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&quot;li#news-&quot;+(++count)).fadeIn(&quot;slow&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;},interval)

&nbsp;&nbsp;}
&nbsp;&nbsp;newsFader();
});
</pre>
					<p>ではここまでのスクリプトを実行してみましょう。<br />
					<a href="http://5509.me/sample/newsTicker/rev3.html">ここまでのサンプル（フェードを実行）</a></p>
					<p>サンプルを見てもらうと分かりますが 入れ替えは実装されましたが<br />
					このままでは<strong>最後のニュースを表示した後に何も表示しなくなってしまいます</strong>。</p>
					<p>次回は以上の不具合を修正していくことにします。<br />
					続く。。→<a href="http://5509.me/2009/03/10/newsticker1-2.html">http://5509.me/2009/03/10/newsticker1-2.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/newsticker1-1/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FeedBurnerのアカウントをGoogleに移行しました</title>
		<link>http://5509.me/log/feedburneracountismoved</link>
		<comments>http://5509.me/log/feedburneracountismoved#comments</comments>
		<pubDate>Sat, 28 Feb 2009 14:23:08 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[WebDev]]></category>
		<category><![CDATA[note]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=884</guid>
		<description><![CDATA[					すっかり忘れてたのですが
					FeedBurnerのアカウントをGoogleに移行しました。
					それに伴ってFeedBurnerのURIが変わりました。
					ブログのFeedに設定しているの [...]]]></description>
			<content:encoded><![CDATA[					<p>すっかり忘れてたのですが<br />
					FeedBurnerのアカウントをGoogleに移行しました。</p>
					<p>それに伴ってFeedBurnerのURIが変わりました。</p>
					<p>ブログのFeedに設定しているのはWordPressが生成するXMLで<br />
					http://5509.me/feed にアクセスした際に<br />
					リダイレクトするようにしててなんかややこしい感じなんですが…</p>
					<p>FeedBurnerのURIを購読に設定している方も<br />
					feedburner.jpが存在する限りリダイレクトされるようなので問題ないはずです。</p>
					<p>ブログFeed URI</p>
					<p>http://5509.me/feed</p>
					<p>前のFeedBurnerのURI</p>
					<p>http://feeds.feedburner.jp/mtmo</p>
					<p>新しいFeedBurnerのURI<br />
					<a href="http://feeds2.feedburner.com/mtmo">http://feeds2.feedburner.com/mtmo</a></p>
					<p>上のどれにアクセスしても 新しいFeedBurnerのURIにリダイレクトされます。</p>
					<p>説明すればするほどややこしくなっていきますが<br />
					ようは特に何もしなくても大丈夫ということです。<br />
					念のためのアナウンスでした:)</p>
]]></content:encoded>
			<wfw:commentRss>http://5509.me/log/feedburneracountismoved/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery.validation.jsとAjax Username Checkerを組み合わせて使う</title>
		<link>http://5509.me/log/jqueryvalidationjs-with-ajaxusernamecheck</link>
		<comments>http://5509.me/log/jqueryvalidationjs-with-ajaxusernamecheck#comments</comments>
		<pubDate>Wed, 04 Feb 2009 15:00:38 +0000</pubDate>
		<dc:creator>nori</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[ユーザビリティ]]></category>

		<guid isPermaLink="false">http://moto-mono.net/?p=850</guid>
		<description><![CDATA[					
					Ajax Username Checker &#8211; Ajax Username Checkerのサンプル
					&#8211; jQuery、PHP、CSVを組み合わせて、入力したユーザ [...]]]></description>
			<content:encoded><![CDATA[					<p><a href="http://5509.me/sample/validation_alpha/"><img class="alignnone size-full wp-image-851" title="checkusername" src="http://5509.me/wp-content/uploads/2009/02/checkusername.gif" alt="checkusername" width="203" height="68" /></a></p>
					<p><a href="http://www.shawngo.com/2008/04/ajax-username-checker-update/">Ajax Username Checker</a> &#8211; <a href="http://www.shawngo.com/gafyd/index.html">Ajax Username Checkerのサンプル</a><br />
					&#8211; jQuery、PHP、CSVを組み合わせて、入力したユーザネームが利用できるかどうかをチェックできるよ！</p>
					<p>というのがあるんですが<a href="http://okwave.jp/qa4684538.html">OKWave（と教えてgoo）からリファラーがきてて</a><br />
					みたら <a href="http://5509.me/2008/08/22/realtimeformvalidation.html">jQuery.validation.js</a>とAjax Username Checkerを一緒に使えないか みたいな感じでした。</p>
					<p>で 面白いのでjQuery.validation.jsで使えるようにソースを修正してみました。</p>
					<p><a href="http://5509.me/sample/validation_alpha/">実際に動作してるサンプル</a></p>
					<p><span id="more-850"></span></p>
					<h2>同時に使う（チップにユーザチェックの結果を表示する）には</h2>
					<h3>まずはcheck.phpを少し変えます</h3>
					<pre name="code" class="php">

&lt;?
$username = $_POST[&#039;username&#039;]; // get the username
$username = trim(htmlentities($username)); // strip some crap out of it
$file = &#039;/home/js4hire/public_html/gafyd/data.csv&#039;; // Here&#039;s the file. Notice the full path.

echo check_username($file,$username); // call the check_username function and echo the results.

function check_username($file_in,$username){
$username=strtolower($username);
$file = file($file_in);
foreach ($file as $line_num =&gt; $line) {
$line = explode(&#039;,&#039;,$line);
$user = trim(str_replace(&#039;&quot;&#039;,&#039;&#039;,$line[0]));
if($username == strtolower($user)){
return &#039;&lt;span style=&quot;color:#f00&quot;&gt;Username Unavailable&lt;/span&gt;&#039;; // ここを変える
}
}
return &#039;&lt;span style=&quot;color:#0c0&quot;&gt;Username Available&lt;/span&gt;&#039;; // ここを変える
}
?&gt;
</pre>
					<p>上記ソースの<strong>ここを変える部分をそれぞれ true と false に</strong>。<br />
					PHPには判定だけしてもらって表示するテキストはJS側で操作することにします。</p>
					<p>変更後のソースが↓です。<br />
					<strong>CSVはサイトパスが必要なんですがサイトパス部分は表記してないです。<br />
					使うサーバとCSVの場所に合わせて変えてください。</strong></p>
					<pre name="code" class="php">

&lt;?
$username = $_POST[&#039;username&#039;]; // get the username
$username = trim(htmlentities($username)); // strip some crap out of it
$file = &#039;(sitepath)/data.csv&#039;; // Here&#039;s the file. Notice the full path.

echo check_username($file,$username); // call the check_username function and echo the results.

function check_username($file_in,$username){
$username=strtolower($username);
$file = file($file_in);
foreach ($file as $line_num =&gt; $line) {
$line = explode(&#039;,&#039;,$line);
$user = trim(str_replace(&#039;&quot;&#039;,&#039;&#039;,$line[0]));
if($username == strtolower($user)){
return &#039;false&#039;;
}
}
return &#039;true&#039;;
}
?&gt;
</pre>
					<p>PHPの修正が終わったら次はJSソースの修正です。</p>
					<h3>まずは普通にアクティベート</h3>
					<pre name="code" class="js">

$(function(){
$(&quot;.validate&quot;).validation({
msgs: {
email: &quot;正しいEメールアドレスを入力してください&lt;br /&gt;例：info@5509.me&quot;,
submit: &quot;入力が完了していない&lt;strong&gt;必須項目&lt;/strong&gt;があります。&lt;br /&gt;&lt;strong&gt;必須項目は全て入力&lt;/strong&gt;してください。&quot;
},
dialog: {
dialogOpacity: .8
}
});
//ここに①を追記
});
//ここに②を追記
</pre>
					<p>上記ソースの <strong>//ここに①（②）を追記</strong> 部分に必要なところを足していくことにします</p>
					<h3>まずは画像のプリロード</h3>
					<p>ローディング画像は先日人気になってた<a href="http://www.preloaders.net/">Preloaders.net</a>などからダウンロードして<br />
					以下のソースでプリロードしておきます。これをしないと初回の読み込み時によくないことが起こります。</p>
					<pre name="code" class="js">

// ローディング画像のプリロード
var loading = new Image();
loading.src = &quot;img/indicator.gif&quot;; // パスは適宜変えてください
</pre>
					<h3>ユーザチェックのためにイベントを関連付ける</h3>
					<p>これより以下で出てくる <strong>$.tip</strong> はjQuery.validationで定義してるものです。<br />
					一応解説しておきます。</p>
					<h4>$.tip.msg(id,msg)</h4>
					<p>チップにメッセージを表示させる。<br />
					<strong>対象チップに対応するinput要素のID</strong>をidに、対象チップに表示させる<strong>HTMLタグが使える文字列</strong>をmsgにそれぞれ引数として指定します。</p>
					<h4>$.tip.fadeIn(id)</h4>
					<p>非表示のチップを表示（フェードイン）させる。<br />
					idには<strong>対象チップに対応するinput要素のID</strong>を引数として指定します。</p>
					<pre name="code" class="js">

$(&#039;#name&#039;).blur(function(){
if($(this).val().length&lt;1) return false;
$.post(&quot;check.php&quot;,{
username: $(&#039;#name&#039;).val() // 参照する値がcsvデータとの比較
},function(response){ // response : csvにデータ