<?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>wqce &#187; JQuery</title>
	<atom:link href="http://wqce.netkatuyou.com/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://wqce.netkatuyou.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 22 Jul 2010 02:47:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>jQueryでロールオーバー＋マウスクリック時に効果を付ける</title>
		<link>http://wqce.netkatuyou.com/jquery/301/</link>
		<comments>http://wqce.netkatuyou.com/jquery/301/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 14:28:03 +0000</pubDate>
		<dc:creator>kimuray</dc:creator>
				<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://wqce.netkatuyou.com/?p=301</guid>
		<description><![CDATA[ナビゲーションボタンのロールオーバーなどの効果を付けるときに、
jQueryを使う機会も多いかと思います。
ロールオーバーに関するスクリプトは検索すると多数見つかりますが、
「ボタンをクリックしたときに効果を付ける」
と [...]]]></description>
			<content:encoded><![CDATA[<p>ナビゲーションボタンのロールオーバーなどの効果を付けるときに、<br />
jQueryを使う機会も多いかと思います。<br />
ロールオーバーに関するスクリプトは検索すると多数見つかりますが、</p>
<p>「ボタンをクリックしたときに効果を付ける」</p>
<p>というものが見つからなかったので、自作してみることに。<br />
基本となるスクリプトですが、こちらの記事の</p>
<p><a href="http://ascii.jp/elem/000/000/471/471577/">jQueryでロールオーバー！プリロード対応版</a></p>
<p>を参考にして作成してみました。</p>
<pre class="brush: jscript;">
$(function(){
    $(&quot;img.action&quot;).mouseover(function(){
        $(this).attr(&quot;src&quot;,$(this).attr(&quot;src&quot;).replace(/^(.+)(\.[a-z]+)$/, &quot;$1_on$2&quot;))
    }).mousedown(function(){
        $(this).attr(&quot;src&quot;,$(this).attr(&quot;src&quot;).replace(/^(.+)_on(\.[a-z]+)$/, &quot;$1_push$2&quot;))
    }).mouseout(function(){
        $(this).attr(&quot;src&quot;,$(this).attr(&quot;src&quot;).replace(/^(.+)_on(\.[a-z]+)$/, &quot;$1$2&quot;));
    }).mouseup(function(){
        $(this).attr(&quot;src&quot;,$(this).attr(&quot;src&quot;).replace(/^(.+)_push(\.[a-z]+)$/, &quot;$1$2&quot;));
    }).each(function(){
        $(&quot;&lt;img&gt;&quot;).attr(&quot;src&quot;,$(this).attr(&quot;src&quot;).replace(/^(.+)(\.[a-z]+)$/, &quot;$1_on$2&quot;))
    })
})
</pre>
<p>img要素にclass=&#8221;action&#8221;を指定します。</p>
<pre class="brush: xml;">
&lt;img src=&quot;sample.png&quot; class=&quot;action&quot; /&gt;
</pre>
<p>上記記事と同様にロールオーバー用の画像にsample_on.png、<br />
そしてクリック時用の画像にsample_push.png、<br />
というようにそれぞれファイル名の最後に_on、_pushと付けた画像を用意します。</p>
<p>※なお場合によって不具合がでる場合があるかもしれないので、その点はご注意を。</p>
]]></content:encoded>
			<wfw:commentRss>http://wqce.netkatuyou.com/jquery/301/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
