文字出现延迟

时间:2015-10-16 03:50:20

标签: javascript delay

我试图找到解决方案,如何在页面加载10秒后如何在页面上显示文本?示例文本..

I didn't do anything, because I think it's about javascript here...

示例:类似这样的内容:http://postimg.org/image/duogy83zd/

1 个答案:

答案 0 :(得分:0)

尝试以下代码,这就是您所需要的:

<html>

<head>
<script>
window.onload = function(){
  var theDelay = 10;
  var timer = setTimeout("showText()",theDelay*1000)
}
function showText(){
  document.getElementById("delayedText").style.visibility = "visible";
}
</script>
</head>
<body>
<div id="delayedText" style="visibility:hidden">
I didn't do anything, because I think it's about javascript here...
</div>
</body>
</html>