我有一个多步骤表单,我想启用浏览器的上一个和下一个箭头键,该键位于左侧顶部。
当前,浏览器的两个箭头键已被禁用,但是如何启用它以及如何使用表单的下一个和上一个按钮?
这是我的脚本: $('.next1_2').click(function () {
var pgrbar = 2 * 5.56;
$('#step-1').css('display', 'none');
$('#step-2').css('display', 'block');
$('.progress-bar').width(pgrbar + '%');
$('#step-2').removeClass("slideInLeft").addClass("slideInRight");
$('html, body').animate({
scrollTop: $('.app-container').offset().top
}, 100);
});
$('.next2_3').click(function () {
var pgrbar = 3 * 5.56;
$('#step-2').css('display', 'none');
$('#step-3').css('display', 'block');
$('.progress-bar').width(pgrbar + '%');
$('#step-3').removeClass("slideInLeft").addClass("slideInRight");
$('html, body').animate({
scrollTop: $('.app-container').offset().top
}, 100);
});
$('.next3_4').click(function () {
var pgrbar = 4 * 5.56;
$('#step-3').css('display', 'none');
$('#step-4').css('display', 'block');
$('.progress-bar').width(pgrbar + '%');
$('#step-4').removeClass("slideInLeft").addClass("slideInRight");
$('html, body').animate({
scrollTop: $('.app-container').offset().top
}, 100);
});
$('.prev2_1').click(function () {
var pgrbar = 1 * 5.56;
$('#step-2').css('display', 'none');
$('#step-1').css('display', 'block');
$('.progress-bar').width(pgrbar + '%');
$('#step-1').removeClass("slideInRight").addClass("slideInLeft");
$('html, body').animate({
scrollTop: $('.app-container').offset().top
}, 100);
});
$('.prev3_2').click(function () {
var pgrbar = 2 * 5.56;
$('#step-3').css('display', 'none');
$('#step-2').css('display', 'block');
$('.progress-bar').width(pgrbar + '%');
$('#step-2').removeClass("slideInRight").addClass("slideInLeft");
$('html, body').animate({
scrollTop: $('.app-container').offset().top
}, 100);
});
$('.prev4_3').click(function () {
var pgrbar = 3 * 5.56;
$('#step-4').css('display', 'none');
$('#step-3').css('display', 'block');
$('.progress-bar').width(pgrbar + '%');
$('#step-3').removeClass("slideInRight").addClass("slideInLeft");
$('html, body').animate({
scrollTop: $('.app-container').offset().top
}, 100);
});
0 个答案:
没有答案