如何创建一个 jQuery 循环来更改链接的 href 属性?
我使用 jQuery
从头开始构建了一个幻灯片画廊。它可以有任意数量的幻灯片。在幻灯片下方有一个“更多信息”按钮。我希望此链接每 5000 毫秒更改一次以反映正在显示的幻灯片。
我知道我可以使用 .attr
来更改 href
值本身,它只是以 5000 毫秒的间隔将其更改为不同的东西(循环!)完全不知所措...
帮助将不胜感激!
I've built a slideshow gallery from scratch using jQuery
. It can have any number of slides. Under the slideshow I have a 'More info' button. I would like this link to change every 5000ms to reflect the slide being show.
I know I can use .attr
to change the href
value itself, it is just changing it at intervals of 5000ms to different things (on a loop!) that I'm completely at a loss with...
Help would be greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用计时器。
Use a timer.