简体   繁体   English

上一个和下一个按钮

[英]Prev and next button

My website has previous and next buttons. 我的网站有上一个和下一个按钮。 When the page loads id like the previous button to be invisible.(on the first panel) After the user clicks the next button (to go to 2nd panel), id like the previous button to appear. 当页面加载像上一个按钮一样的ID时,它是不可见的。(在第一个面板上)用户单击下一个按钮(转到第二个面板)后,将像上一个按钮一样显示ID。

Is there some javascript that will do this? 有一些JavaScript可以做到这一点吗?

Add a CSS display: none; 添加CSS display: none; to the Previous button then add an onclick event to the button: 到上一个按钮,然后向该按钮添加一个onclick事件:

<input id="next" type="button" name="next" onclick="document.getElementById('previous').style.display = 'block';
" />

Where #previous = the ID of your previous button. 其中#previous =上一个按钮的ID。

If you are having trouble, see this link for 7 ways to hide elements using JavaScript: http://www.dustindiaz.com/seven-togglers/ 如果您遇到问题,请参见此链接,了解使用JavaScript隐藏元素的7种方法: http : //www.dustindiaz.com/seven-togglers/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM