点击back返回上一步 input必选才能点击next
点击step1back返回startslide
四个input必选一个才能点击#step1-next,不选的话#step1-next是disabled状态
="slidebox startslide">
="start" class="custombtn" onclick="start()">START
="slidebox" id="step1" style="">
判断是否有选,有选再执行step1,具体修改看下面2处,返回和判断必须选的
<script>
function step1() {
if ($('#option1 .optioninput:checked').length == 0) {
alert('Please first choose the main part of the desktop mount that fits you.');
return false;
}
$('#step1').hide();
var step1option = $("input[name='equipment']:checked").val();
$('#step2-laptop')[step1option == "laptop" ? 'show' : 'hide']();
$('#product-laptop')[step1option == "laptop" ? 'show' : 'hide']();
$('#step2-monitor')[step1option == "monitor" ? 'show' : 'hide']();
$('#product-monitor')[step1option == "monitor" ? 'show' : 'hide']();
$('#step2-lapmoni')[step1option == "laptopmonitor" ? 'show' : 'hide']();
$('#product-lapmon')[step1option == "laptopmonitor" ? 'show' : 'hide']();
$('#step2-monitor2')[step1option == "monitormonitor" ? 'show' : 'hide']();
$('#product-monitor2')[step1option == "monitormonitor" ? 'show' : 'hide']();
return false;
}
//返回按钮点击事件
$(function () {
$('#step1back,#step2-back').click(function () {
$(this).closest('.slidebox').hide();
$('#step1').show();
});
});
</script>
您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!