<?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://oneday.ter.jp/tag/jquery/feed" rel="self" type="application/rss+xml" />
	<link>http://oneday.ter.jp</link>
	<description>一日にひとつは何かを考える。</description>
	<lastBuildDate>Mon, 31 Jan 2011 09:23:33 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://oneday.ter.jp/tag/jquery/feed" />
		<item>
		<title>jQueryを利用したプルダウン（ドロップダウン）メニュー</title>
		<link>http://oneday.ter.jp/actionscript3/486.html</link>
		<comments>http://oneday.ter.jp/actionscript3/486.html#comments</comments>
		<pubDate>Sat, 25 Jul 2009 04:49:12 +0000</pubDate>
		<dc:creator>イテル</dc:creator>
				<category><![CDATA[ActionScript3]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[webdesigning]]></category>
		<category><![CDATA[ドロップダウン]]></category>
		<category><![CDATA[プルダウン]]></category>
		<category><![CDATA[メニュー]]></category>

		<guid isPermaLink="false">http://oneday.ter.jp/?p=486</guid>
		<description><![CDATA[昨日に引き続き、webdesigningからjQueryを使ったプルダウンメニューのメモ。 一昔前までは、プルダウンメニューを実装するには、自前で ある程度書かなければならなかったような気がする。 今は、ライブラリが豊富 [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://oneday.ter.jp/wp-content/uploads/2009/07/090725-700x200.jpg" alt="090725" title="090725" width="700" height="200" class="alignnone size-thumbnail wp-image-521" /></p>
<p>昨日に引き続き、webdesigningからjQueryを使ったプルダウンメニューのメモ。<br />
一昔前までは、プルダウンメニューを実装するには、自前で<br />
ある程度書かなければならなかったような気がする。</p>
<p>今は、ライブラリが豊富で今回webdesに取り上げられたjQuery以外にもさまざまな<br />
ライブラリで実装できる。<br />
Flashしかり、jsしかり便利な時代になったもんだ。</p>
<p>ということで、またwebdesのソースをいじって晒す。</p>
<h3>cssとjsの読み込み</h3>
<pre class="brush: xml; title: ; notranslate">
	&lt;link rel=&quot;stylesheet&quot; href=&quot;css/style.css&quot; type=&quot;text/css&quot; media=&quot;all&quot;&gt;
	&lt;!--[if lte IE 7]&gt;
		&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;css/ie.css&quot; media=&quot;screen&quot; /&gt;
	&lt;![endif]--&gt;
	&lt;link rel=&quot;stylesheet&quot; href=&quot;css/main.css&quot; type=&quot;text/css&quot; media=&quot;all&quot;&gt;
	&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
	&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery.dropdownPlain.js&quot;&gt;&lt;/script&gt;
</pre>
<p>※IE7以前のブラウザに別途ie.cssを読み込ませる</p>
<h3>コンテンツ部分</h3>
<pre class="brush: xml; title: ; notranslate">
&lt;h1&gt;伊藤商店の全て&lt;/h1&gt;
&lt;ul class=&quot;dropdown&quot;&gt;
	&lt;li&gt;&lt;a href=&quot;#&quot;&gt;お知らせ&lt;/a&gt;
		&lt;ul class=&quot;sub_menu&quot;&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;伊藤の一言&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;今日の伊藤&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;明日の伊藤&lt;/a&gt;&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;#&quot;&gt;サポート&lt;/a&gt;
		&lt;ul class=&quot;sub_menu&quot;&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;ホームページ作りたいヒト&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;フラッシュ作りたいヒト&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;#&quot;&gt;お茶を飲みたいヒト&lt;/a&gt;&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;#&quot;&gt;ワークス&lt;/a&gt;
		&lt;ul class=&quot;sub_menu&quot;&gt;
			&lt;li&gt;&lt;a href=&quot;http://ito.ter.jp&quot;&gt;伊藤商店のwebサイト&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;http://3lab.ter.jp&quot;&gt;さんらぼwebサイト&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;&lt;a href=&quot;http://diary.ter.jp&quot;&gt;日記&lt;/a&gt;
				&lt;ul&gt;
					&lt;li&gt;&lt;a href=&quot;http://diary.ter.jp&quot;&gt;イテル日記&lt;/a&gt;&lt;/li&gt;
					&lt;li&gt;&lt;a href=&quot;http://manual.ter.jp&quot;&gt;マニュアル&lt;/a&gt;&lt;/li&gt;
					&lt;li&gt;&lt;a href=&quot;http://oneday.ter.jp&quot;&gt;一日一問&lt;/a&gt;&lt;/li&gt;
				&lt;/ul&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;#&quot;&gt;アクセス&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>以上。<br />
ちなみに、webdesでは透過PNGを使用したアレンジ方法も<br />
紹介されているので参考になるっす。</p>
<p>今回のサンプルは<a href="/html_data/0907/25/" target="_blank">コチラ</a>。</p>
<div class="amazon-item-box" style="display: block; padding: 0; border: 1px solid  #999; margin: 8px;  -moz-border-radius: 10px;">
<div class="amazon-item-image" style="display: block; padding: 10px; float: left;"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/B002GCGJ1O/iterudiary-22/ref=nosim" target="_blank"><img src="http://ecx.images-amazon.com/images/I/512rkaSlQDL._SL160_.jpg" alt="Web Designing (ウェブデザイニング) 2009年 08月号 [雑誌]" title="Web Designing (ウェブデザイニング) 2009年 08月号 [雑誌]" style="border: none; display: inline; vertical-align: bottom;" /></a></div>
<dl class="amazon-item-info" style="display: block; margin-left: 10px; padding: 0 8px 0 10px; font-size: 10pt; line-height: 110%;">
<dt class="amazon-item-name" style="display: block; margin-bottom: 5px; line-height: 120%;"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/B002GCGJ1O/iterudiary-22/ref=nosim" target="_blank" title="Web Designing (ウェブデザイニング) 2009年 08月号 [雑誌]">Web Designing (ウェブデザイニング) 2009年 08月号 [雑誌]</a></dt>
<dd>
<ul class="amazon-item-info-list" style="list-style-type: none; padding-left: 0px; line-height: 120%;">
<li>発売元: 毎日コミュニケーションズ</li>
<li>価格: ￥ 1,280</li>
<li>発売日: 2009/07/18</li>
</ul>
</dd>
</dl>
<p class="amazon-item-footer" style="clear: left; text-align: right; font-size: x-small; padding: 4px 10px 4px 10px; line-height: 100%; background-color: #f0f0f0;">posted with <a href="http://socialtunes.net">Socialtunes</a> at 2009/07/26</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://oneday.ter.jp/actionscript3/486.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://oneday.ter.jp/actionscript3/486.html" />
	</item>
		<item>
		<title>スクロールしても追従してくるメニュー（jQuery）</title>
		<link>http://oneday.ter.jp/css-xhtml/483.html</link>
		<comments>http://oneday.ter.jp/css-xhtml/483.html#comments</comments>
		<pubDate>Fri, 24 Jul 2009 14:15:06 +0000</pubDate>
		<dc:creator>イテル</dc:creator>
				<category><![CDATA[css＋xhtmlなど]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[webdesigning]]></category>
		<category><![CDATA[スクロール]]></category>
		<category><![CDATA[フローティング]]></category>
		<category><![CDATA[メニュー]]></category>
		<category><![CDATA[追従]]></category>

		<guid isPermaLink="false">http://oneday.ter.jp/?p=483</guid>
		<description><![CDATA[web designing（以降、webdes）の09年8月号より、自分でコピペできるようにメモ。 webdesではjQueryの特集が組んであり、これは私も将来使うのではないかと思う項目がたくさんあった。 ちなみに追従 [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://oneday.ter.jp/wp-content/uploads/2009/07/0907241-700x200.jpg" alt="090724" title="090724" width="700" height="200" class="alignnone size-thumbnail wp-image-508" /></p>
<p>web designing（以降、webdes）の09年8月号より、自分でコピペできるようにメモ。<br />
webdesではjQueryの特集が組んであり、これは私も将来使うのではないかと思う項目がたくさんあった。</p>
<p>ちなみに追従するメニューのことを、プロはフローティングメニューというらしい。<br />
さっそくwebdesのコードをさらしてみる。<br />
別途jQueryはダウンロードする必要があるのであしからず。</p>
<h3>ヘッダーにcssとjQueryを読み込む</h3>
<pre class="brush: xml; title: ; notranslate">
&lt;link rel=&quot;stylesheet&quot; href=&quot;css/main.css&quot; type=&quot;text/css&quot; media=&quot;all&quot;&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery.dimensions.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/livefloatingmenu.js&quot;&gt;&lt;/script&gt;
</pre>
<h3>コンテンツとメニュー</h3>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;contents&quot;&gt;
	&lt;h1&gt;フローティングメニュー&lt;/h1&gt;
	&lt;p&gt;ほげコンテンツ&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&quot;menu&quot;&gt;
	&lt;h2&gt;メニュー&lt;/h2&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;a href=&quot;#&quot;&gt;メニュー1&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;#&quot;&gt;メニュー2&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;#&quot;&gt;メニュー3&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;#&quot;&gt;メニュー4&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;#&quot;&gt;メニュー5&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
&lt;/div&gt;
</pre>
<h3>JS：livefloatingmenu.js</h3>
<pre class="brush: jscript; title: ; notranslate">
var name = &amp;amp;quot;#menu&amp;amp;quot;;
var menuYloc = null;
$(function(){
	menuYloc = parseInt($(name).css(&amp;amp;quot;top&amp;amp;quot;).substring(0,$(name).css(&amp;amp;quot;top&amp;amp;quot;).indexOf(&amp;amp;quot;px&amp;amp;quot;)));
	$(window).scroll(function () {
		offset = menuYloc+$(document).scrollTop()+&amp;amp;quot;px&amp;amp;quot;;
		$(name).animate({top:offset},{
			duration:350,
			queue: false
		});
	});
});
</pre>
<p>durationの数値を変えることで、追従するタイミングを変更できる。<br />
また、queueをtrueに変更すると良くわからん動きをする。</p>
<p>今回のサンプルは<a href="/html_data/0907/24/" target="_blank">コチラ</a>。</p>
<div class="amazon-item-box" style="display: block; padding: 0; border: 1px solid  #999; margin: 8px;  -moz-border-radius: 10px;">
<div class="amazon-item-image" style="display: block; padding: 10px; float: left;"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/B002GCGJ1O/iterudiary-22/ref=nosim" target="_blank"><img src="http://ecx.images-amazon.com/images/I/512rkaSlQDL._SL160_.jpg" alt="Web Designing (ウェブデザイニング) 2009年 08月号 [雑誌]" title="Web Designing (ウェブデザイニング) 2009年 08月号 [雑誌]" style="border: none; display: inline; vertical-align: bottom;" /></a></div>
<dl class="amazon-item-info" style="display: block; margin-left: 10px; padding: 0 8px 0 10px; font-size: 10pt; line-height: 110%;">
<dt class="amazon-item-name" style="display: block; margin-bottom: 5px; line-height: 120%;"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/B002GCGJ1O/iterudiary-22/ref=nosim" target="_blank" title="Web Designing (ウェブデザイニング) 2009年 08月号 [雑誌]">Web Designing (ウェブデザイニング) 2009年 08月号 [雑誌]</a></dt>
<dd>
<ul class="amazon-item-info-list" style="list-style-type: none; padding-left: 0px; line-height: 120%;">
<li>発売元: 毎日コミュニケーションズ</li>
<li>価格: ￥ 1,280</li>
<li>発売日: 2009/07/18</li>
</ul>
</dd>
</dl>
<p class="amazon-item-footer" style="clear: left; text-align: right; font-size: x-small; padding: 4px 10px 4px 10px; line-height: 100%; background-color: #f0f0f0;">posted with <a href="http://socialtunes.net">Socialtunes</a> at 2009/07/26</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://oneday.ter.jp/css-xhtml/483.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://oneday.ter.jp/css-xhtml/483.html" />
	</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.856 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-06 08:01:47 -->

