如何通过 onmouseover 事件停止 jquery 轮播?
我使用 http://www.thomaslanciaux.pro/jquery/jquery_carousel.htm 然后它会自动播放。 您可以找到播放轮播的脚本(未缩小的脚本:http:// www.thomaslanciaux.pro/js/jquery.carousel.js) 我希望轮播在鼠标悬停事件时停止。
我发现了一个名为“stopautoslide(env)”的函数,但不知道如何使用它。我尝试了一些事情,但它没有达到我想要的效果。 onmouse 事件将进入其中一张幻灯片,我在其中加载了一段视频。因此,如果人们将鼠标移到该幻灯片上并单击视频以开始播放,它应该会停止视频。 (是的,我已经用谷歌搜索过它,但没有结果。我已经联系了制造商,但没有结果..)
任何帮助将不胜感激!
编辑: 我尝试了第一个答案,您可以在此处查看: http:// www.altrient.com/cgi-bin/start.cgi/test Purpose/1test.html (即将 $('div.caroussel').bind('mouseover',function(){$('div.caroussel').carousel({autoSlide:false});}); 添加到 li.. ) 问题是,.. 我应该进一步解释一下这个轮播是如何工作的:轮播被设置为一个简单的 div 并在该 div 内有一个列表结构(ul,li,你知道如何)。在页面底部,您运行一个脚本来实际启动该轮播。
I use the carousel from http://www.thomaslanciaux.pro/jquery/jquery_carousel.htm and it plays automatically.
You can find the script that plays the carousel (the non-minified one here: http://www.thomaslanciaux.pro/js/jquery.carousel.js )
I want the carousel to stop on mouseover event.
I found a function called "stopautoslide(env)", but have no clue how to put that to use. I've tried a few things, but it didn't do what I want it to do.
The onmouse events would go inside one of the slides, in which I load a video. So if people would move their mouse over that slide to click on the video to get that started, it should stop the video.
(and yes, I've googled for it, without result. I've contacted the maker, without result..)
Any help would be greatly appreciated!
Edit:
I tried the first answer, which you view here: http://www.altrient.com/cgi-bin/start.cgi/testpurpose/1test.html
(which is to add $('div.caroussel').bind('mouseover',function(){$('div.caroussel').carousel({autoSlide:false});}); to the li.. )
The problem is, that.. I should explain a little bit further how this carousel works: The carousel is set up as a simple div and within that div a list structure (ul, li, you know how). At the bottom of the page, you run a script to actually start that carousel.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我正确理解您想要做什么:
祝您好运
编辑:回答 Malachi 问题:答案在上面的代码中:使用
{autoSlide=false}
参数。编辑:在停止轮播后,您应该添加一些内容而不是轮播 div,使用 .append()
If I understand correctly what you are trying to do:
good luck
edit: answering malachi question: the answer is in the code above: calling the carousel plugin with
{autoSlide=false}
parameter.edit:you should be adding something instead of the carousel div, after stopping the carousel.. with .append()