Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-settings.php on line 472

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-settings.php on line 487

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-settings.php on line 494

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-settings.php on line 530

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-includes/cache.php on line 103

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-includes/theme.php on line 623

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/custom_posts/custom_posts.php on line 22

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/pukiwiki.php on line 46

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/pukiwiki.php on line 67

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/pukiwiki.php on line 75

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/pukiwiki.php on line 92

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/class/PukiWikiRender.php on line 70

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/class/PukiWikiElement.php on line 181

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/class/PukiWikiElement.php on line 538

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/class/PukiWikiElement.php on line 695

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/class/PukiWikiElement.php on line 1087

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112
おれせか

おれせか

なんかそれっぽいのをうにうに。


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だとたまに、だいぶ下までふっとんだり、スクロールすればするほどえんえんウィンドウが縦に伸び続けるとかいう謎い動きをしたりするのですが、今んとこ放置。

必要なもの

サンプル

floatingサンプル

使い方

<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);
            });
    });
};
PAGETOP

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

「カテゴリページだけ1ページの表示数を○件に~」というように、現在のループ(カテゴリページならその該当カテゴリ、日付ページならその日付って条件の。)のクエリをちょこっと変更したいとき、query_posts()get_posts()だとまっさらな状態からループをつくってしまい、現行ループのクエリが残らない。

色々調べてみたんだけど結局どうすりゃいいのかよくわかんなかったので、今あるループの一部のクエリだけ変更してループ生成するプラグインをつくてみた。

ダウンロード:custom_posts.zip

使い方とか

<?php custom_posts('posts_per_page=30&order=ASC'); //←こんなかんじ ?>
<?php while (have_posts()) : the_post(); ?>
    <!-- ~ループの中~ -->
<?php endwhile; ?>

ソース

<?php
/*
Plugin Name: custom posts
Plugin URI: http://ichi.fool.jp/blog/
Description: 現在のクエリを変更してループに。
Version: 0.1
Author: ichi
Author URI: http://ichi.fool.jp/blog/
*/ 

function &custom_posts($query){
    if(!$query) return;

    $temp_query_vars = $GLOBALS['wp_query']->query_vars;

    if(!is_array($query))
        parse_str($query, $query);

    $query = array_merge($temp_query_vars, $query);

    unset($GLOBALS['wp_query']);
    $GLOBALS['wp_query'] =& new WP_Query();
    return $GLOBALS['wp_query']->query($query);
}
?>

やってることは単純。query_posts()の改変。今あるqueryにちょろと上書きしてもっかいループ生成。

PAGETOP

inline-block

Categories: CSS

Deprecated: Function split() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/lib/func.php on line 75
http://yomotsu.net/works/081016cssnite/

書籍などに紹介されていない display : inline-block について

うおおう。IEなんかも含めcssだけでできるんかー!!
やばいちょっと感動した。

しっかり読まなくてもアジェンダの応用例見るだけでも何ができるのかはすぐわかるよ。

div.sample {
    width: 300px;
    display: -moz-inline-box;
    display: inline-block;
    /display: inline;
    /zoom: 1;
}

div.sample > div{
    width:300px;
    display:block;
}

とりあえずこれは覚えとこう。

内部のdivは、FF2のときだけ(-moz-inline-box)そのままだと長い文字が折り返されないので内部に横幅指定したblock要素をかませるらしい。

PAGETOP

Search