小编Bad*_*ngh的帖子

为关闭模态窗口启用向下滑动动画

我使用 html、css 和 JavaScript 创建了一个模态,其代码包含在片段中。

你会注意到当一个模态窗口打开时,它有一个从顶部滑动的动画。

我想让模态窗口在关闭时具有滑动到底部的动画(而不是在其位置时立即消失)

有人可以调整代码以达到预期的效果吗?提前致谢!

let open_modals = [];

(function() {

  // Get the button that opens the modal
  // read all the control of any type which has class as modal-button
  var btn = document.querySelectorAll(".modal-button");

  // All page modals
  var modals = document.querySelectorAll('.modal');

  // Get the <span> element that closes the modal
  var spans = document.getElementsByClassName("close");

  // When the user clicks the button, open the modal
  for (var i = 0; i …
Run Code Online (Sandbox Code Playgroud)

html javascript css css-transitions css-animations

5
推荐指数
1
解决办法
2504
查看次数

CSS 按钮边框由于某种原因不起作用

我已经为 css 按钮添加了边框,但由于某种原因,它没有生效。

有人可以建议修复吗,将代码附加到片段中

body {
  background: grey;
}

a.button {
  display: inline-block;
  -webkit-appearance: button;
  -moz-appearance: button;
  appearance: button;
  text-decoration: none;
  background-color: black;
  border: 1px solid white;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  font-size: 16px;
}
Run Code Online (Sandbox Code Playgroud)
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>CSS BUTTON</title>
</head>
<body>
<a href="#test" class="button">Click Me</a>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

html css bootstrap-4

3
推荐指数
1
解决办法
6020
查看次数