jQuery 向后分支按钮
我正在此网站上使用内置的 jQuery 向导: http://kflorence.github.com/ jquery-wizard/examples/ 而我正在使用的是“分支向导”。根据您的选择,您将看到不同的问题/答案。
我的问题是,到目前为止,我构建了大约 4 个问题的向导,但是当您点击“向后”按钮时,您只能返回一次。我希望能够继续单击“向后”按钮来浏览我之前遇到的所有问题。
我猜这是我需要编辑的代码部分?我只是想不通:
select: function( event, step, branch, relative, history ) {
// args: step, branch, relative, history
if ( !( event instanceof $.Event ) ) {
history = relative;
relative = branch;
branch = step;
step = event;
event = undefined;
}
if ( step == undefined ) {
return;
}
// args: [ step, branch ], relative, history
if ( $.isArray( step ) ) {
history = relative;
relative = branch;
branch = step[ 1 ];
step = step[ 0 ];
// args: step, relative, history
} else if ( typeof branch === bool ) {
history = relative;
relative = branch;
branch = undefined;
}
this._move( step, branch, relative, history, function( stepIndex, stepsTaken ) {
this._update( event, this._state( stepIndex, stepsTaken ) );
});
},
编辑:感谢@Kokos,我发现这在 Firefox 中工作正常,但在 Internet Explorer 中不起作用!有人知道如何让它在 IE 中工作吗?
I am working with a built jQuery Wizard on this site: http://kflorence.github.com/jquery-wizard/examples/ and the one I am working with is the "Branching Wizard." Based on your selections, you will go to different questions/answers.
My problem is I built the wizard with about 4 questions so far, but when you hit the "Backwards" button you only go back once. I want to be able to keep clicking the "Backwards" button to go through all the previous questions I went through.
I am guessing this is the section of the code I need to edit? I just can't figure it out:
select: function( event, step, branch, relative, history ) {
// args: step, branch, relative, history
if ( !( event instanceof $.Event ) ) {
history = relative;
relative = branch;
branch = step;
step = event;
event = undefined;
}
if ( step == undefined ) {
return;
}
// args: [ step, branch ], relative, history
if ( $.isArray( step ) ) {
history = relative;
relative = branch;
branch = step[ 1 ];
step = step[ 0 ];
// args: step, relative, history
} else if ( typeof branch === bool ) {
history = relative;
relative = branch;
branch = undefined;
}
this._move( step, branch, relative, history, function( stepIndex, stepsTaken ) {
this._update( event, this._state( stepIndex, stepsTaken ) );
});
},
EDIT: Thanks to @Kokos, I have discovered that this works fine in Firefox, but does NOT work in Internet Explorer!! Anyone have even the slightest idea how to get it to work in IE?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此版本已修复此问题: https://github.com/kflorence/jquery-向导/问题/4
This has since been fixed in this revision: https://github.com/kflorence/jquery-wizard/issues/4