触发单击 jquery 不起作用 [英] Trigger click jquery not working

查看:25
本文介绍了触发单击 jquery 不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在弄清楚为什么这个简单的脚本不起作用:

I'm figuring out why this simple script is not working:

jQuery.noConflict();
jQuery(document).ready(function() {
    jQuery('.next_button a').trigger('click');
});

noConflict 是必要的,因为我也在这个页面加载了原型/scriptaculous.

noConflict is necessary because I also load prototype/scriptaculous in this page.

如果我将 .trigger('click') 替换为另一个函数(例如:.css(...) 这很有效.只有触发似乎坏了.

If I replace .trigger('click') with another function (es: .css(...) this works well. Only triggering seems to go broken.

推荐答案

如何通过 jquery 模拟锚点点击?检查此链接并查看Stevanicus 的这个回答.

$('a#swaswararedirectlink')[0].click();

这篇关于触发单击 jquery 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆