1

I'm trying to create a multi-click function inside a click event for a ui dialog button. Basically I want to toggle between multiple divs to show different content inside the dialog as the user clicks the 'next' button. At the moment I can only seem to get it to trigger one event.

Here is my js that works but only triggers one event.

dialog.dialog({
        // add a close listener to prevent adding multiple divs to the document
        close: function(event, ui) {
            // remove div with all data and events
            dialog.remove();
        },
        modal: true,
        resizable: false,
        draggable: false,
        stack: false,
        width: 480,
        buttons: [
            {
                text: "Cancel",
                click: function() { $(this).dialog("close"); }
            },
            {

                id: "cta",
                click: function() {
                    $('.ui-dialog').css('top', '100px');
                    $(this).find('#modal p').remove();
                }
            }
        ]
    });

The main section is question is the last click inside 'buttons'. Is this possible? I tried to call on a function rather than setting it inside the click itself but that wouldn't work either.

4
  • The context is not very clear... Could you build a jsfiddle for us to visualize the problem ? Commented Jun 5, 2012 at 9:48
  • I am trying to achieve something along these lines: revaxarts-themes.com/?t=tour but with the standard jquery ui dialog box. Commented Jun 5, 2012 at 9:54
  • You're ambitious ;-) But it is still difficult to help you if the problem cannot be understood... Commented Jun 5, 2012 at 10:04
  • Hey. I've just come accross this javascript library: Pageguide.js - Worth having a look I think Commented Jun 7, 2012 at 7:44

1 Answer 1

2

Are you looking for something like this?

http://jsfiddle.net/rsarika/h7fSf/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.