【发布时间】:2017-07-31 19:37:23
【问题描述】:
<a-gltf-model id="nacl500" src="#bottle" scale="0.1 0.1 0.1" position="-0.27 1.410 -0.83" rotation="0 270 0"
bottleactivity__movetocamera="event:movetocamera" bottleactivity__rotatetobacksite="event:rotatetobacksite" bottleactivity__rotatetotopsite="event:rotatetotopsite"
bottleactivity__movetodesk="event:movetodesk" bottleactivity__takeoffcap="event:takeoffcap" bottleactivity__hang="event:hang">
<a-gltf-model src="#bottlewaterbottom"></a-gltf-model>
<a-gltf-model id="bottlecap" src="#bottledecker" position="0 0.904 0"></a-gltf-model>
<a-gltf-model src="#naci500"></a-gltf-model>
</a-gltf-model>
init:function(){
var self=this;
var data= this.data;
var el=this.el;
//var $el=$("#nacl500");
var $el=$(el);
var status=0;
this.movetocamera=function(){
//alert(data.message);
//el.setAttribute("position", "0 1.054 -0.19");
//alert($el.position);
$el.animate({position:'0 1.054 -0.19'},"slow");
};
我想通过 jquery 将动画添加到 aframe。但它不起作用。 Alert($el) 表明 $el 是一个对象。 $el.position 是一些代码。 el.position 未定义。
代码在这里:https://glitch.com/edit/#!/skill-lab
提前致谢!
【问题讨论】: