Sliding



<button id="slideAwayButton">Slide block away</button>
<button id="slideBackButton">Slide block back</button>

<div id="slideTarget" class="red-block slide">
	A red block
</div>
<script>
	dojo.require("dojo.fx");

	dojo.ready(function(){
		var slideAwayButton = dojo.byId("slideAwayButton"),
			slideBackButton = dojo.byId("slideBackButton"),
			slideTarget = dojo.byId("slideTarget");

		dojo.connect(slideAwayButton, "onclick", function(evt){
			dojo.fx.slideTo({ node: slideTarget, left: "200", top: "200" }).play();
		});
		dojo.connect(slideBackButton, "onclick", function(evt){
			dojo.fx.slideTo({ node: slideTarget, left: "0", top: "100" }).play();
		});
	});
</script>

你可能感兴趣的:(html,dojo)