<?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>へっぽこ開発室 &#187; Ajax</title>
	<atom:link href="http://wp.foliz.net/archives/category/ajax/feed" rel="self" type="application/rss+xml" />
	<link>http://wp.foliz.net</link>
	<description>webプログラム　php,Smarty,Zend Framework,ajax,pearネタなど～</description>
	<lastBuildDate>Sat, 21 Jan 2012 06:32:52 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>prototype.js Ajax.PeriodicalUpdaterのIE対応策</title>
		<link>http://wp.foliz.net/archives/349</link>
		<comments>http://wp.foliz.net/archives/349#comments</comments>
		<pubDate>Fri, 10 Sep 2010 06:27:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[prototype]]></category>
		<category><![CDATA[PeriodicalUpdate]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/?p=349</guid>
		<description><![CDATA[prototype.jsのAjax.PeriodicalUpdaterがIEで正しく動かなかったので対応メモ。 Ajax.PeriodicalUpdateは定期的に実行する関数ですが JSONPを定期的に投げて更新してい [...]]]></description>
			<content:encoded><![CDATA[<p>prototype.jsのAjax.PeriodicalUpdaterがIEで正しく動かなかったので対応メモ。</p>
<p>Ajax.PeriodicalUpdateは定期的に実行する関数ですが<br />
JSONPを定期的に投げて更新していくプログラム中、<br />
更新がなかったときに止まってしまって非常に悩んだ。</p>
<p><span id="more-349"></span></p>
<p>null値などの判別で止まるのかと思いきや<br />
ブラウザがキャッシュをしてリクエストをしてくれなくなるらしいことが判明。</p>
<p>対応策として以下のサイトのように<br />
クエリーパラメーターにランダム要素を加えて対応した。</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">dummy <span style="color: #339933;">:</span> Math.<span style="color: #660066;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>参考：<br />
<a href="http://phpspot.org/blog/archives/2006/12/prototypejsajax.html">prototype.jsのAjax.PeriodicalUpdaterをIEでも正しく動かす方法:phpspot開発日誌</a></p>
]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/349/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript ループ中にイベントリスナーを登録する最も簡単な方法</title>
		<link>http://wp.foliz.net/archives/278</link>
		<comments>http://wp.foliz.net/archives/278#comments</comments>
		<pubDate>Sat, 27 Feb 2010 16:45:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[イベントリスナー]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/?p=278</guid>
		<description><![CDATA[今回はJavaScriptネタです。 こっち系はほとんど素人でぜんぜん得意ではありませんが、自分なりに考えてとってもナイスな方法を披露しちゃいます。 例えばこんな単純な処理 ちょっと文法があっているかどうかはわからんがこ [...]]]></description>
			<content:encoded><![CDATA[<p>今回はJavaScriptネタです。<br />
こっち系はほとんど素人でぜんぜん得意ではありませんが、自分なりに考えてとってもナイスな方法を披露しちゃいます。<br />
<span id="more-278"></span></p>
<p>例えばこんな単純な処理<br />
ちょっと文法があっているかどうかはわからんがこんなイメージ。</p>

<div class="wp_syntax"><div 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;hoge&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></pre></div></div>

<p>ここに動的に要素を足して、足された文字をクリックでその文字がアラートされる</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> Kudamono <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;りんご&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;いちご&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;ばなな&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> ulElem <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'hoge'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> Kudamono.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> liElem <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  liElem.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> Kudamono<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  liElem.<span style="color: #660066;">onclick</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: #000066;">alert</span><span style="color: #009900;">&#40;</span>Kudamono<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
&nbsp;
 ulElem.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>liElem<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>意図とすればリストタグが3つ追加され、<br />
クリックするとアラートでその名前が表示されて欲しい。</p>
<p>だけど実際動かしてみると、全部最後の要素またはundefinedになる。<br />
まったくもって意図した動作ではなくなる。</p>
<p>これは定義したときに動作がきまるのではなくて、動かしたときの変数が有効になるため。<br />
クリックされたときは既にiが最後の値まで達しているのでそれを参照してしまうらしい。</p>
<p>そこでどんな回避策があるかといろいろ調べてみた。<br />
<a href="http://d.hatena.ne.jp/hi_c_mayu/20090704/1246641410">http://d.hatena.ne.jp/hi_c_mayu/20090704/1246641410</a><br />
<a href="http://labs.unoh.net/2006/05/post_11.html">http://labs.unoh.net/2006/05/post_11.html</a><br />
<a href="http://cesare.seesaa.net/article/18007870.html">http://cesare.seesaa.net/article/18007870.html</a></p>
<p>うーーん。。どれも素人の俺には使いにくい・・・。<br />
そこでfunctionやパラメータを使うのではなく要素自身のなんらかの値を使ってしまうのがもっとも見やすくて簡単だと思った。</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> Kudamono <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;りんご&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;いちご&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;ばなな&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> ulElem <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'hoge'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> Kudamono.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> liElem <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  liElem.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> Kudamono<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  liElem.<span style="color: #660066;">onclick</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: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">innerHTML</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
  ulElem.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>liElem<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>innerHTMLと値を明らかに変えたい場合は</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">  liElem.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> i <span style="color: #339933;">+</span> <span style="color: #3366CC;">'番目の要素 '</span> <span style="color: #339933;">+</span>Kudamono<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #3366CC;">'って美味しいよねー'</span><span style="color: #339933;">;</span>
  liElem.<span style="color: #660066;">title</span> <span style="color: #339933;">=</span> Kudamono<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  liElem.<span style="color: #660066;">onclick</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: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">title</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
  ulElem.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>liElem<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>ってな感じはどーだろうか。<br />
自分ではナイスアイディアだと思うが（笑）</p>
]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/278/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE「このページは表示できません」</title>
		<link>http://wp.foliz.net/archives/216</link>
		<comments>http://wp.foliz.net/archives/216#comments</comments>
		<pubDate>Tue, 29 Dec 2009 14:46:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/?p=216</guid>
		<description><![CDATA[javascriptでたまーーにIEのみ「このページは表示できません」とアラートされて読み込み中のページがキャンセルされてしまうときがある。 どうやら原因はDOM構築途中にDOM書き換えようとするとこのエラーがでるらしい [...]]]></description>
			<content:encoded><![CDATA[<p>javascriptでたまーーにIEのみ「このページは表示できません」とアラートされて読み込み中のページがキャンセルされてしまうときがある。<br />
どうやら原因はDOM構築途中にDOM書き換えようとするとこのエラーがでるらしい。<br />
<span id="more-216"></span><br />
IEしか出ないからIEのバグなんだろうか。</p>
<p>解決方法としては<br />
htmlに直接javascriptを埋めてある場合は<br />
window.onload=function(){}などで表示後に実行といった段階でやったほうがいいらしい。</p>
<p>と、ここまではたどり着いたが、<br />
今組んであるのをどーやってそのように実行させたらわからねぇ（笑）</p>
]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/216/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>prototype scriptaculous.jsを使ったドラッグできるソート処理</title>
		<link>http://wp.foliz.net/archives/159</link>
		<comments>http://wp.foliz.net/archives/159#comments</comments>
		<pubDate>Wed, 04 Nov 2009 12:20:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[prototype]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/?p=159</guid>
		<description><![CDATA[scriptaculous.jsを使ったドラッグできるソート処理を書くよ。 下準備。 まずはprototype.js と scriptaculous.jsを呼び出す。 &#60;script src=&#34;/js/p [...]]]></description>
			<content:encoded><![CDATA[<p>scriptaculous.jsを使ったドラッグできるソート処理を書くよ。</p>
<p><span id="more-159"></span></p>
<p>下準備。<br />
まずはprototype.js と scriptaculous.jsを呼び出す。</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/js/prototype.js&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/js/scriptaculous/scriptaculous.js&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>でHTMLソースはこんな感じを想定。</p>

<div class="wp_syntax"><div 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;sortResult&quot;</span>&gt;</span>ここに結果<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<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;sortList&quot;</span>&gt;</span>
 <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;elem_a&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;handle&quot;</span>&gt;</span>ドラッグ<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>A<span style="color: #009900;">&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> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;elem_b&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;handle&quot;</span>&gt;</span>ドラッグ<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>B<span style="color: #009900;">&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> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;elem_c&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;handle&quot;</span>&gt;</span>ドラッグ<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>C<span style="color: #009900;">&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> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;elem_d&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;handle&quot;</span>&gt;</span>ドラッグ<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>D<span style="color: #009900;">&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></div></div>

<p>ソートさせたらその状態をすぐに保存する場合。</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">   Sortable.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'sortList'</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span>
        constraint<span style="color: #339933;">:</span><span style="color: #3366CC;">'vertical'</span><span style="color: #339933;">,</span>
        handle<span style="color: #339933;">:</span><span style="color: #3366CC;">'handle'</span><span style="color: #339933;">,</span>
        onUpdate<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: #003366; font-weight: bold;">var</span> params <span style="color: #339933;">=</span> <span style="color: #3366CC;">'order='</span> <span style="color: #339933;">+</span> Sortable.<span style="color: #660066;">serialize</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'sortList'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
           <span style="color: #003366; font-weight: bold;">new</span> Ajax.<span style="color: #660066;">Request</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'sort.php'</span><span style="color: #339933;">,</span>
             <span style="color: #009900;">&#123;</span>
               method<span style="color: #339933;">:</span> <span style="color: #3366CC;">'post'</span><span style="color: #339933;">,</span>
               onComplete<span style="color: #339933;">:</span> getResponse<span style="color: #339933;">,</span>
               parameters<span style="color: #339933;">:</span> params
             <span style="color: #009900;">&#125;</span>
           <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
           <span style="color: #003366; font-weight: bold;">function</span> getResponse<span style="color: #009900;">&#40;</span>req<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
             $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'sortResult'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> req.<span style="color: #660066;">responseText</span><span style="color: #339933;">;</span>
           <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
     <span style="color: #009900;">&#125;</span>
   <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>オプションにhandleを指定しているので「ドラッグ」をつまみに使います。<br />
constraintは移動方向制限。&#8217;vertical&#8217;は垂直方向のみ。<br />
他にもオプションはいっぱいあります。<br />
onUpdateにfunction登録しているのでドラッグ後にsort.phpにPOSTでorderパラメーターに順番が渡されます。</p>
<p>sort.php</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'order'</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">//保存処理</span>
  <span style="color: #666666; font-style: italic;">//$key 順番</span>
  <span style="color: #666666; font-style: italic;">//$value エレメント要素</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'変更しました。'</span><span style="color: #339933;">;</span></pre></div></div>

<p>ここでechoした内容がsortResultエレメントに表示されるよ。<br />
成功とか失敗とかアナウンスに使うと良いでしょう。</p>
]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/159/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>loadingアイコンの表示</title>
		<link>http://wp.foliz.net/archives/146</link>
		<comments>http://wp.foliz.net/archives/146#comments</comments>
		<pubDate>Thu, 08 Oct 2009 02:36:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[prototype]]></category>
		<category><![CDATA[element]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/?p=146</guid>
		<description><![CDATA[ajaxで通信中はユーザーにわかりにくいのでloadingアイコンでも表示させようと思った。 prototypeのElement.showとhideを使えば楽勝じゃんって思っていたのにちょっとハマったのでメモ。 初期は非 [...]]]></description>
			<content:encoded><![CDATA[<p>ajaxで通信中はユーザーにわかりにくいのでloadingアイコンでも表示させようと思った。<br />
prototypeのElement.showとhideを使えば楽勝じゃんって思っていたのにちょっとハマったのでメモ。<br />
<span id="more-146"></span><br />
初期は非表示で通信中だけ表示ってやりたかったのさ。</p>
<p>スタイルで</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#icn-loading</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>HTMLで<br />
&lt;img id=&#8221;icn-loading&#8221;  src=&#8221;/images/loading.gif&#8221; alt=&#8221;保存中&#8230;&#8221; /&gt;</p>
<p>showとhideメソッドはどうやらタグに直接利くようなのでスタイルシートで定義してあるとこれは維持されたままらしい。</p>
<p>なので</p>
<p>&lt;img id=&#8221;icn-loading&#8221; src=&#8221;/images/loading.gif&#8221; alt=&#8221;保存中&#8230;&#8221; <span style="color: #ff0000;">style=&#8221;display: none;</span>&#8221; /&gt;<br />
が正しいようです。</p>
<p>Ajax.Requestを使った例</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">    <span style="color: #003366; font-weight: bold;">new</span> Ajax.<span style="color: #660066;">Request</span><span style="color: #009900;">&#40;</span>
        <span style="color: #3366CC;">'json.php'</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#123;</span>
            methotd<span style="color: #339933;">:</span> <span style="color: #3366CC;">'post'</span><span style="color: #339933;">,</span>
            parameters<span style="color: #339933;">:</span> params<span style="color: #339933;">,</span>
            onLoading <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>ev<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                Element.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'icn-loading'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
            onSuccess<span style="color: #339933;">:</span> getResponse<span style="color: #339933;">,</span>
            onLoaded <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>ev<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                Element.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'icn-loading'</span><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: #006600; font-style: italic;">//通信成功時に処理</span>
    <span style="color: #003366; font-weight: bold;">function</span> getResponse<span style="color: #009900;">&#40;</span>req<span style="color: #339933;">,</span>e<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/146/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>javascript テーブル trの入れ替え</title>
		<link>http://wp.foliz.net/archives/132</link>
		<comments>http://wp.foliz.net/archives/132#comments</comments>
		<pubDate>Thu, 01 Oct 2009 08:57:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/?p=132</guid>
		<description><![CDATA[javascriptでテーブルで並べられたデータの順番を入れ変えようと思った。 prototype.jsで動くscriptaculous.jsでsortableを使おうと思ったけど、 処理が重いのか動きが鈍すぎて使い物に [...]]]></description>
			<content:encoded><![CDATA[<p>javascriptでテーブルで並べられたデータの順番を入れ変えようと思った。<br />
prototype.jsで動くscriptaculous.jsでsortableを使おうと思ったけど、<br />
処理が重いのか動きが鈍すぎて使い物にならない。<br />
とりあえずボタンクリックで上に移動、下に移動が実現できれば良しとした。</p>
<p><span id="more-132"></span></p>
<p>順番の保存はテーブル内にhiddenタグを入れてpostされた順番をそのまま取得すれば、良さそうだ。</p>
<p>HTML</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">table</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;imglist_table&quot;</span> &gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">thead</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">tr</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;head&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;100px&quot;</span>&gt;</span>画像<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>あげる<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>さげる<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">thead</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">tbody</span>&gt;</span>
 <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">tr</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tr1&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">em</span>&gt;</span>画像<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">em</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;順番を上げます&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;itemUp('tr1');return false;&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;順番を下げます&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;itemDown('tr1');return false;&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
 <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
 <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">tr</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tr2&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">em</span>&gt;</span>画像<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">em</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;順番を上げます&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;itemUp('tr2');return false;&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;順番を下げます&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;itemDown('tr2');return false;&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
 <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
 <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">tr</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tr3&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">em</span>&gt;</span>画像<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">em</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;順番を上げます&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;itemUp('tr3');return false;&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;順番を下げます&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;itemDown('tr3');return false;&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
 <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">tbody</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">table</span>&gt;</span></pre></div></div>

<p></p>
<p>javascript（prototype.js使用）</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">function itemUp<span style="color: #009900;">&#40;</span>thisElem<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    var tbleElem <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'imglist_table'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    var tbodyElem <span style="color: #339933;">=</span> tbleElem.<span style="color: #006633;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;tbody&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> $<span style="color: #009900;">&#40;</span>thisElem<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">previousSibling</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        tbodyElem.<span style="color: #006633;">insertBefore</span><span style="color: #009900;">&#40;</span> $<span style="color: #009900;">&#40;</span>thisElem<span style="color: #009900;">&#41;</span> , $<span style="color: #009900;">&#40;</span>thisElem<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">previousSibling</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
function itemDown<span style="color: #009900;">&#40;</span>thisElem<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    var tbleElem <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'imglist_table'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    var tbodyElem <span style="color: #339933;">=</span> tbleElem.<span style="color: #006633;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;tbody&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span>thisElem<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">nextSibling</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        tbodyElem.<span style="color: #006633;">insertBefore</span><span style="color: #009900;">&#40;</span> $<span style="color: #009900;">&#40;</span>thisElem<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">nextSibling</span> , $<span style="color: #009900;">&#40;</span>thisElem<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>ざっくり書くとこんな感じになった。<br />
子ノードを追加するappendChildと指定エレメントの上部に挿入するinsertBeforeがあるけど、順番を下げる場合は、指定の下に挿入が無くて困った。<br />
よーーく悩んでみれば、下のエレメントを上部に挿入でいけるじゃんって思いついた。<br />
俺ってすげーｗ</p>
<p>tableにtbodyを使っているのはIE対策。</p>
<p>上の要素、下の要素を確認するためif(Elem)を使っているけど<br />
もしかしたらブラウザによってダメな場合があるかも？</p>
<p>あとは、改良して、瞬間移動されるのをエフェクトを使って移動しましたーって<br />
ビジュアル的にわかりやすくするとか必要かもね。</p>
<p>後から調べたらここをよく読んでおけばよかったかも＾＾；<br />
<a href="http://d.hatena.ne.jp/uupaa/20080130">http://d.hatena.ne.jp/uupaa/20080130</a></p>
]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/132/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>フォームタグの内容をjavascriptに渡す</title>
		<link>http://wp.foliz.net/archives/71</link>
		<comments>http://wp.foliz.net/archives/71#comments</comments>
		<pubDate>Thu, 06 Mar 2008 05:42:31 +0000</pubDate>
		<dc:creator>Fou</dc:creator>
				<category><![CDATA[Ajax]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/archives/71</guid>
		<description><![CDATA[テキストボックスの内容をEnterキーでもJavascriptに渡せるようにする。 &#60;form onsubmit=&#34;showSearch(this.search.value); return false&#038; [...]]]></description>
			<content:encoded><![CDATA[<p>テキストボックスの内容をEnterキーでもJavascriptに渡せるようにする。<br />
<span id="more-71"></span></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> <span style="color: #000066;">onsubmit</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;showSearch(this.search.value); return false&quot;</span>&gt;</span>
 <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;search&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
 <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">button</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;検索&quot;</span>&gt;</span>検索<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">button</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span>
&nbsp;
&nbsp;
以前のやり方は
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;検索&quot;</span>  <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;showSearch(this.search.value); return false&quot;</span><span style="color: #66cc66;">/</span>&gt;</span>
こんなんだったのでボタンを押さないとjavaに渡せなかった。</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/71/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Highlight image hover effect (opacity or borderize)</title>
		<link>http://wp.foliz.net/archives/62</link>
		<comments>http://wp.foliz.net/archives/62#comments</comments>
		<pubDate>Tue, 30 Oct 2007 12:25:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[prototype]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/archives/62</guid>
		<description><![CDATA[ちょっと変わったhoverイベントの書き方をしていたののがあったのでメモ Highlight image hover effect (opacity or borderize) こちらの 1 2 3 4 5 6 7 8  [...]]]></description>
			<content:encoded><![CDATA[<p>ちょっと変わったhoverイベントの書き方をしていたののがあったのでメモ<br />
<span id="more-62"></span></p>
<p><a href="http://www.dynamicdrive.com/style/csslibrary/item/highlight-image-hover-effect/">Highlight image hover effect (opacity or borderize)</a></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
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;style type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span><span style="color: #00AA00;">&gt;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*Credits: Dynamic Drive CSS Library */</span>
<span style="color: #808080; font-style: italic;">/*URL: http://www.dynamicdrive.com/style/ */</span>
&nbsp;
<span style="color: #6666ff;">.toggleopacity</span> img<span style="color: #00AA00;">&#123;</span>
filter<span style="color: #3333ff;">:progid</span><span style="color: #3333ff;">:DXImageTransform</span><span style="color: #6666ff;">.Microsoft</span>.Alpha<span style="color: #00AA00;">&#40;</span>opacity<span style="color: #00AA00;">=</span><span style="color: #cc66cc;">50</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
-moz-opacity<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0.5</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.toggleopacity</span><span style="color: #3333ff;">:hover </span>img<span style="color: #00AA00;">&#123;</span>
filter<span style="color: #3333ff;">:progid</span><span style="color: #3333ff;">:DXImageTransform</span><span style="color: #6666ff;">.Microsoft</span>.Alpha<span style="color: #00AA00;">&#40;</span>opacity<span style="color: #00AA00;">=</span><span style="color: #cc66cc;">100</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
-moz-opacity<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.toggleopacity</span> img<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.toggleborder</span><span style="color: #3333ff;">:hover </span>img<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">navy</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.toggleborder</span><span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Dummy definition to overcome IE bug */</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

<p>クラス名にhoverをかけている。<br />
これを知らない私はonMouseイベントでjavaを組んでいました。。。</p>
]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/62/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ext.Message</title>
		<link>http://wp.foliz.net/archives/55</link>
		<comments>http://wp.foliz.net/archives/55#comments</comments>
		<pubDate>Wed, 17 Oct 2007 07:00:42 +0000</pubDate>
		<dc:creator>Fou</dc:creator>
				<category><![CDATA[Ext]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/archives/55</guid>
		<description><![CDATA[ようやく覚えだしたExtライブラリ。 まだまだ思ったような動きを作れない。。 まずは簡単な確認ダイアログの出力から。 function msgBox&#40;&#41;&#123; Ext.MessageBox.show [...]]]></description>
			<content:encoded><![CDATA[<p>ようやく覚えだしたExtライブラリ。<br />
まだまだ思ったような動きを作れない。。<br />
まずは簡単な確認ダイアログの出力から。</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> msgBox<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    Ext.<span style="color: #660066;">MessageBox</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span>
    <span style="color: #009900;">&#123;</span>
        title<span style="color: #339933;">:</span> <span style="color: #3366CC;">'確認!'</span><span style="color: #339933;">,</span>
        msg<span style="color: #339933;">:</span> <span style="color: #3366CC;">'よいですか？'</span><span style="color: #339933;">,</span>
        buttons<span style="color: #339933;">:</span> Ext.<span style="color: #660066;">MessageBox</span>.<span style="color: #660066;">OKCANCEL</span><span style="color: #339933;">,</span>
        fn<span style="color: #339933;">:</span> fnDel<span style="color: #339933;">,</span>
        animEl<span style="color: #339933;">:</span> <span style="color: #3366CC;">'btnCheck'</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">function</span> fnDel<span style="color: #009900;">&#40;</span>result<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>result<span style="color: #339933;">==</span><span style="color: #3366CC;">&quot;ok&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            document.<span style="color: #660066;">location</span>.<span style="color: #660066;">href</span> <span style="color: #339933;">=</span> path<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/55/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ext 2.0 Samples公開</title>
		<link>http://wp.foliz.net/archives/38</link>
		<comments>http://wp.foliz.net/archives/38#comments</comments>
		<pubDate>Mon, 10 Sep 2007 15:50:00 +0000</pubDate>
		<dc:creator>Fou</dc:creator>
				<category><![CDATA[Ext]]></category>

		<guid isPermaLink="false">http://wp.foliz.net/archives/38</guid>
		<description><![CDATA[超クールなAjaxライブラリExtがつい最近1.1が正式リリースされたばかりなのに、もう2.0のを公開している・・。 とんでもない開発スピードに脱帽です＾＾； これからじっくり1.1を覚えていこうと思っていたのになんてこ [...]]]></description>
			<content:encoded><![CDATA[<p>超クールなAjaxライブラリ<a href="http://extjs.com/" title="extjs.com">Ext</a>がつい最近1.1が正式リリースされたばかりなのに、もう2.0のを公開している・・。<br />
とんでもない開発スピードに脱帽です＾＾；<br />
これからじっくり1.1を覚えていこうと思っていたのになんてこった。。。</p>
<p>サンプルはとても素晴らしく更に高機能になってる。<br />
だけど覚えようと思ってる側は大変＞＜</p>
<p><a href="http://extjs.com/playpen/ext-2.0-dev5/examples/" title="Ext 2.0 Samples"><img src="http://wp.foliz.net/wp-content/uploads/2007/09/output9.thumbnail.jpg" alt="Ext 2.0 Samples" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://wp.foliz.net/archives/38/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

