我正在使用 IE 8 和 jquery 智能向导 3.2.0 版。我注意到当将智能向导包含在附加<div>
标记中时(目的是在 jquery 对话框弹出窗口中显示向导),当为 onLeaveStep 事件指定函数时,向导不会推进步骤。
现在是代码:
javascript设置向导:
$('#wizard').smartWizard({ transitionEffect: 'slideleft', onLeaveStep: leaveAStepCallback, onFinish: onFinishCallback});
与向导事件相关的简单函数:
// wizard functions
function leaveAStepCallback(obj) {
// Get current step
var step_num = obj.attr('rel'); // get the current step number
}
function onFinishCallback() {
alert('Finish Called');
}
function showStep(obj) {
// Get current step
var step_num = obj.attr('rel'); // get the current step number
}
以及 HTML 标记(<p>
为简洁起见,我删除了标签中的步骤内容 - 这导致它缺少功能,就好像其中有内容一样,因此可以排除)
<div id="wizDialog">
<div id="wizard" class="swMain">
<ul>
<li><a href="#step-1">
<label class="stepNumber">1</label>
<span class="stepDesc">
Step 1<br />
<small>Step 1 - </small>
</span>
</a></li>
<li><a href="#step-2">
<label class="stepNumber">2</label>
<span class="stepDesc">
Step 2<br />
<small>Step 2 - </small>
</span>
</a></li>
<li><a href="#step-3">
<label class="stepNumber">3</label>
<span class="stepDesc">
Step 3<br />
<small>Step 3 - </small>
</span>
</a></li>
<li><a href="#step-4">
<label class="stepNumber">4</label>
<span class="stepDesc">
Step 4<br />
<small>Step 4 - </small>
</span>
</a></li>
<li><a href="#step-5">
<label class="stepNumber">5</label>
<span class="stepDesc">
Step 5<br />
<small>Step 5 - </small>
</span>
</a></li>
<li><a href="#step-6">
<label class="stepNumber">6</label>
<span class="stepDesc">
Step 6<br />
<small>Step 6 - </small>
</span>
</a></li>
<li><a href="#step-7">
<label class="stepNumber">7</label>
<span class="stepDesc">
Step 7<br />
<small>Step 7 - </small>
</span>
</a></li>
<li><a href="#step-8">
<label class="stepNumber">8</label>
<span class="stepDesc">
Step 8<br />
<small>Step 8 - </small>
</span>
</a></li>
</ul>
<div id="step-1">
<h2 class="StepTitle">Step 1 Content</h2>
<p>
</p>
</div>
<div id="step-2">
<h2 class="StepTitle">Step 2 Content</h2>
<p>
</p>
</div>
<div id="step-3">
<h2 class="StepTitle">Step 3 Content</h2>
<p>
</p>
</div>
<div id="step-4">
<h2 class="StepTitle">Step 4 Content</h2>
<p>
</p>
</div>
<div id="step-5">
<h2 class="StepTitle">Step 5 Content</h2>
<p>
</p>
</div>
<div id="step-6">
<h2 class="StepTitle">Step 6 Content</h2>
<p>
</p>
</div>
<div id="step-7">
<h2 class="StepTitle">Step 7 Content</h2>
<p>
</p>
</div>
<div id="step-8">
<h2 class="StepTitle">Step 8 Content</h2>
<p>
</p>
</div>
</div>
</div>
有没有人有类似的结果?<div>
或者解释为什么向导在嵌套在其他标签中时不起作用?