如何实现同一个页面 点击上一题或者下一题时内容可以来回切换,比如说我截得这个图。求大神指导?
phpcn_u806
phpcn_u806 2017-03-13 16:39:48
0
2
2160

bVKijR.png

phpcn_u806
phpcn_u806

reply all(2)
数据分析师

How to implement the same page. When you click on the previous question or the next question, the content can be switched back and forth. For example, I took this picture. Seek guidance from God? -PHP Chinese website Q&A-How to implement the same page. When clicking on the previous question or the next question, the content can be switched back and forth. For example, I took this picture. Seek guidance from God? -PHP Chinese website Q&A

Let’s take a look and learn.

阿神

有多种办法来实现你的需求, 至于你的数据怎么获取, 就不说了(你可以通过后台直接传过来, 也可以通过ajax去后台等等), 在这里说下比较简单的实现思路.

上一题 下一题 两个按钮单独放在一个块元素内.

所有的题需要有索引, 且每个题都由一个div(或块元素)包裹起来.

初始显示的索引为0的题, 当点击下一题时, 只有索引为1的题显示, 其他都隐藏(这个主要通过控制当前索引的div的显示或隐藏来实现).当达到临界值是, 上一题或下一题的按钮无法点击.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template