html - Bootstrap 欢迎弹出窗口和悬停

标签 html css twitter-bootstrap popup styling

我需要一点帮助来创建它。我的想法是在我的网页上有一个欢迎弹出窗口。当用户首次加载网站时。 [ image.1

几秒钟后,我需要将这张图片放在网站的右上角。像这样 image.2

我如何使用 bootstrap css 来做到这一点。请帮助我:)

最佳答案

这是 Bootstrap 4 和 JQuery。 JQuery slim 更改为 min 以允许动画。运行代码片段。

<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
      
      <style>
          img {
              width: 100%;
              width: 100%;
              position: relative;
              float: right;
          }
      </style>

    <title>Hello, world!</title>
  </head>
  <body>
    <img src="/image/Jrbqf.png">

    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script
  src="https://code.jquery.com/jquery-3.3.1.min.js"
  integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
  crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
      <script>
          
        $( document ).ready(function() {
            $('img')
                .hide()
                .fadeIn(1000)
                .delay(2000)
                .animate({
                    width: "50%",
                    height: "50%"
                }, 1500);
        });
      </script>
  </body>
</html>

关于html - Bootstrap 欢迎弹出窗口和悬停,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49292196/

相关文章:

javascript - 有没有一种 javascript 方法来检查浏览器是否 native 支持 MP3?

javascript - 为什么在通过 javascript 添加时 css 转换会回到原来的位置?

jquery - 如何将同级组件添加到 jquery 日期选择器

css - 添加更多幻灯片后 Nivo slider 元素符号 "are not centered"

javascript - CSS 使用偏移量来定位子 div 对齐方式

html - 进入导航栏 Bootstrap 的内容

javascript - 图片路径返回404错误(Not Found)

jquery - 如何更改页面的整个背景颜色?

html - 我有一个超大屏幕内的子弹列表。我希望旁边的图像与元素符号的大小完全相同?

css - 在 Twitter Bootstrap 中更改导航栏颜色