2014年11月7日金曜日

jQueryでブラウザで表示中のビューポートの情報を得るには?

getViewport = function() {
    var $w = $(window);
    return {
        l: $w.scrollLeft(),
        t: $w.scrollTop(),
        w: $w.width(),
        h: $w.height()
    }
}

参考リンク
http://stackoverflow.com/questions/10324753/jquery-function-to-get-the-curren-viewport

0 件のコメント:

コメントを投稿