我如何在HTML和JS中调用弹出窗口中的图像 [英] How I call image on popup in HTML nd JS

查看:47
本文介绍了我如何在HTML和JS中调用弹出窗口中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好



如何在页面加载时将图像作为HTML和JS中的弹出窗口调用



我尝试过:



Hello

How i call image as an popup in HTML and JS on page load

What I have tried:

Quote:

$(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>

推荐答案

(document).ready(function(){



//选择POPUP FRAME并显示它
(document).ready(function () {

//select the POPUP FRAME and show it


(#popup)。hide()。fadeIn(1000);



//如果点击id =close的按钮,则关闭POPUP
("#popup").hide().fadeIn(1000);

//close the POPUP if the button with id="close" is clicked


(#close)。on( click,function(e){

e.preventDefault();
("#close").on("click", function (e) {
e.preventDefault();


这篇关于我如何在HTML和JS中调用弹出窗口中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆