我是一个HTML,CSS和JavaScript的新手,现在我遇到了一个问题,我被卡住了。带进度条的多步计算器不起作用
我的问题是,当我点击旁边转到下一个div我的进度条不起作用,但我得到下一个div。
我看到类似于我的解决方案,但他们也有问题,进度条跳转到最后一步而不是“下一步”。 下面是解我指的是: Multi-step form "next" button not working
// Script till next action knappen och step indicator
$(document).ready(function(){
var current_fs = "active";
var next_fs = 1;
$('#next').click(function() {
current_fs = $(this).parent();
next_fs = $(this).parent().next();
$('.current').removeClass('current').hide()
.next().show().addClass('current');
$('#progressbar li').eq($("current").index(next_fs)).addClass("active");
if ($('.current').hasClass('last')) {
$('#next').attr('disabled', true);
}
$('#prev').attr('disabled', null);
});
[欢迎使用堆栈溢出](http://stackoverflow.com/tour)。请解释什么不符合你的期望,以及你到目前为止所尝试过的。 – Jonathan
你的小提琴代码是使用jQuery,但你不包括jQuery。 – Bic
对不起,我的小提琴是坏的,我的代码看起来不像那样。但是,如果你检查我引用的主题,并测试最后一个小提琴在那里发布,我有一个类似的解决方案,在该解决方案和我的进度条跳到下一个命中时的最后一步。我真的很抱歉不好解释。 感谢您的欢迎。 – simsalabim33