我正在寻找一种弹出窗口

I am looking for kind of popup

本文关键字:一种 窗口 寻找      更新时间:2023-09-26

我正在谷歌中寻找某种弹出窗口。假设当我按下某物时,会出现一个小云,它会在几秒钟后或我点击的任何地方消失。这叫什么??谷歌中的所有弹出窗口/模态窗口脚本都像屏幕大小一样大,使页面的其余部分消失或需要按 X 关闭它。我应该在谷歌中输入什么才能找到这样的东西?

您可以制作一个div 并设置显示:无; 和 z-索引:99999;要显示弹出窗口,您可以使用jquery.show()。像这样:

网页代码:

 <html>
      <body>
    <div id="popup">
      <p>popup content</p>
      <button type="button" id="closePopup">Close D:</button>
    </div>
    <p>This is the content of the website</p>
    <button type="button" id="openPopup">Open popup :D</button>
  </body>
</html>

.CSS

body{
  background-color:#ddd;
}
#popup{
  height:100px;
  width:100px;
  border:1px solid #444;
  position:absolute;
  margin:20px 0px 0px 300px;
  background-color:#222;
  color:#ddd;
  box-shadow: 3px 3px 10px 1px #444;
  z-index:99999;
  display:none;
}

JS (jQuery)

$('#openPopup').click(function(event){
  $('#popup').show();
});
$('#closePopup').click(function(event){
  $('#popup').hide();
});

链接到代码笔

请原谅我的英语。

相关文章: