作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
谁能告诉我如何在不重新加载页面的情况下单击按钮将全景图像转换为新图像?
我使用的 Photo Sphere 照片查看器是 https://photo-sphere-viewer.js.org
var PSVUtils = PhotoSphereViewer.Utils,
fov = 70,
PSV = new PhotoSphereViewer({
panorama: 'images/vr-min.jpg', //want to change this image
container: 'photo360',
navbar: 'autorotate zoom download fullscreen',
caption: 'vr',
mousewheel: false,
size: 800,
time_anim: false,
gyroscope: true,
// webgl: PSVUtils.isWebGLSupported(),
move_speed: 3,
default_fov: fov + .01,
min_fov: fov,
max_fov: fov + .01,
markers: [
{
// html marker with custom style
id: 'text',
longitude: -1.4,
latitude: 0.12,
html: '<a href="#" style="color:#fff;" onclick="myFunction()"><img id="myimg" src="https://png.icons8.com/color/260/circled-play.png" width="30" height="30" /></a>',
anchor: 'bottom right',
style: {
maxWidth: '20px',
color: 'white',
fontSize: '20px',
fontFamily: 'Helvetica, sans-serif',
textAlign: 'center'
},
tooltip: {
content: 'Watch this video for more details',
position: 'right',
height: '500px'
}
}
]
});
我不知道如何替换这张图片。提前致谢。
最佳答案
PSV.setPanorama('new-pano.jpg', null, true);
将为您完成工作。
假设你有一个 id 为“goto-pano”的标记,那么,
PSV.on('select-marker', (marker) => {
if (marker.id === 'goto-pano') {
PSV.setPanorama('new-pano.jpg', null, true);
}
});
或者您可以在您拥有的任何其他按钮单击事件中执行此操作。
关于javascript - 我正在使用 Photo Sphere Viewer,现在我想在不重新加载页面的情况下将全景图像替换为新图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52271424/
使用登录后,我想吐出用户名。 但是,当我尝试单击登录按钮时, 它给了我力量。 我看着logcat,但是什么也没显示。 这种编码是在说。 它将根据我在登录屏幕中输入的名称来烘烤用户名。 不会有任何密码。
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎是题外话,因为它缺乏足够的信息来诊断问题。 更详细地描述您的问题或include a min
我是一名优秀的程序员,十分优秀!