<分区>
标签 javascript html css
<分区>
我有这个代码:
<H4>
<b>
<span style="color:blue;cursor:pointer" onclick="showImage(6)">test</span>
</b>
</H4>
<BR>
这是我的 JavaScript 代码:
function showImage(id){
if(id==4){
$("image4").style.display = '';
$("image5").style.display = 'none';
$("image6").style.display = 'none';
}else if(id==5){
$("image4").style.display = 'none';
$("image6").style.display = 'none';
$("image5").style.display = '';
}else{
$("image4").style.display = 'none';
$("image6").style.display = '';
$("image5").style.display = 'none';
}
我的 onclick
按钮在 Firefox 中不起作用,你能帮帮我吗?
最佳答案
你可以试试这个
function showImage(id){
if(id==4){
$("image4").css( 'display', 'block');
$("image5").css( 'display', 'none');
$("image6").css( 'display', 'none');
}else if(id==5){
$("image4").css( 'display', 'none');
$("image6").css( 'display', 'none');
$("image5").css( 'display', 'block');
}else{
$("image4").css( 'display', 'none');
$("image6").css( 'display', 'block');
$("image5").css( 'display', 'none');
}
关于javascript - onclick 按钮在 Firefox 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12734955/