<?xml version="1.0" encoding="UTF-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
<title>Suinasia(jQuery)</title>
<subtitle>「jQuery」なエントリー</subtitle>
<link rel="alternate" type="text/html" href="http://suin.asia/tag/jQuery"/>
<link rel="self" type="application/atom+xml" href="http://suin.asia/feed/atom/tag/jQuery"/>
<author>
<name>suin</name>
</author>
<updated>2012-02-04T13:43:45Z</updated>
<id>http://example.com/atom1.xml</id>
<entry>
<title>XOOPS Cubeでスライドショーを作れるプリロード JquerySlideShow</title>
<link href="http://suin.asia/2011/08/08/xoops_slide_show"/>
<summary>&lt;a href=&quot;http://dl.dropbox.com/u/949822/Downloads/JquerySlideShow.class.php&quot; class=&quot;download&quot;&gt;JquerySlideShow&lt;/a&gt;

&lt;p&gt;&lt;a href=&quot;http://usadeki.jp/modules/d3forum/index.php?topic_id=667&quot;&gt;うさでき&lt...</summary>
<published>2011-08-07T18:02:31Z</published>
<updated>2011-08-07T17:57:45Z</updated>
<id>http://suin.asia/2011/08/08/xoops_slide_show</id>
<category term="XOOPS" label="XOOPS" scheme="http://suin.asia/tag/XOOPS" />
<category term="jQuery" label="jQuery" scheme="http://suin.asia/tag/jQuery" />
<content type="html" xml:lang="ja" xml:base="http://suin.asia/tag/jQuery">
<![CDATA[<a href="http://dl.dropbox.com/u/949822/Downloads/JquerySlideShow.class.php" class="download">JquerySlideShow</a>

<p><a href="http://usadeki.jp/modules/d3forum/index.php?topic_id=667">うさでき</a>のmikaさんの投稿を読みながら、もう少し手軽にできるようになるといいなーと思って、XOOPS Cubeで簡単にスライドショーを作れるプリロードを作ってみました。急いで作ったので、結構テキトーです。なにか問題があったら教えてください。</p>

<p>ちなみに、どんなスライドショーができるかは、<a href="http://usadeki.jp/">うさできのトップページ</a>を見てみてください。</p>

<p class="photo"><a href="https://picasaweb.google.com/lh/photo/m2AolCeRPfoq5qrO89S-IA?feat=embedwebsite"><img src="https://lh3.googleusercontent.com/-FMxHqFrWCcU/Tj7R1K5EGxI/AAAAAAAABec/DHKW8k5snFc/s400/%2525E3%252582%2525B9%2525E3%252582%2525AF%2525E3%252583%2525AA%2525E3%252583%2525BC%2525E3%252583%2525B3%2525E3%252582%2525B7%2525E3%252583%2525A7%2525E3%252583%252583%2525E3%252583%252588%2525202011-08-08%2525202.45.17.jpg" height="135" width="400" /></a></p>

<h3>インストール方法</h3>

<p>ダウンロードした JquerySlideShow.class.php を/preloadフォルダにアップロードするだけです。</p>

<p>ちなみに、このファイルだけでは動作しません。jquery.jsが必要です。XCL2.2ならデフォルトで入ってます。XCL2.1の人でよく分からない人は<a href="http://dl.dropbox.com/u/949822/Downloads/Jquery.class.php.zip">Jquery.class.php</a>を/preloadフォルダに入れといてください。</p>

<h3>使い方</h3>


<p>基本的にテーマのすきなところにタグを埋め込めこんで使います。編集するテーマのファイはたぶん/themes/あなたのテーマ/theme.htmlです。埋め込み方は下の説明を御覧ください。</p>


<h4>[基本編] テーマで使う</h4>

<p>画像の大きさを指定して、画像のURLを1行ずつ列挙するだけ</p>

<pre>
&lt;{slideshow width=680 height=80}&gt;
http://example.com/path/to/image1.png
http://example.com/path/to/image2.png
http://example.com/path/to/image3.png
&lt;{/slideshow}&gt;
</pre>


<h4>[発展編] 画像のリンク先を指定する</h4>

<p>画像のURLの次に、半角スペースを挟んでリンク先のURLを指定すると、画像にリンクがつきます。</p>

<pre>
&lt;{slideshow width=680 height=80}&gt;
http://example.com/path/to/image1.png http://example.com/page1.html
http://example.com/path/to/image2.png http://example.com/page2.html
http://example.com/path/to/image3.png http://example.com/page3.html
&lt;{/slideshow}&gt;
</pre>


<h4>[応用編] 画像のURLに&lt;{$xoops_url}&gt;を使う</h4>

<p>画像のURLに&lt;{$xoops_url}&gt;を使うと、サイトのURLが変わったときに、URLを書き換える必要がないので便利です</p>

<pre>
&lt;{slideshow width=680 height=80}&gt;
&lt;{$xoops_url}&gt;/uploads/myalbum/1.png &lt;{$xoops_url}&gt;/modules/pico/index.php?content_id=1
&lt;{$xoops_url}&gt;/uploads/myalbum/2.png &lt;{$xoops_url}&gt;/modules/pico/index.php?content_id=2
&lt;{$xoops_url}&gt;/uploads/myalbum/3.png &lt;{$xoops_url}&gt;/modules/pico/index.php?content_id=3
&lt;{/slideshow}&gt;
</pre>

-----------------------------------------------------

<h4>[応用編] カスタムブロックで使う</h4>

<p>カスタムブロックの「コンテンツ」に次のようなコードを埋め込みます。
カスタムブロックの「タイプ」は「PHPスクリプト」を指定します。</p>

<pre class="php" name="code">
$params = array(
  'width' => 680, // 幅指定
  'height' => 80, // 縦指定
);
$images ="
http://example.com/path/to/image1.png
http://example.com/path/to/image2.png
http://example.com/path/to/image3.png
";
JquerySlideShow::renderSlideShow($params, $images);
</pre>]]>
</content>
</entry>
<entry>
<title>jQueryの世界で最も単純なプラグインの作り方サンプル</title>
<link href="http://suin.asia/2010/02/04/the_simplest_plugin_for_jquery"/>
<summary>jQueryは要素セレクターやクロスブラウザ対応が優れたjavascriptのライブラリで、prototype.jsと並んで広く使われています。そのjQueryでは、独自に自前の関数をプラグインという形で作ることが</summary>
<published>2010-02-03T23:29:00Z</published>
<updated>2010-02-03T23:17:00Z</updated>
<id>http://suin.asia/2010/02/04/the_simplest_plugin_for_jquery</id>
<category term="jQuery" label="jQuery" scheme="http://suin.asia/tag/jQuery" />
<category term="javascript" label="javascript" scheme="http://suin.asia/tag/javascript" />
<category term="Tips" label="Tips" scheme="http://suin.asia/tag/Tips" />
<content type="html" xml:lang="ja" xml:base="http://suin.asia/tag/jQuery">
<![CDATA[<p>jQueryは要素セレクターやクロスブラウザ対応が優れたjavascriptのライブラリで、prototype.jsと並んで広く使われています。そのjQueryでは、独自に自前の関数をプラグインという形で作ることができます。jQueryプラグインの作り方は検索すれば山ほど出てきますが、その第一歩となるプラグインの基本的な書き方が見つからなかったので記事にしておこうと思います。</p>
<p>次のプラグインは、単に文字色を赤くするだけのものです。<code>myplugin</code>がプラグイン名です。<code>$(this).css('color', 'red');</code>の部分以外がプラグインの骨組みとなり、この部分だけ差し替えれば、全く別のプラグインを作ることができます。</p>
<pre name="code" class="js">
(function($){
	$.fn.myplugin = function() {
		return this.each(function() {
			$(this).css('color', 'red');
		});
	};
})(jQuery);
</pre>
<p>このプラグインの<a href="http://suin.org/jquery/jquery_the_simplest_plugin.html">動作デモ</a></p>]]>
</content>
</entry>
<entry>
<title>jQueryでエレメントが存在するか知る方法</title>
<link href="http://suin.asia/2008/10/31/jquery-if-an-element-exists.html"/>
<summary>jQueryで、あるエレメントがあるかどうか知る方法。</summary>
<published>2008-10-31T02:36:33Z</published>
<updated>2008-10-31T02:36:33Z</updated>
<id>http://suin.asia/2008/10/31/jquery-if-an-element-exists.html</id>
<category term="Web" label="Web" scheme="http://suin.asia/tag/Web" />
<category term="jQuery" label="jQuery" scheme="http://suin.asia/tag/jQuery" />
<content type="html" xml:lang="ja" xml:base="http://suin.asia/tag/jQuery">
<![CDATA[jQueryで、あるエレメントがあるかどうか知る方法を探したら、公式サイトで見つけた。<br /><br /><pre>if ( $('#myDiv').length )<br />  $('#myDiv').show();<br /><br />lengthであるかどうかがわかるらしい。<br /><br />んでやってみたけど、できねぇー。<br /><br />FireBugに"$('#myDiv') is null"って怒られるし。<br /><br />複数の英語サイトを回ってみたけど、<br /><br />if ( $('#myDiv') ) だといつもtureが返るからだめで、<br />if ( $('#myDiv').length ) が正しいと言うんだけれど、エラー出るし。<br /><br />結局行き着いた答えはこれだった。<br /><br />if ( $('#myDiv') != null )<br /><br />まいったまいった。<br /><br /><br /></pre>]]>
</content>
</entry>
</feed>
