【发布时间】:2017-07-26 01:54:15
【问题描述】:
这是我正在为 360 图片库调整的代码:
https://glitch.com/edit/#!/wild-aftershave
这是一个 MCV 版本:https://glitch.com/edit/#!/good-soup
我有一个链接模板:
<script id="link" type="text/html">
<a-entity class="link"
hover-text="value: I am hovered."
rotation="-45 0 0"
position="-4 0 0"
geometry="primitive: sphere; radius: .5"
material="shader: flat; src: ${thumb};"
event-set__1="_event: mousedown; scale: 1 1 1"
event-set__2="_event: mouseup; scale: 1.2 1.2 1"
event-set__3="_event: mouseenter; scale: 1.2 1.2 1"
event-set__4="_event: mouseleave; scale: 1 1 1"
set-image="on: click; target: #image-360; src: ${src}"
sound="on: click; src: #click-sound"
></a-entity>
</script>
个别图片链接:
<a-entity id="links" layout="type: circle; radius: 4; angle: ;" position="2 -2 .1">
<a-entity template="src: #link" data-src="#coney" data-thumb="#coney-thumb">
<!-- animation to show once a link has been clicked-->
<a-animation attribute="rotation"
dur="5000"
begin="click"
from=""
to="0 0 20"
repeat="0"></a-animation>
</a-entity>
x20...
还有一个光标/相机。
目前,当您更改图像时,会播放动画以显示您已看到该图像(此外:无法使不透明度起作用,因为它是另一个实体内部的实体内部的动画)。我想知道当您凝视图片链接时,如何将文本悬停在图片链接上。
我在这里尝试了悬停文本脚本:
(A-sphere show text on mouse over or attach a text to a-sphere),
但除非我没有将悬停文本组件放在正确的位置,否则我无法让它工作。有什么建议么?谢谢。
【问题讨论】:
-
首先,我链接了代码。其次,我现在在帖子中编辑了重要的部分。所以收回反对票。
标签: javascript aframe