作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
尝试自动增加表单的步骤号。表单的某些元素可能会隐藏或显示,具体取决于上面的答案。
HTML
<div class="confirmation-step">
<span class="step-number"></span>
</div>
<div class="confirmation-step" style="display:none;">
<span class="step-number"></span>
</div>
<div class="confirmation-step">
<span class="step-number"></span>
</div>
jQuery
$('.confirmation-step').each(function() {
if($(this).is(':visible')) {
//set variable stepNum
//Haven't come up with anything good yet
} else {}
$(this).find('.step-number').html(stepNum);
});
示例输出
<div class="confirmation-step">
<span class="step-number">1</span>
</div>
<div class="confirmation-step" style="display:none;">
<span class="step-number"></span>
</div>
<div class="confirmation-step">
<span class="step-number">2</span>
</div>
谢谢!
最佳答案
关于javascript - 如果元素可见,则自动增加步数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24317024/
我不确定如何根据输入大小 N 确定运行时间,尤其是当它进入具有某些限制的循环时。这就是我尝试过的。我猜常数是正确的。它看起来如何? i = 1;
我想检索 1 小时前的步数。我不需要做任何特别的事情,我只需要知道用户自上一小时以来完成了多少步。 即使我的 iPhone 记录了一些步数,检索步数的查询返回“nil”。 这是代码: let c
我正在为 Android Wear 开发一款面部 watch 。我想读取 watch 计算的步数(显示在卡上的步数)。是否有任何简单的方法来访问数据?我的研究表明我可以创建自己的步数计数器(由于准确性
我是一名优秀的程序员,十分优秀!