首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用彩色盒模块在节点的内容上弹出?

如何使用彩色盒模块在节点的内容上弹出?
EN

Drupal用户
提问于 2017-08-26 12:18:07
回答 1查看 1K关注 0票数 0

在Drupal 7中,我所要做的就是添加带有颜色框的弹出窗口,将CSS类颜色框添加到链接中,以创建一个漂亮的弹出窗口。现在,使用Drupal 8,我不知道如何做到这一点。

我可以将颜色框添加到我的字段中,但是我想将它直接添加到内容正文中的链接<a class="colorbox" href"".../a>中,但它不起作用。我也不知道如何使用内联色框,如果这是解决方案。

如何添加弹出窗口?

EN

回答 1

Drupal用户

发布于 2017-08-30 08:51:44

为了在彩色框中创建弹出窗口,您可以简单地使用“引导模式”窗口。

别忘了包括以下几点:

  1. bootstrap.min.css

  1. jquery.min.js

  1. bootstrap.min.js

完整的工作代码:

代码语言:javascript
复制
<!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>
票数 -1
EN
页面原文内容由Drupal提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://drupal.stackexchange.com/questions/244641

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档