只需单击按钮即可启用隐藏的div标签 [英] Enabling a hidden div tag with a click of a button
本文介绍了只需单击按钮即可启用隐藏的div标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在每次使用jquery单击下一个按钮时启用隐藏div标签,以及如何在单击上一个按钮时加载前一个div标签?
How do i enable a hidden div tag each time a next button is clicked using jquery and also how will i load the previous div tag when the previous button is clicked?
推荐答案
请参阅我对解决方案3的评论。您需要对它进行一些修改:
首先,显示其中一个div
元素从一开始就可以从其中一个中删除style =display:none
。然后,您可能需要正确启用/禁用按钮,因为在最开始时,上一步没有任何意义,并且在最后,下一步没有任何意义。你可以使用jQuert.prop()
函数;例如:
Please see my comment to Solution 3. You would need some little fixes to it:
First, to show one of thediv
elements from the very beginning, you can, for example, removestyle="display:none"
from one of them. Then, you probably need to enable/disable buttons properly, because, at the very beginning, "Previous" makes no sense, and, at the very end, "Next" makes no sense. You can do it using jQuert.prop()
function; for example:
btnPrevious =
( #btnPrevious跨度>);
btnNext =
("#btnPrevious"); btnNext =
( #btnNext );
// ...
btnPrevious .prop( disabled, true );
btnNext.prop( disabled,假跨度>);
// ...
("#btnNext"); //... btnPrevious.prop("disabled", true); btnNext.prop("disabled", false); // ...
这篇关于只需单击按钮即可启用隐藏的div标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文