我在模态对话框中使用overflow-x,但我希望滚动条在模态对话框加载后出现。在这里我只是写一个代码片段来更好地理解。有什么办法吗
HTML 文件
<div class="md-modal">
<div class="md-content">
Modal Dialog Content
</div>
</div>
CSS File
.md-modal
{
overflow-x: scroll;
}
最佳答案
像这样:
<script>
setTimeout(function() {
$('.md-modal').css('overflow-x', 'scroll');
}, 5000); // 5 seconds
</script>
确保包含 jQuery
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
关于javascript - 延迟一段时间后显示 overflow-x 滚动条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21964761/