JQuery click()在ie8中没有触发 [英] JQuery click() not fired in ie8

查看:750
本文介绍了JQuery click()在ie8中没有触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不是一个javascript专业人士,所以我不能单独解决下面的代码。

I'm not a javascript professional so I can't solve the following code alone.

我有一个委托函数在IE7工作正常。 IE8中的问题我想出的是最后一个jQuery函数click()。有人知道我可以如何解决这个IE 8

I have a delegate function which works fine in IE7. The Problem in IE8 I figuered out is the last jquery-function click(). Does anybody know how I can solve this for IE 8

提前谢谢。

<script type="text/javascript">
function LightboxDelegate(url,caption)
{
$('#impressionen').attr({
href: url,
title: caption,
alt: caption
});
$('#impressionen').lightBox();
$('#impressionen').click();

};


推荐答案

我不知道这是否有帮助。但请尝试替换

I am not sure whether this helps or not. But try replacing

$('#impressionen').click();

$('#impressionen').trigger('click');

请参阅

触发


触发事件在每个匹配的
元素。

Trigger an event on every matched element.

这篇关于JQuery click()在ie8中没有触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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