<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Tutorial: Hello Dojo!</title>
</head>
<body>
    <h1 id="greeting">Hello</h1>
    <!-- load Dojo -->
    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/dojo/1.8.0/dojo/dojo.js"
               data-dojo-config="async: true">
</script>
<script>
require(["dojo/dom", "dojo/fx", "dojo/domReady!"], function(dom, fx){
    // The piece we had before...
    var greeting = dom.byId("greeting");
    greeting.innerHTML += " from Dojo!";
 
    // ...but now, with an animation!
    fx.slideTo({
        top: 100,
        left: 200,
        node: greeting
    }).play();
});
alert("Работает!");
</script>
</body>
</html> |