<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 6 年前。
标签 javascript jquery html css
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 6 年前。
所以我正在尝试制作一个日历,我把它放在你点击箭头的地方,它会改变月份的名称。但不知为何只能倒退不能前进。这是我的 Js 代码和 Html:
代码:https://jsfiddle.net/9e3ddso1/
.
因此,当您单击左侧按钮时,它会向后移动,但如果您单击右侧按钮,它不会执行任何操作。它提前一个月,但不会让你超过一个月。
最佳答案
您正在使用:
<span class="glyphicon glyphicon-chevron-right 1"></span>
在 html 文件中,但在 JS 文件中,您正在监听 right1
事件。尝试将上面的更改为:
<span class="glyphicon glyphicon-chevron-right right1"></span>
和所有类似的span
元素
问候
关于javascript - 制作不同的 div 标签以显示的 Js 代码只能以一种方式工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29855166/