gpt4 book ai didi

javascript - 自动打开显示模式

转载 作者:行者123 更新时间:2023-11-28 15:44:18 25 4
gpt4 key购买 nike

我想在页面加载时打开“显示模式弹出窗口”,而不单击任何内容

这里有:

<!DOCTYPE html>
<head>
<title>Modal PopUp</title>
<link type="text/css" rel="stylesheet" href="css/style.css">
<link type="text/css" rel="stylesheet" href="css/reveal.css">

<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.min.js"></script>
<script type="text/javascript" src="js/jquery.reveal.js"></script>

<script language="JavaScript">
$(function() {
$( "#myModal" ).dialog();
});
</script>

</head>
<body>

<!-- #reveal modal popup -->

<div id="myModal" class="reveal-modal">
<h1>Reveal Modal Goodness</h1>
<p>This is a default modal in all its glory, but any of the styles here can easily be changed in the CSS.</p>
<a class="close-reveal-modal">&#215;</a>
</div>

<!-- #reveal modal popup -->
</body>
</html>

我不想使用此触发器:

<a href="#" data-reveal-id="myModal">Click Me For A Modal</a>

它应该会自动打开。

最佳答案

试试这个

$(document).ready(function() {  //or  $(window).load(function(){ 
$('#myModal').reveal($(this).data());
});

关于javascript - 自动打开显示模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22860470/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com