问题描述
你好
如何在页面加载时将图像作为HTML和JS中的弹出窗口调用
我尝试过:
Hello
How i call image as an popup in HTML and JS on page load
What I have tried:
$(document).ready(function(){
//选择POPUP FRAME并显示它
$(#popup ).hide()。fadeIn(1000);
//如果点击id =close的按钮,则关闭POPUP
$(#close)。on(click,function(e){
e.preventDefault();
$(#popup)。 fadeOut(1000);
});
});
$(document).ready(function () {
//select the POPUP FRAME and show it
$("#popup").hide().fadeIn(1000);
//close the POPUP if the button with id="close" is clicked
$("#close").on("click", function (e) {
e.preventDefault();
$("#popup").fadeOut(1000);
});
});
<div id="popup">
<!-- and here comes the image -->
<img src="logo.png" alt="popup"/>
<!-- Now this is the button which closes the popup-->
<div class="panel-footer">
<button id="close" class="btn btn-lg btn-primary">x</button>
</div>
推荐答案
这篇关于我如何在HTML和JS中调用弹出窗口中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!