在我的网页上,我使用 EIT Lightbox 来显示图像。我需要通过代码单击灯箱超链接。我尝试过以下方法
body.Attributes.Add("onLoad", "document.getElementById(\"lbh1\").click()\n");
body.Attributes.Add("onload", "eval(document.getElementById(\"lbh1\").href);\n");
但这似乎都不起作用。 如果我使用以下代码
body.Attributes.Add("onload", "alert('popup');\n");
显示警报
还有其他方法来进行点击吗?
最佳答案
我猜这在 Firefox 中不起作用。看看这篇文章:http://lifescaler.com/2008/04/simulating-mouse-clicks-in-javascript/或者只是在 Google 上搜索模拟鼠标事件和/或点击。
关于asp.net - 如何以编程方式单击 asp.net 中的 EIT Lightbox 超链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2534592/