我正在开发类似找不同游戏的东西,但我正在使用 Javascript 来进行找茬。
这里是:我有一些用 CSS 定位的透明按钮(css 样式背景透明),当我单击透明按钮时,会出现 Blob (使用 style.visibility)。问题是,此 javascript 在 Google Chrome 和 Safari 中都运行良好,但我不知道为什么这些按钮在 IE 和 Firefox 中不起作用。
你能帮我解决这个问题吗?我对这个问题感到困惑。谢谢!
最佳答案
这对我来说在所有浏览器中都很好
css:
button{
display:block;
width:500px;
height:500px;
background-color:transparent;
border: 1px solid #000;
}
javascript: document.getElementById('but').onclick=function(){ this.style.backgroundColor="#000" }
关于javascript - 透明按钮无法在 Firefox 和 IE 中单击,但在 Chrome 和 Safari 中可以正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9020480/