通过远程 JavaScript 循环创建多个天气馈送器
我正在使用天气源在页面上显示天气。我想以 5 秒的间隔循环浏览 2 个或更多天气位置。
我想我可以采用这样的东西如何循环浏览页面?但是没有任何运气。
3 个提要的源代码如下,我想按一定时间间隔不断循环:
<script type="text/javascript" src="http://www.weatherzone.com.au/woys/graphic_current.jsp?postcode=3000"></script>
<script type="text/javascript" src="http://www.weatherzone.com.au/woys/graphic_current.jsp?postcode=3690"></script>
<script type="text/javascript" src="http://www.weatherzone.com.au/woys/graphic_current.jsp?postcode=2000"></script>
提前致谢。
I'm using a weather feed to show weather on a page. I want to cycle through 2 or more weather locations at, say, 5 second intervals.
I thought I could adapt something like this How can I cycle through pages? but haven't had any luck.
The source code is as follows for 3 feeds that I would like to continually cycle through at interval:
<script type="text/javascript" src="http://www.weatherzone.com.au/woys/graphic_current.jsp?postcode=3000"></script>
<script type="text/javascript" src="http://www.weatherzone.com.au/woys/graphic_current.jsp?postcode=3690"></script>
<script type="text/javascript" src="http://www.weatherzone.com.au/woys/graphic_current.jsp?postcode=2000"></script>
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于这些小部件使用 document.write(),因此我最初会将所有三个小部件输出到页面,可能是无序列表,然后循环显示它们和隐藏它们。
因此,使用如下标记:
您可以使用 jQuery 执行以下操作:
Since those widgets use document.write(), i would just output all three to the page initially, in an unordered list maybe, and just cycle through showing and hiding them.
So, using markup like this:
You could use jQuery to do something like this:
干得好,克里斯。工作绝对是一种享受。
Nice work Chris. Worked an absolute treat.