Reputation: 2527
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>
Upvotes: 0
Views: 527
Reputation: 22692
You can do this:
$('#flipPad a:not(.revert)').click();
You can also do this:
$('#flipPad a:not(.revert)').trigger('click');
Links to documentation:
Upvotes: 1
Reputation: 38193
This should trigger it programmatically (fire the event handler):
$("#flipPad a:not(.revert)").click();
Upvotes: 1