Code Monkey home page Code Monkey logo

Comments (10)

mstratman avatar mstratman commented on July 28, 2024

Are you referring to the "Next", "Previous" and step-number buttons?

If so, those are currently hard-coded to the "click" event. Although I think it generally sounds like an unintuitive UI choice, it's not inconceivable to add a "buttonEvent" option that specifies what to bind to.

Just for my own curiosity, would you care to share what you're trying to do or why you want to use double clicks?

Either way, I'd be happy to accept a "buttonEvent" patch. Or I can add it myself, but I'm not sure when I will be able to get to it.

from jquery-smart-wizard.

wolispace avatar wolispace commented on July 28, 2024

Yes, its the Nex and Prev buttons I am referring to.

Please go to any demo page of SmartWizard 3 (did not appear to do it in 2) and try double-clicking "Next" instead of just single clicking at a nice logical pace.

It still amazes me how many people think they have to double-click links on a web page.

from jquery-smart-wizard.

mstratman avatar mstratman commented on July 28, 2024

So you're looking for double clicks in addition to rather than instead of single clicks?

from jquery-smart-wizard.

mstratman avatar mstratman commented on July 28, 2024

By the way, I don't think I changed the event bindings at all - so version 3 shouldn't behave differently than 2 with respect to clicks, as far as I know.
But i could certainly be mistaken.

from jquery-smart-wizard.

wolispace avatar wolispace commented on July 28, 2024

Hi sorry for my tardy replies

What I'm hoping for is the dblClick to not generate 2 single clicks, as I know several users who accidentally double-click everything in sight and this causes problems with SmartWizard. - well for the way I have implemented it anyhow.

Here is a demo of a smartWizard that demonstrates the strange behaviour. Single click slowly through each step and its fine, then start again and double-click "Next"

Notice how you see the content of 2 panels at once after double-clicking "Next" - well I do in Firefox at least. Its as if the code could not keep up with the speed of 2 "Next" clicks in sequence.

Thanks

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<link href="http://mstratman.github.com/jQuery-Smart-Wizard/styles/smart_wizard.css" rel="stylesheet" type="text/css">
<script src="http://mstratman.github.com/jQuery-Smart-Wizard/js/jquery-1.4.2.min.js"&gt;&lt;/script>
<script src="http://mstratman.github.com/jQuery-Smart-Wizard/js/jquery.smartWizard.js"&gt;&lt;/script>
<script >
$(document).ready(function(){
// Smart Wizard
$('#block_wizard').smartWizard();
});
</script>
<style>
.swMain div.actionBar {
position: absolute;
bottom:0px;
right:0px;
}
#block_wizard {
height:600px;
}

.stepContainer {
height:550px !important;
}
</style>

<body>
<div id="block_wizard" class="swMain">
<ul>
<li><a href="#block_Item_1">
<label class="stepNumber">1</label>
<span class="stepDesc">
Item 1<br />
<small>Try dblClick Next</small>
</span>
</a>
</li>
<li><a href="#block_Item_2">
<label class="stepNumber">2</label>
<span class="stepDesc">
Item 2<br />
<small>Skips to 3</small>
</span>
</a>
</li>
<li><a href="#block_Item_3">
<label class="stepNumber">3</label>
<span class="stepDesc">
Item 3<br />
<small>But shows 2+3 content</small>
</span>
</a>
</li>
</ul>
<div>
<form >
<div id="block_Item_1">
<table >
<tbody>
<tr><td>Text 1</td><td><input type="text" /></td></tr>
<tr><td>Text 2</td><td><input type="text" /></td></tr>
<tr><td>Text 3</td><td><input type="text" /></td></tr>
</tbody>
</table>
</div>
<div id="block_Item_2">
<table >
<tbody>
<tr><td>Text 3a</td><td><input type="text" /></td></tr>
<tr><td>Text 4a</td><td><input type="text" /></td></tr>
<tr><td>Text 5a</td><td><input type="text" /></td></tr>
</tbody>
</table>
</div>
<div id="block_Item_3">
<table >
<tbody>
<tr><td>Text 5b</td><td><input type="text" /></td></tr>
<tr><td>Text 6b</td><td><input type="text" /></td></tr>
<tr><td>Text 7b</td><td><input type="text" /></td></tr>
</tbody>
</table>
</div>
</form>
</div>
</div>
</body>
</html>

from jquery-smart-wizard.

irfnkprc avatar irfnkprc commented on July 28, 2024

Hi wolispace,

I found a solution to this. Not tested much.

    $(document).ready(function () {

        $('#wizard').smartWizard({
            onLeaveStep: leaveAStepCallback,
            onFinish: onFinishCallback,
            onShowStep: onShowStep
        });

        function onShowStep(obj, context) {
            $(".buttonPrevious").unbind("click").click(function (e) {
                e.preventDefault();
                $("#wizard").smartWizard("goBackward");
            });

            $(".buttonNext").unbind("click").click(function (e) {
                e.preventDefault();
                $("#wizard").smartWizard("goForward");
            });
        }

        function leaveAStepCallback(obj, context) {

            $(".buttonPrevious").unbind("click");
            $(".buttonNext").unbind("click");

            return true;
        }

        function onFinishCallback(objs, context) {

        }
    });

from jquery-smart-wizard.

wolispace avatar wolispace commented on July 28, 2024

Nice one irfnkprc.

I re-worked this logic into my code and it works a treat.

Ideally this logic would be built into SmartWziard (I will leave this open for mstratman to comment on), but until then this will do me,

Thanks

from jquery-smart-wizard.

velanchandru avatar velanchandru commented on July 28, 2024

hi irfnkprc thanks for your wonderfull fix...it works great...

from jquery-smart-wizard.

spyalert01 avatar spyalert01 commented on July 28, 2024

hi irfnkprc,
thanks for the suggestion. It works. The problem that I am facing is when the validation rule is performed and something when wrong. It will stay at the original step. This is fine. But after completing the validation and click next, it will never goto next function at all. How should I go about settling this?

from jquery-smart-wizard.

avkpol avatar avkpol commented on July 28, 2024

it works, thank you, irfnkprc!

from jquery-smart-wizard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.