0
<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添加动画到框架。但它并不奏效。 Alert($ el)显示$ el是一个对象。 $ el.position是一些代码。 el.position是未定义的。如何在框架中使用jquery
代码是在这里:提前https://glitch.com/edit/#!/skill-lab
谢谢!
谢谢你的回复。我像你所说的那样做了。但它仍然不起作用。也许原因是动画? –
我添加了代码:$ el.animate({position:'1 1 1'},300);在你身边,但它也无能为力。 –
@LeMüller对不起,我只提到参考,更新 –