jQuery UI 选项卡无法与 jwplayer javascript 一起使用
http://www.lifeisartphoto.com/player/
我正在尝试制作一个简单的 html5-友好的视频/照片库,使用 jQuery UI 中的选项卡。视频始终显示在 Tab#1 中,而照片则分别显示在后续选项卡中(如果有 3 张照片,则它们使用 Tab#2、Tab#3 和 Tab#4)。每个视频/照片的缩略图显示在选项卡下方,并控制它们的导航。
视频都在自己的选项卡中,因为我使用的是 jw 播放器,并且在不必要的情况下不想输出多个播放器。所以我给每个视频缩略图添加了onclick,它通过javascript控制jwplayer的更改和播放。
唯一的问题是,使用 thumbnail
似乎不起作用 - 就像 href 一样干扰 onclick javascript。
要复制此问题: 访问此画廊页面:http://www.lifeisartphoto.com/player/ 第一个视频将加载(有时可能很慢) 单击任意照片缩略图 单击返回第二个视频(第二个缩略图) - 它会加载第一个视频!如果您再次单击它,它将加载正确的视频。
我想我在更改选项卡并尝试同时运行一些 jwplayer javascript 时遇到问题 - 有什么方法可以让它工作,以便视频正确加载,而只需选择一次?
http://www.lifeisartphoto.com/player/
I'm trying to make a simple html5-friendly video/photo gallery that uses tabs from the jQuery UI. Videos are always displayed in Tab#1 while photos are each displayed in subsequent tabs (if there are 3 photos, they are using Tab#2, Tab#3 and Tab#4). Thumbnails for each video/photo are displayed below the tabs and control navigating through them.
Videos are all in their own tab because I'm using jw player and don't want to output multiple players if it's unnecessary. So I've added onclick to each video thumbnail, which controls changing and playing the jwplayer through javascript.
The only problem is, using <a href="#tab-1" onclick="jwplayer-javascript">thumbnail</a>
doesn't seem to work - it's like the href is interfering with the onclick javascript.
To replicate this issue:
visit this page with the gallery: http://www.lifeisartphoto.com/player/
The first video will load (it can be slow at times)
Click on any of the photo thumbnails
Click back to the second video (second thumbnail) - it loads the first video! If you click on it again, it will then load the correct video.
I guess I have a problem with changing tabs and trying to run some jwplayer javascript at the same time - is there any way to get it to work so the videos load properly while only having to select them once?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的脚本似乎在 Chrome 中运行良好。在《FF 5》中我能够重现这个问题。
您是否尝试过:
抱歉我只知道这些...
your script seem to work fine in Chrome. In FF 5 I was able to replicate the issue.
Have you tried:
Sorry thats all I know...