需要 jQuery GalleryView Beta3 播放/暂停控件
我正在使用名为 GalleryView 的 jQuery 插件,其 Beta3 版本 (http://spaceforaname.com/galleryview)。 Beta4 版本计划内置播放/暂停动画控件。我的问题是:
如何从脚本外部模拟“播放”和“暂停”控件,而不需要修改 GalleryView 代码。有没有什么插件可以做到这一点?或者也许是无证行动?
在初始化过程中,可以决定是否要打开或关闭自动播放功能。
如果没有可用的操作/插件,您是如何解决的?您可以分享您应用的 GalleryView 修改吗?
问候, T。
I am using jQuery plugin called GalleryView, in its Beta3 version (http://spaceforaname.com/galleryview). The Beta4 version is planned to have built-in controls for play/pause animation. My question is:
How to emulate 'play' and 'pause' controls from outside the script without the need to modify GalleryView code. Is there any plugin for that? Or maybe undocumented action?
During the initialization it is possible to decide whether you want the autoplay feature on or off.
If there is no action/plugin available, how did you solve that? Can you share GalleryView modification you applied?
Regards,
T.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我通过修改原始 GalleryView 脚本解决了这个问题,添加以下内容:
paused
变量,存储暂停/播放的状态(true
如果暂停,false< /code> 如果正在播放),
添加了以下回调定义:
<前><代码>/*
** 播放暂停()
** 如果暂停则恢复幻灯片放映,如果幻灯片播放则暂停。
*/
函数播放暂停() {
如果(!暂停){
// 500 毫秒后暂停幻灯片播放。这允许鼠标在画廊上短暂滑动,而无需不必要的暂停
$(文档).oneTime(0,"animation_pause",function(){
$(文档).stopTime(“过渡”);
暂停=真;
});
$('.gv-nav-play-pause').removeClass('gv-nav-pause').addClass('gv-nav-play');
} 别的 {
$(document).stopTime("animation_pause");
if(opts.transition_interval > 0) {
$(文档).everyTime(opts.transition_interval,"过渡",function(){
显示下一个项目();
});
暂停=假;
}
$('.gv-nav-play-pause').removeClass('gv-nav-play').addClass('gv-nav-pause');
}
};
添加了一个用于播放/暂停的按钮,对其进行了样式设置,并在
点击
时附加了playPause
回调,并且一些触摸事件(以允许支持触摸的设备)。它工作起来就像一个魅力,没有故障,但代码可能并不完美 - 我不得不使用原始的 GalleryView 代码,它本身并不完美。
I solved this by modifying original GalleryView script by adding the following things:
paused
variable within script, storing the status of pause/play (true
if paused,false
if playing),added the following callback definition:
added a button for play/pause, styled it and attached
playPause
callback to it onclick
and some touch events (to allow touch-enabled devices).It worked like a charm, without glitches, but the code may not be perfect - I had to use original GalleryView code, which itself is not perfect.
截至目前,我还没有找到任何方法来关闭自动播放(我也想要这个选项)。据我了解,下一个版本将有玩家控制。截至本文发布,它仍然不稳定但很有希望。以下是 GalleryView 作者提供的版本 3 Beta4 演示页面的链接:
http://spaceforaname.com/ galleryview-3.0/testpage.html
As of now I haven't found any way to turn autoplay off (I would like that option as well). It is my understanding that the next version will have player controls. As of this post it is still unstable but promising. Here's a link to the version 3 Beta4 demo page by the GalleryView author:
http://spaceforaname.com/galleryview-3.0/testpage.html
我正在使用当前版本,需要在一个滑块上关闭自动播放。我通过在周期之间延迟 10 分钟来解决这个问题。这使得其中一张幻灯片中的 9 分钟视频有时间播放。较长的延迟(30 分钟)将有效关闭自动播放。
I'm using the current version and needed the autoplay turned off on one slider. I solved it by putting in a 10 minute delay between cycles. This gave the 9 minute video in one of the slides time to play. A longer delay (30 minutes) would effectively turn off autoplay.