前端之家收集整理的这篇文章主要介绍了
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,left: "0",top: "100" }).play();
});
});
</script>
原文链接:https://www.f2er.com/dojo/291694.html