0

This listener is currently triggered with a click in a ref in div shown below. Using jquery, how can I trigger the event programmatically? - or may be better to re-write the listener.

$("#flipPad a:not(.revert)").bind("click",function(){
    var $this = $(this);
    $("#flipbox").flip({
        direction: $this.attr("rel"),
        color: $this.attr("rev"),
        content: $this.attr("title"), 
        onBefore: function(){$(".revert").show()}
    })
    return false;
});

html:

<div id="flipbox">Message1</div>
<div id="flipPad">
<a href="#" class="left" rel="rl" rev="#39AB3E" title="Change content as <em>you</em> like!">left</a>
</div>
1

2 Answers 2

1

You can do this:

$('#flipPad a:not(.revert)').click();

You can also do this:

$('#flipPad a:not(.revert)').trigger('click');

Links to documentation:

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

Comments

1

This should trigger it programmatically (fire the event handler):

$("#flipPad a:not(.revert)").click();

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.