【发布时间】:2018-05-23 12:08:01
【问题描述】:
我尝试在浏览器中禁用我的光标有什么想法吗?在 aframesite (https://aframe.io/docs/master/core/utils.html#function-utils) 上,我找到了 AFRAME.utils.device.isMobile () 但我不知道我应该如何处理它我尝试了这样的事情:
<script>AFRAME.utils.device.isMobile ()
if (isMobile = true){
console.log('hallo mobile');
} else {
console.log('hallo browser');
}
</script>
所以我可以看看我是否至少可以检测到它,但我想我有语法问题,请帮助 :) 如果需要,这里是我的光标组件。
<!--camera-->
<a-entity rotation="0 90 0">
<a-camera user-height="0" look-controls>
<a-cursor cursor="fuse: true; fuseTimeout: 2000"
position="0 0 -0.1"
geometry="primitive: ring;
radiusInner: 0.002;
radiusOuter: 0.003"
material="color: red; shader: flat">
<a-animation attribute="scale"
to="3 3 3"
dur="2000"
begin="cursor-fusing"
fill="backwards"
easing="linear">
</a-animation>
</a-cursor>
<a-entity position="0 0 -0.1"
geometry="primitive: ring;
radiusInner: 0.009;
radiusOuter: 0.0095"
material="color: red; opacity: 0.25; shader: flat"></a-entity>
</a-camera>
</a-entity>
【问题讨论】:
标签: jquery browser device detection aframe