DIR : /home/kozerus/public_html/jkwii/js/jsdoit/jsdoi51/index.js
/home/kozerus/public_html/jkwii/js/jsdoit/jsdoi51
// forked from kimmy's "background-positionをアニメーションさせる" http://jsdo.it/kimmy/jceQ
(function(win, doc, $) {
"use strict";
var $x = $(".x"),
$y = $(".y"),
$xy = $(".xy"),
$model = $({x: 0, y: 0}),
BG_WIDTH = 114,
BG_HEIGHT = 114,
INTERVAL = 1000 / 30;
move();
setInterval(render, INTERVAL);
function move() {
$model[0].x = 0;
$model[0].y = 0;
$model.animate({x: BG_WIDTH, y: BG_HEIGHT}, 1000, move);
}
function render() {
$x.css({backgroundPosition: $model[0].x + "px " + 0});
$y.css({backgroundPosition: "0 " + $model[0].y + "px"});
$xy.css({backgroundPosition: $model[0].x + "px " + $model[0]. y + "px"});
}
})(this, document, $);
//
koh5_pano
Drag mouse to navigate.
Navigation
- Left/Right Mouse drag: Changes camera heading.
- Up/Sown Mouse drag: Changes camera pitch.
- Scroll wheel: Changes camera field of view.
- I-Key: Displays Info panel with canvas size, image size and FPS.
17.Aug.2010, Martin Wengenmayer