Ben
Ben

Reputation: 62444

.trigger('click'); isn't triggering

$('a#city-prompt').fancybox({
    'width': 750
});
/*$('#city-prompt').trigger('click');*/

The code as is, works good, but when I trigger the click using jQuery it doesn't actually trigger anything

Upvotes: 1

Views: 462

Answers (2)

Mash
Mash

Reputation: 1349

Have you tried this ? :

$('#city-prompt').click(function() {
  //What you wanna do here
});

Upvotes: 0

Mārtiņš Briedis
Mārtiņš Briedis

Reputation: 17762

Try this:

$('#city-prompt').click();

Or:

$('a#city-prompt').fancybox({
  'width': 750
 }).click();

Upvotes: 3

Related Questions