我对 CSS 有相当多的了解,但我对 Javascript 完全陌生,所以我不知道如何完成以下任务,需要您的帮助。
我想在屏幕底部显示一个固定的 div,但它应该只在特定时间段后出现,假设 10 秒,如何使用以下代码实现。
CSS
.bottomdiv
{
position: absolute;
left: 0;
right: 0;
z-index : 100;
filter : alpha(opacity=100);
POSITION: fixed;
bottom: 0;
}
HTML
<div class="bottomdiv">
<iframe src="http://example.com" width="990" height="110" scrolling="no"></iframe>
</div>
谢谢。
最佳答案
您的问题中有 jQuery 标记,所以我敢打赌您使用的是 jQuery。你可以这样做:
// Execute something when DOM is ready:
$(document).ready(function(){
// Delay the action by 10000ms
setTimeout(function(){
// Display the div containing the class "bottomdiv"
$(".bottomdiv").show();
}, 10000);
});
您还应该添加“显示:无;”属性到您的 div css 类。
关于javascript - 如何在特定页面加载时间后显示 Div?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40632019/