Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/plugin/notice.inc.php on line 14
Deprecated: Function split() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/lib/func.php on line 75
Deprecated: Function split() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/lib/func.php on line 75
Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/plugin/ref.inc.php on line 207
Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/plugin/region.inc.php on line 14
最新版はこちら
このプラグインの名前何にしよーって友達と喋りつつ、stalkingとかいいんじゃね?って話になったけど「それついてくるっていうより忍び寄るって意味だよ」ってことでナシに。
他にもslidingとかslipとかslimeとかも考えたけど、なんか面倒になったので仮でつけてたfloatingに決定。
わりとガチャガチャとスクロールを動かすとたまに変な動きするけどまぁいいか・・・。
あとSafariだとたまに、だいぶ下までふっとんだり、スクロールすればするほどえんえんウィンドウが縦に伸び続けるとかいう謎い動きをしたりするのですが、今んとこ放置。
必要なもの
サンプル
使い方
<script type="text/javascript"> $(function(){ $(".hogehoge").floating() }); </script>
あと、該当のエレメントにはスタイルをposition:absoluteに。
オプション
- wait(デフォルト値:100)
- スクロールしてから動き出すまで(ms)
- minDuration(デフォルト値:100)
- アニメーションの最小時間(ms)
ソース
…
$.fn.floating = function(options){ options = $.extend({ wait: 100, minDuration : 100 }, options); return $(this).each(function(){ var $this = $(this); var boxTop = function(){return $this.offset().top}; var startTop = boxTop(); var timer; $(window) .scroll(function(){ if(timer) return; timer = window.setTimeout(function(){ var scrollTop = document.body.scrollTop || document.documentElement.scrollTop; var nowTop = boxTop(); var targetTop = scrollTop + startTop; var duration = Math.max(options.minDuration, Math.abs(targetTop - nowTop)); $this .animate({ top: targetTop + "px" }, duration, function(){ timer = 0; }); }, options.wait); }); }); }; |
Prev / Next in same category
Comment Form
Trackbacks (0)
トラックバックはありません。
Comments (10)
Very interesting post. really informative. of all the blogs I have read the same topic, this one is actually enlightening.
On the keep an eye on division, LICENCE PLATE was first the actual trademark in order to incorporate connections to make sure you accredited chain stores from the internet.
I’ve been trying to find out a little more about this kind of stuff, thanks for sharing.
しっかり読まなくてもアジェンダの応用例見るだけでも何ができるのかはすぐわかるよ。
流行を見抜くことができるのも実は巡回するで。
異なる風格は過ぎて数年また流行り始めて。
休む騒動の飛躍、各種が高くて大きい上の贅沢なブランドにも次から次へとこ。
l直書きでネスト作るこ
シャネル激安は近いうちに全く新しいのを発表して制限してシリーズを設計します。
シリーズの中ですべて設計がすべてきつくてすぐの流行っている傾向を貼って、
シャネル激安http://www.cctoh.com/
また(まだ)異なる風格の組み合わせ自由を行うことができます。
シャネルバッグ
シャネル財布
シャネル腕時計
シャネルピアス
シャネル眼鏡
シャネル靴
今おしゃれな女性ネットのファッションに従って小さくいっしょにシャネルが新しく制限して袋、
シャネル激安シリーズを包みを見てみに来を編みましょう!
まぁなんかあるでしょ。
このプラグインの名前何にしよーって友達と喋りつつ、stalkingとかいいんじゃね?って話になったけど「それついてくるっていうより忍び寄るって意味だよ」ってことでナシに。
わりとガチャガチャとスクロールを動かすとたまに変な動きするけどまぁいいか・・・。