我在我的应用程序上使用了
jQuery-steps,以获得类似向导的情况.我很难找出如何改变自定义步骤.有这个帮助吗?
@H_404_2@$(function () {
$("#wizard").steps({
headerTag: "h2",bodyTag: "section",transitionEffect: "slideLeft",enableFinishButton: false,labels: {
next: $('#next').html(),prevIoUs : $('#prevIoUs').html()
},onStepChanged: function (event,currentIndex,priorIndex)
{
if( priorIndex == 0) {
var selected = $('input[name=radio_wizard]:checked','#radio_wizard').val()
switch( selected ){
case 1:
// GOTO 1
break;
case 2:
// GOTO 2
break;
case 3:
// GOTO 3
break;
}
}
}
}
如何实现这一点?
解决方法
我这样做,所以我创建了这个新功能:
@H_404_2@function _goToStep(wizard,options,state,index)
{
return paginationClick(wizard,index);
}
而没有实现的电话,把这个:
@H_404_2@$.fn.steps.setStep = function (step) { var options = getOptions(this),state = getState(this); return _goToStep(this,step); };只要利用已经存在的插件.
使用:
@H_404_2@wizard.steps("setStep",1);