Jquery Smart Wizard freezing up
Posted
by
Andrew
on Stack Overflow
See other posts from Stack Overflow
or by Andrew
Published on 2012-03-23T16:59:10Z
Indexed on
2012/04/10
5:29 UTC
Read the original article
Hit count: 570
I'm using IE 8 and the jquery smart wizard version 3.2.0. I've noticed when enclose the smart wizard within an additional <div>
tag (with the intent of displaying the wizard within a jquery dialog popup), the wizard will not advance steps when a function is specified for the onLeaveStep event.
And now for the code:
The javascript setting up the wizard:
$('#wizard').smartWizard({ transitionEffect: 'slideleft', onLeaveStep: leaveAStepCallback, onFinish: onFinishCallback});
Simple functions associated with the events for the wizard:
// 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
}
And the HTML markup (I removed the step content within the <p>
tags for brevity - this resulted it the same lack of functionality as if there was content within, so that can be ruled out)
<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>
Has anyone had similar results with this? Or have an explanation why the wizard will not work when nested within additional <div>
tags?
© Stack Overflow or respective owner