A couple of months ago, I created a jQuery Vertical Parallax Demo that manipulated CSS to make multiple backgrounds move at different speeds relative to the users movement of the scroll bar. This type of effect is slowly appearing across various websites on the web, achieved using many different techniques. Nikebetterworld took the idea to a new level. In today’s tutorial, we’re going to take the
JavaScript おれおれ Advent Calendar 2011 – 9日目 例えばドラッグ&ドロップで移動して、移動先の座標を25px単位にしたい、とか。 要は単位数の整数倍になればいいので、何倍か(係数)を調べて、それを整数化し、単位数で乗じれば、ぴったり倍数になります。 var source = 123; // 元の値 var unit = 25; // 単位 var result = Math.trunc(source / unit) * unit; // 結果 => 100 console.log(source, "→", result);
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く