在Drupal 7中,我所要做的就是添加带有颜色框的弹出窗口,将CSS类颜色框添加到链接中,以创建一个漂亮的弹出窗口。现在,使用Drupal 8,我不知道如何做到这一点。
我可以将颜色框添加到我的字段中,但是我想将它直接添加到内容正文中的链接<a class="colorbox" href"".../a>中,但它不起作用。我也不知道如何使用内联色框,如果这是解决方案。
如何添加弹出窗口?
发布于 2017-08-30 08:51:44
为了在彩色框中创建弹出窗口,您可以简单地使用“引导模式”窗口。
别忘了包括以下几点:
完整的工作代码:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>Small Modal</h2>
<!-- Trigger the modal with a button -->
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Small Modal</button>
<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Modal Header</h4>
</div>
<div class="modal-body">
<p>This is a small modal.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
https://drupal.stackexchange.com/questions/244641
复制相似问题