如何使用下一个和上一个按钮更改图像。 [英] How to make images change using next and previous buttons.

查看:56
本文介绍了如何使用下一个和上一个按钮更改图像。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这就是我到目前为止 -

我无法使用我的下一个链接工作,但是我之前的链接在您通过点击更改图片后工作。我想接受onclick。 out并只使用下一个和上一个链接来更改图片。我有5张照片,我只能得到两张几乎的作品:

This is what I have so far -
I cannot get my next link to work, but my previous link works after you change the pic by clicking on it. I''d like to take the "onclick" out and just use the next and previous links to change the pictures. I have 5 pictures and I can only get two to ''almost'' work:

展开 | 选择 | Wrap | 行号

推荐答案

所以你只想使用2张或更多图片吗?
so do you just want to use 2 pictures or more?


我想使用5


然后你可能会使用我们在您之前的线程中使用过的简单逻辑这里。您可以使用计数器来使用数组中的图像源:

then you might use a simple logic that we already used in your previous thread here. you could use a counter to make use of the image-sources in the array:

展开 | 选择 | Wrap | 行号


这篇关于如何使用下一个和上一个按钮更改图像。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆