开发者

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

开发者 https://www.devze.com 2023-02-10 07:38 出处:网络
$(\'a#city-prompt\').fancybox({ \'width\': 750 }); /*$(\'#c开发者_Go百科ity-prompt\').trigger(\'click\');*/
$('a#city-prompt').fancybox({
    'width': 750
});
/*$('#c开发者_Go百科ity-prompt').trigger('click');*/

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


Try this:

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

Or:

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


Have you tried this ? :

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

精彩评论

暂无评论...
验证码 换一张
取 消