我在 html5 edge animate 中遇到问题。我使用 edge animate 创建了一个动画。
我想从外部调用边缘动画的组合准备。我尝试使用 $.Edge.registerCompositionReadyHandler(compId, handlerFn, options)
调用,但它给出了错误 ReferenceError: $ is not defined
。我无法解决这个问题,也没有找到足够的文档。谁能帮帮我吗。
我的代码是这样的
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<title>Untitled</title>
<!--Adobe Edge Runtime-->
<script type="text/javascript" charset="utf-8" src="teste1_edgePreload.js"></script>
<script type="text/javascript" src="teste1_resize.js"></script>
<style>
.edgeLoad-EDGE-1429726 { visibility:hidden; }
</style>
<!--Adobe Edge Runtime End-->
<script>
$.Edge.registerCompositionReadyHandler("EDGE-1429726",scaleStage) //SCALE STAGE IS INSIDE THE JAVASCRIPT fn teste1_resize.js
function mover(){
var stage = $.Edge.getComposition("EDGE-1429726").getStage();
console.log($("#Stage").height());
stage.mover();
}
</script>
</head>
<body style="margin:0;padding:0;">
<div id="Stage" class="EDGE-1429726">
<input type="button" value="Mover" onClick="mover();">
</div>
</body>
提前致谢
最佳答案
在 Ena 的帮助和少量修改下,我找到了答案。
AdobeEdge.bootstrapCallback(function(compId) {
AdobeEdge.Symbol.bindElementAction(compId, 'stage', 'document', 'compositionReady', function(sym, e){
// composition is loaded, do stuff here
});
});
关于javascript - 从 javascript 调用组合准备好(边缘动画),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16531882/