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

460 views Asked by At
$('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

2

There are 2 answers

2
Mārtiņš Briedis On BEST ANSWER

Try this:

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

Or:

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

Have you tried this ? :

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