Keramet,
<!doctype html>
<html>
<head>
<meta charset="utf8">
<title>Макет!</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
function main() {
var tmr;
function stopMove () { clearInterval(tmr); }
function startMove () {
stopMove ();
tmr = setInterval(moveBtn, 24);
console.log("We START!!!");
}
function moveBtn() {
var btn = $("#btn");
var left = parseInt( btn.css("margin-Left") ) + 1;
btn.css("margin-Left", left + "px");
};
return {stopMove :stopMove , startMove : startMove } ;
};
main = main()
</script>
</head>
<body>
<header>
</header>
<main>
<img id="btn" src="img/button.gif">
</main>
<footer>
<input type='button' value='START' onclick='main.startMove()'>
<input type='button' value='STOP' onclick='main.stopMove()'>
</footer>
</body>
</html>