【问题标题】:not working in ie , opera how to fix?无法在 ie 中工作,Opera 如何解决?
【发布时间】:2012-08-16 21:21:09
【问题描述】:

http://jsfiddle.net/altafali/G2pLW/16/

如何修复它以在 ie 或 Opera 浏览器中工作?

我还想在这个 div 的可见性上添加一些延迟?像 30 秒的计时器询问 onclick 您的链接将在 30 秒后出现

在此处查看实际操作 http://www.symbianhome.com/ibibo-ibrowser-free-download-v2

谢谢

【问题讨论】:

  • 在 Opera 中工作正常。你能更详细地描述你看到的问题吗?
  • 删除缓存后在 Opera 中工作,但是如何在单击下载按钮后添加计时器,例如在附加的 div 出现 30 秒后单击按钮?

标签: internet-explorer button opera


【解决方案1】:

代码在 Opera 中运行。对于延迟显示,使用它。单击后它还会禁用该按钮。

<script>
var remaining=30;
function countDown() {
  remaining--; //decrease remaining
  document.getElementById('counter').innerText = remaining; //update display
  if (remaining > 0) { //more remains?
    window.setTimeout(countDown, 1000); //yes. wait again
  } else { //no. show the content
    document.getElementById('divId').style.visibility = 'visible';
  }
}
function delayShow(ele) {
  ele.disabled = true;
  document.getElementById('counter').innerText = remaining; //show it
  window.setTimeout(countDown, 1000); //wait for 1 second then call countDown
}
</script>

<div id="divId" style="visibility:hidden">Content!</div>

<button onclick="delayShow(this)">DOWNLOAD</button> <span id="counter"></span>

【讨论】:

  • span 标签应该放在哪里?
  • ok 添加了脚本,工作正常,但是如何在下载按钮中添加这个计数器,现在它在下载按钮消失后按下下载按钮时运行,计数器以小字体开始,实际上不太明显我需要将 4shared.com 上显示的此类按钮添加为免费下载按钮,感谢您的帮助
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2022-11-17
  • 2011-11-15
  • 2017-01-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-03-09
相关资源
最近更新 更多