<?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/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>ウェブル &#187; jQuery</title>
	<atom:link href="http://kezy.org/category/jquery/feed" rel="self" type="application/rss+xml" />
	<link>http://kezy.org</link>
	<description>なかなか就職できない PHP + MySQL 時々 Javascript を弄る20才</description>
	<lastBuildDate>Tue, 27 Jul 2010 02:39:42 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://kezy.org/category/jquery/feed" />
		<item>
		<title>jQuery で世界一簡単に画像を自動スライドすることができる simpleslide.js</title>
		<link>http://kezy.org/2010/07/22/jquery-simpleslide-js</link>
		<comments>http://kezy.org/2010/07/22/jquery-simpleslide-js#comments</comments>
		<pubDate>Thu, 22 Jul 2010 14:03:52 +0000</pubDate>
		<dc:creator>Sorai</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[simpleslide.js]]></category>

		<guid isPermaLink="false">http://kezy.org/?p=4254</guid>
		<description><![CDATA[本当にスライドだけがしたい場合の jQuery のコードを書いてみました。
ul と li で画像を並べるだけで、勝手にスライドが始まります。
simpleslide.js デモサイト
ただし、作った私は Javascr<p><a href="http://kezy.org/2010/07/22/jquery-simpleslide-js" class="excerpt_more">...続きを読む</a></p>]]></description>
			<content:encoded><![CDATA[<p>本当にスライドだけがしたい場合の jQuery のコードを書いてみました。<br />
ul と li で画像を並べるだけで、勝手にスライドが始まります。<br />
<a href="http://kget.org/simpleslide/">simpleslide.js デモサイト</a></p>
<p>ただし、作った私は Javascript 初心者なのであしからず。</p>
<h3>基本的な使い方</h3>
<h4>HTML の書き方</h4>
<p>以下のようにスライドしたい画像を並べます。<br />
CSS は必要ありません、きっと simpleslide.js が自動で設定してくれます。<br />
id を slide にしておきますと、後々便利ですが、任意の名前でも結構です。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;slide&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image_01.png&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image_02.png&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image_03.png&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></pre></td></tr></table></div>

<h4>JS の読み込み</h4>
<p>simpleSlide() で起動します。 ページ末端に以下のようにコードを追加してください。<br />
HTML の段階で、id 名に slide を設定した場合は simpleSlide() と空で OK です。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'text/javascript'</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'jquery.simpleslide.js'</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span> 
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'text/javascript'</span>&gt;</span>simpleSlide();<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></td></tr></table></div>

<p>※これだけで動かない場合は以下を読み進めてください…。</p>
<h3>堅実な使い方</h3>
<p>以上の手順だけで動くには動きますが、全自動すぎて不具合が発生することがありますので、以下の項目を設定することをおすすめします。</p>
<h4>ID 名を指定する</h4>
<p>HTML の段階で任意の id 名をいれた場合は、第1引数にあなたが設定した id 名を入れます。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'text/javascript'</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'jquery.simpleslide.js'</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span> 
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'text/javascript'</span>&gt;</span>simpleSlide('hoge');<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></td></tr></table></div>

<h4>速度の設定</h4>
<p>ちなみにスライドする速度を変更できます。<br />
第2引数にミリ秒でスライドとスライドの間隔を入れます。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'text/javascript'</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'jquery.simpleslide.js'</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span> 
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'text/javascript'</span>&gt;</span>simpleSlide('hoge', 3000);<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></td></tr></table></div>

<h4>枠のサイズ設定</h4>
<p>さらに細かい設定ですが、横幅と高さを設定することができます。<br />
要はフレーム枠のサイズです。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'text/javascript'</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'jquery.simpleslide.js'</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span> 
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'text/javascript'</span>&gt;</span>simpleSlide('hoge', 3000, 500, 300);<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></td></tr></table></div>

<p>第3引数が width、第4引数は height を設定します。<br />
ここを設定しなければ、simpleslide.js が ul の初出の子要素のサイズを取得して、それを width と height として使用します。ですが、少し不調なので、挑戦者以外は設定してください。</p>
<p>ダウンロードはこちら： <a href='http://kezy.org/wp-content/uploads/2010/07/jquery.simpleslide.js'>jquery.simpleslide.js</a> (v1.0)</p>
<h3>コード</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">jQuery.<span style="color: #660066;">noConflict</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> j$ <span style="color: #339933;">=</span> jQuery<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> simpleSlide<span style="color: #009900;">&#40;</span>myid<span style="color: #339933;">,</span> animateInterval<span style="color: #339933;">,</span> width<span style="color: #339933;">,</span> height<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span><span style="color: #009900;">&#40;</span>myid<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;undefined&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #003366; font-weight: bold;">var</span> myid <span style="color: #339933;">=</span> <span style="color: #3366CC;">'#slide'</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> mylist <span style="color: #339933;">=</span> myid <span style="color: #339933;">+</span> <span style="color: #3366CC;">' &gt; li'</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span><span style="color: #009900;">&#40;</span>width<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;undefined&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #003366; font-weight: bold;">var</span> width <span style="color: #339933;">=</span> j$<span style="color: #009900;">&#40;</span>mylist <span style="color: #339933;">+</span> <span style="color: #3366CC;">':first-child'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span><span style="color: #009900;">&#40;</span>height<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;undefined&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #003366; font-weight: bold;">var</span> height <span style="color: #339933;">=</span> j$<span style="color: #009900;">&#40;</span>mylist <span style="color: #339933;">+</span> <span style="color: #3366CC;">':first-child'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span><span style="color: #009900;">&#40;</span>animateInterval<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;undefined&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #003366; font-weight: bold;">var</span> animateInterval <span style="color: #339933;">=</span> <span style="color: #CC0000;">5000</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> animeteTime <span style="color: #339933;">=</span> animateInterval <span style="color: #339933;">/</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">;</span>
&nbsp;
	j$<span style="color: #009900;">&#40;</span>myid<span style="color: #009900;">&#41;</span>
		.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'display'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'block'</span><span style="color: #009900;">&#41;</span>
		.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'position'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'relative'</span><span style="color: #009900;">&#41;</span>
		.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'width'</span><span style="color: #339933;">,</span> width <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px'</span><span style="color: #009900;">&#41;</span>
		.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'height'</span><span style="color: #339933;">,</span> height <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px'</span><span style="color: #009900;">&#41;</span>
		.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'overflow'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'hidden'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	j$<span style="color: #009900;">&#40;</span>mylist<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>num<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
		j$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>
			.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'display'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'block'</span><span style="color: #009900;">&#41;</span>
			.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'position'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'absolute'</span><span style="color: #009900;">&#41;</span>
			.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'top'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'0px'</span><span style="color: #009900;">&#41;</span>
			.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#40;</span>width<span style="color: #339933;">*</span>num<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	setInterval<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slide('&quot;</span> <span style="color: #339933;">+</span> myid <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;','&quot;</span> <span style="color: #339933;">+</span> mylist <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;',&quot;</span> <span style="color: #339933;">+</span> width <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;,&quot;</span> <span style="color: #339933;">+</span> height <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;,&quot;</span> <span style="color: #339933;">+</span> animateInterval <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;,&quot;</span> <span style="color: #339933;">+</span> animeteTime <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;)&quot;</span><span style="color: #339933;">,</span> animateInterval<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> slide<span style="color: #009900;">&#40;</span>myid<span style="color: #339933;">,</span> mylist<span style="color: #339933;">,</span> width<span style="color: #339933;">,</span> height<span style="color: #339933;">,</span> animateInterval<span style="color: #339933;">,</span> animeteTime<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	j$<span style="color: #009900;">&#40;</span>myid<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span>j$<span style="color: #009900;">&#40;</span>mylist <span style="color: #339933;">+</span> <span style="color: #3366CC;">':first-child'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">clone</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	j$<span style="color: #009900;">&#40;</span>mylist <span style="color: #339933;">+</span> <span style="color: #3366CC;">':last-child'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #339933;">,</span><span style="color: #009900;">&#40;</span>width <span style="color: #339933;">*</span> <span style="color: #009900;">&#40;</span>j$<span style="color: #009900;">&#40;</span>mylist<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	j$<span style="color: #009900;">&#40;</span>mylist<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>num<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>j$<span style="color: #009900;">&#40;</span>mylist<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span> <span style="color: #339933;">==</span> num<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			j$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> left<span style="color: #339933;">:</span> <span style="color: #3366CC;">'-='</span> <span style="color: #339933;">+</span> width <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> animeteTime<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				j$<span style="color: #009900;">&#40;</span>mylist <span style="color: #339933;">+</span> <span style="color: #3366CC;">':first-child'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
			j$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> left<span style="color: #339933;">:</span> <span style="color: #3366CC;">'-='</span> <span style="color: #339933;">+</span> width <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> animeteTime<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://kezy.org/2010/07/22/jquery-simpleslide-js/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://kezy.org/2010/07/22/jquery-simpleslide-js" />
	</item>
		<item>
		<title>jquery.pngFix.js で画像のサイズが大きくなるバグの解決方法</title>
		<link>http://kezy.org/2010/03/30/jquery-pngfix-line-height</link>
		<comments>http://kezy.org/2010/03/30/jquery-pngfix-line-height#comments</comments>
		<pubDate>Tue, 30 Mar 2010 03:02:34 +0000</pubDate>
		<dc:creator>Sorai</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[pigfix]]></category>

		<guid isPermaLink="false">http://kezy.org/?p=3934</guid>
		<description><![CDATA[jquery.pngFix.js で以下のようにしてたら、突然画像が大きくなってボヤけてしまいました。

1
2
3
4
5
6
7
&#60;script type=&#34;text/javascript&#34;<p><a href="http://kezy.org/2010/03/30/jquery-pngfix-line-height" class="excerpt_more">...続きを読む</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://jquery.andreaseberhard.de/pngFix/">jquery.pngFix.js</a> で以下のようにしてたら、突然画像が大きくなってボヤけてしまいました。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/jquery.pngfix.js&quot;</span> <span style="color: #000066;">charset</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;utf-8&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
$(function($) {
	$(&quot;h3 &gt; img&quot;).pngfix();
});
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h3</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;images.png&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;66&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;18&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h3</span>&gt;</span></pre></td></tr></table></div>

<p>実際に Javascript で書き換えられたソースを見てみましょう。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'DISPLAY: inline-block; FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=&quot;true&quot;, sizingMethod=&quot;scale&quot;, src=&quot;images.png&quot;); WIDTH: 82px; LINE-HEIGHT: 0; HEIGHT: 18px'</span> jQuery1269915814671<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;10&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span></pre></td></tr></table></div>

<p>背景にして <a href="http://www5e.biglobe.ne.jp/access_r/hp/filter/DirectXfilter_002.html">AlphaImageLoader</a> 使ってたんですね。きっとこの中の CSS がしっかり効いていないのでしょうか。いろいろ探ってるうちに、line-height が効いていないことが分かりましたよ。</p>
<p>なので、span 要素に大して、再度 line-height をかけてあげましょう。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">h3 span <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span>!important<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>以前作った人の css が何か悪いことをしているのでしょう。span 要素や div などに大して直に何か指定されていたのかな。何はともあれ、IE シリーズは困ったちゃんですね。IE 作った人も困ったちゃんです。</p>
]]></content:encoded>
			<wfw:commentRss>http://kezy.org/2010/03/30/jquery-pngfix-line-height/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://kezy.org/2010/03/30/jquery-pngfix-line-height" />
	</item>
		<item>
		<title>jQuery と prototype.js のコンフリクトを回避する方法</title>
		<link>http://kezy.org/2009/11/01/jquery-prototype-conflict</link>
		<comments>http://kezy.org/2009/11/01/jquery-prototype-conflict#comments</comments>
		<pubDate>Sat, 31 Oct 2009 15:22:21 +0000</pubDate>
		<dc:creator>Sorai</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Conflict]]></category>
		<category><![CDATA[prototype.js]]></category>

		<guid isPermaLink="false">http://kezy.org/?p=3211</guid>
		<description><![CDATA[jQuery と prototype.js を同時に使うとコンフリクトを起こします。なぜなら、jQuery はprototype.js と同じく(正確には同じではないのですが) document.getElementBy<p><a href="http://kezy.org/2009/11/01/jquery-prototype-conflict" class="excerpt_more">...続きを読む</a></p>]]></description>
			<content:encoded><![CDATA[<p>jQuery と prototype.js を同時に使うとコンフリクトを起こします。なぜなら、jQuery はprototype.js と同じく(正確には同じではないのですが) document.getElementById() のショートカットとして $() を使っているためです。<br />
より正確な説明は以下のページが詳しいです。<br />
<a href="http://www.tatamilab.jp/rnd/archives/000332.html">prototype.jsとThickBox(jQuery)がコンフリクト｜blog｜たたみラボ</a></p>
<p>解決策としては、どちらか一方の $ function を別の文字に置き換えてしまえば良いかもしれないというわけで、今回は jQuery の $ function を j$ に変えてみましょう。</p>
<p>例えば以下のコードの場合。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;table&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;tr:even&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;even&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;tr&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span>
		<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;hover&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
		<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;hover&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>以下のように $ を j$ に置き換えることで解決できます。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> j$ <span style="color: #339933;">=</span> jQuery<span style="color: #339933;">;</span>
j$<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
	j$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;table&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		j$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;tr:even&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;even&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	j$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;tr&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span>
		<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			j$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;hover&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
		<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			j$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;hover&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>確か j$ じゃなくても jQuery と書いても動くはずです。すいません、試してません。短いコードが好きかもなので。</p>
]]></content:encoded>
			<wfw:commentRss>http://kezy.org/2009/11/01/jquery-prototype-conflict/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://kezy.org/2009/11/01/jquery-prototype-conflict" />
	</item>
		<item>
		<title>[jQuery] Table の偶数行の背景色を変更しオンマウスで行をマークする記述</title>
		<link>http://kezy.org/2009/10/08/jquery-table-tr-mouse</link>
		<comments>http://kezy.org/2009/10/08/jquery-table-tr-mouse#comments</comments>
		<pubDate>Thu, 08 Oct 2009 10:00:43 +0000</pubDate>
		<dc:creator>Sorai</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://kezy.org/?p=3026</guid>
		<description><![CDATA[探せばそこら中にあると思いますが、私も作ってみましたよ。
詳しい方書き方とか改行の位置とか問題ないかアドバイス頂けたら幸いです。
ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
$&#40;f<p><a href="http://kezy.org/2009/10/08/jquery-table-tr-mouse" class="excerpt_more">...続きを読む</a></p>]]></description>
			<content:encoded><![CDATA[<p>探せばそこら中にあると思いますが、私も作ってみましたよ。<br />
詳しい方書き方とか改行の位置とか問題ないかアドバイス頂けたら幸いです。</p>
<h3>ソースコード</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;table&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;tr:even&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;even&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;tr&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span>
		<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;hover&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
		<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;hover&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h4><ins datetime="2009-10-08T10:53:21+00:00">修正(2009/10/8)</ins>: 1行目を改良しました。</h4>
<blockquote><p>$(document).ready(function()は<br />
$(function()に略せますよ～（内容は全く同じ）。</p></blockquote>
<p>ありがとうございます！ということで、さっそく修正しました。</p>
<h3>実行結果</h3>
<p>このソースを実行するとテーブルがこんな風になります。</p>
<table border="0">
<tr>
<th scope="col">No</th>
<th scope="col">Type A</th>
<th scope="col">Type B</th>
<th scope="col">Type C</th>
<th scope="col">Type D</th>
</tr>
<tr>
<td>1</td>
<td>A</td>
<td>B</td>
<td>C</td>
<td>D</td>
</tr>
<tr>
<td>2</td>
<td>E</td>
<td>F</td>
<td>G</td>
<td>H</td>
</tr>
<tr>
<td>3</td>
<td>J</td>
<td>K</td>
<td>N</td>
<td>M</td>
</tr>
<tr>
<td>4</td>
<td>L</td>
<td>O</td>
<td>P</td>
<td>Q</td>
</tr>
</table>
<h3>コードの解説</h3>
<h4>1行目</h4>
<p>最初に起動しますよーって奴です。これで良いのでしょうか。この段階でまだまだ勉強が足りませんね。</p>
<h4>2行目から4行目</h4>
<p>ページ内の table の tr の偶数行に class=&#8221;even&#8221; を設定します。これにより、CSS で .even に対して背景色を設定しておけば楽しいことになりますよ。</p>
<h4>5行目~12行目</h4>
<p>マウスオーバーで class=&#8221;hover&#8221; を追加します。CSS で .hover に変化を書いておけば、マウスオーバーでその行をマークできます。ちなみにマウスアウトをするとさ、class=&#8221;hover&#8221; を削除します。</p>
<h3>まとめ</h3>
<p>こんな感じですね。</p>
<p>何でもかんでもプラグインを使わなくても、こんな感じで自分で作っていった方が勉強にもなるし、後で融通が聞きます。ちなみにこのソース light box 2 と併用できない ( prottype.js 使ってるからね) みたいなので、light box 2 みたいなのを自分で作る必要がありそうです。</p>
<p>ちなみに本当は縦にもいろいろ小細工したいんですが、元々他のことやってて脱線してここまで来ちゃったんで、早く本来の目的を達成しなければいけないので、今日はこの辺りで。</p>
]]></content:encoded>
			<wfw:commentRss>http://kezy.org/2009/10/08/jquery-table-tr-mouse/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://kezy.org/2009/10/08/jquery-table-tr-mouse" />
	</item>
		<item>
		<title>jQuery に完全にハマりました。PHP が使えるなら jQuery はもっと面白くなります</title>
		<link>http://kezy.org/2009/09/19/about-jquery</link>
		<comments>http://kezy.org/2009/09/19/about-jquery#comments</comments>
		<pubDate>Sat, 19 Sep 2009 08:29:23 +0000</pubDate>
		<dc:creator>Sorai</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://kezy.org/?p=2812</guid>
		<description><![CDATA[最近 EC サイトの制作をしておりまして、商品の追加の際にページ全部を読み込み直すのはサーバーにも負荷がかかるし、利用者もストレスがかかると思ったので、部分的に Ajax で読み込んでしまおうと思って、prototype<p><a href="http://kezy.org/2009/09/19/about-jquery" class="excerpt_more">...続きを読む</a></p>]]></description>
			<content:encoded><![CDATA[<p>最近 EC サイトの制作をしておりまして、商品の追加の際にページ全部を読み込み直すのはサーバーにも負荷がかかるし、利用者もストレスがかかると思ったので、部分的に Ajax で読み込んでしまおうと思って、prototype.js でやろうと思ったんですが、jQuery でもひょっとしてできるのかな？と思って調べてみたら、prototype.js より簡単にできるようで…。<br />
<a href="http://e0166.blog89.fc2.com/blog-entry-363.html">Re：zapa氏 今更ですが、jQueryにはまりました*ホームページを作る人のネタ帳</a></p>
<p>なんか私の人生の転機になるような情報を、ネタ帳の人は流しているような気がします…(笑)</p>
<p>ほんで Javascript を前々からやってる人は以下の記事を読むと、jQuery がどれだけ凄いか分かります。<br />
<a href="http://allabout.co.jp/internet/javascript/closeup/CU20071020A/">jQueryの魔法 &#8211; ［JavaScript］All About</a></p>
<p>jQuery のわくわく感を伝えてくれる記事はこれです。<br />
<a href="http://zapanet.info/blog/item/1164">ニュータイプなJSライブラリjQueryを使ってみよう！</a></p>
<p>んで今回使ったコードはこれだけです。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#load&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;load.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>これだけで以下の場所に load.php が読み込めるんです。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;load&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p>読み込んだ load.php を更新したい場合は、もう一度先ほどの jQuery のコードを叩けば良いだけ。中で PHP でタイムスタンプを出力するコードでも書いて実行しまくれば凄さが分かります。</p>
<p>Cookie の書き換えはページを読み込んで何も出力してない状態でしか実行できないです。だから Javascript で書きこむんですが Cookie 書きこんでも一度出力してしまったページでは情報を反映できませんので、ページ全体をリロードさせるなどの対策を取らなければいけませんが、この jQuery を再度実行すればページを部分的に書き換えられますね。だから Cookie の内容を読み込んで DB にアクセスして情報を読み込んで表示させられますね。</p>
<p>まぁそんなこんなで jQuery にハマりだしたので、jQuery 関係の記事を書いていきたいと思います。</p>
]]></content:encoded>
			<wfw:commentRss>http://kezy.org/2009/09/19/about-jquery/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://kezy.org/2009/09/19/about-jquery" />
	</item>
		<item>
		<title>Cookie を jQuery ならたった一行のコードで発行したり読み込んだりできる</title>
		<link>http://kezy.org/2009/09/19/cookie-jquery</link>
		<comments>http://kezy.org/2009/09/19/cookie-jquery#comments</comments>
		<pubDate>Sat, 19 Sep 2009 05:16:52 +0000</pubDate>
		<dc:creator>Sorai</dc:creator>
				<category><![CDATA[Cookie]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://kezy.org/?p=2813</guid>
		<description><![CDATA[jQuery を使えば今まで Javascript で Cookie を焼いていて、現在の時間を取得して、期限を指定して…ってやってたのが笑えてくるほど簡単になります。
Cookie を焼く
もう、これだけです。

1
<p><a href="http://kezy.org/2009/09/19/cookie-jquery" class="excerpt_more">...続きを読む</a></p>]]></description>
			<content:encoded><![CDATA[<p>jQuery を使えば今まで Javascript で Cookie を焼いていて、現在の時間を取得して、期限を指定して…ってやってたのが笑えてくるほど簡単になります。</p>
<h3>Cookie を焼く</h3>
<p>もう、これだけです。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$.<span style="color: #660066;">cookie</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'cookiename'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'value'</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span> expires<span style="color: #339933;">:</span> <span style="color: #CC0000;">7</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h4>cookiename</h4>
<p>cookie の名前です。</p>
<h4>value</h4>
<p>焼く内容です。</p>
<h4>expires: 7</h4>
<p>有効期限7日ってことです。</p>
<h3>Cookie を読み込む</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$.<span style="color: #660066;">cookie</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'cookiename'</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p>これだけなんです。</p>
<h3>ダウンロード</h3>
<p>ちなみにこれを使うには以下が必要です。<br />
<a href="http://jquery.com/">jquery.js</a><br />
<a href="http://dev.jquery.com/browser/trunk/plugins/cookie/jquery.cookie.js?format=txt">jquery.cookie.js</a></p>
<p>jQuery.js に標準に入れても良いような気がするほど便利ですね。</p>
]]></content:encoded>
			<wfw:commentRss>http://kezy.org/2009/09/19/cookie-jquery/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://kezy.org/2009/09/19/cookie-jquery" />
	</item>
	</channel>
</rss>
