Dou*_*eux 1 jquery internet-explorer google-chrome
我有这个工作在chrome和firefox上,基本上当用户点击一个子图像时,它通过改变它的显示属性从hide到show来改变主图像.这是我的img元素.
<img id="lg1" src="http...
<img id="lg2" style="display:none" src="http...
<img id="lg3" style="display:none" src="http...
Run Code Online (Sandbox Code Playgroud)
我的js看起来像这样:
$('#graph1').click(function() {
$("#lg1").css("display","inherit");
$("#lg2").css("display","none");
$("#lg3").css("display","none");
});
$('#graph2').click(function() {
$("#lg1").css("display","none");
$("#lg2").css("display","inherit");
$("#lg3").css("display","none");
});
$('#graph3').click(function() {
$("#lg1").css("display","none");
$("#lg2").css("display","none");
$("#lg3").css("display","inherit");
});
Run Code Online (Sandbox Code Playgroud)
在IE中,我收到此错误:
Could not get the display property. Invalid argument.
Run Code Online (Sandbox Code Playgroud)
无论如何我可以改变我的代码,使其与Chrome,FF和IE一起使用?
谢谢!
| 归档时间: |
|
| 查看次数: |
6951 次 |
| 最近记录: |