6

According to the documentation, I should be able to hook onto the change event of the Fuel UX wizard component. But for the life of me I cant figure out how. I'm still new-ish to jquery and javascript.

Javascript I've tried the following

var wizard = $('#MyWizard');

wizard.on('change', '.wizard', function () {
    alert('OH SNAP!');
});

wizard.wizard().on('change', function () {
    alert('OH SNAP!');
});

... and a few other variations to no success.

I think I'm messing up the basics somewhere. How would i go about adding a custom event to the on change event. (as id like to only have one content area, but on the change event id like to have the server provide me with the required content to fill each wizard step)

4

2 回答 2

7

我痛苦地接近我需要做的事情。

 var wizard = $('#MyWizard');

 wizard.on('change', function (e, data) {
      console.log('change');      
 });

 wizard.on('changed', function (e, data) {
      console.log('changed');
 });
于 2013-04-24T14:40:01.080 回答
0

首先没有 myWizard 只是一个 MyWizard 元素。第二个 DIV 元素没有更改事件。您只需将点击事件添加到您的按钮,例如:

<button class="btn btn-mini btn-prev" disabled="disabled" id="prev"><div class="icon-arrow-left"></div>Prev</button>

接着:

$('#prev').click(function () { alert('OH SNAP!'); });
于 2013-04-24T14:47:47.340 回答