- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
css 不是我的强项。我无法实现我想要使用 z-index
进行导航以使其位于前台的目标。我尝试了这种方式,包装器 position relative
(也到 nav
)和 childrens position absolute
。
Rowery
有嵌套项。
请帮忙
$(document).ready(function () {
$('div[data-v]').on('click', function () {
var that = this;
var list = $('#main-nav').find('div[data-p=' + $(that).data('v') + ']');
if (list != 'undefined' || list != null || list.length != 0) {
list.each(function () {
var that = this;
if ($(that).css('display') == "none") {
$(that).show(50, function () { $(that).fadeIn("slow"); });
} else {
$(that).hide(50, function () { $(that).fadeOut(); });
lookUpForChildrens(that);
}
});
}
});
function lookUpForChildrens(that) {
var list = $('#main-nav').find('div[data-p=' + $(that).data('v') + ']');
if (list != 'undefined' || list != null || list.length != 0) {
list.each(function () {
var that = this;
if ($(that).css('display') == "block") {
$(that).hide(50, function () { $(that).fadeOut(); });
lookUpForChildrens(that);
}
});
}
}
});
.nav-center {
display: flex;
justify-content: center;
}
.nav-center-nested {
position: absolute !important;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 998
}
.kuguar-sport-color {
background-color: #E31E24;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<body class="bg-danger">
<nav id="main-nav" class="bg-dark">
<div class="row text-center"><div class="col" data-v="138"><a class="text-black" href="#"> Aktualności</a></div><div class="col" data-v="139"><a class="text-black" href="#"> O nas</a></div><div class="col" data-v="140"><a class="text-black" href="#"> Rowery</a></div></div><div class="position-relative"><div class=".nav-center-nested row text-center"><div style="display: none;" class="col" data-p="140" data-v="368"><a class="text-black" href="#"> Górskie</a></div><div style="display: none;" class="col" data-p="140" data-v="369"><a class="text-black" href="#"> Miejskie</a></div><div style="display: none;" class="col" data-p="140" data-v="370"><a class="text-black" href="#"> Dziecięce</a></div></div></div><div class="position-relative"><div class=".nav-center-nested row text-center"><div style="display: none;" class="col" data-p="368" data-v="371"><a class="text-black" href="#"> testgorskie</a></div><div style="display: none;" class="col" data-p="368" data-v="374"><a class="text-black" href="#"> testgorskie1-1</a></div><div style="display: none;" class="col" data-p="368" data-v="375"><a class="text-black" href="#"> testgorskie1-2</a></div></div></div><div class="position-relative"><div class=".nav-center-nested row text-center"><div style="display: none;" class="col" data-p="371" data-v="372"><a class="text-black" href="#"> testgorskie2</a></div></div></div><div class="position-relative"><div class=".nav-center-nested row text-center"><div style="display: none;" class="col" data-p="372" data-v="373"><a class="text-black" href="#"> testgorskie3</a></div></div></div>
</nav>
<p>What is Lorem Ipsum?
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Why do we use it?
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
Where does it come from?
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.</p>
</body>
最佳答案
你只是把类写错了:class=".nav-center-nested"多了一个点,应该是class="nav-center-nested"
这是正确的 HTML 代码:
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<body class="bg-danger">
<nav id="main-nav" class="bg-dark">
<div class="row text-center"><div class="col" data-v="138"><a class="text-black" href="#"> Aktualności</a></div><div class="col" data-v="139"><a class="text-black" href="#"> O nas</a></div><div class="col" data-v="140"><a class="text-black" href="#"> Rowery</a></div></div><div class="position-relative"><div class="nav-center-nested row text-center"><div style="display: none;" class="col" data-p="140" data-v="368"><a class="text-black" href="#"> Górskie</a></div><div style="display: none;" class="col" data-p="140" data-v="369"><a class="text-black" href="#"> Miejskie</a></div><div style="display: none;" class="col" data-p="140" data-v="370"><a class="text-black" href="#"> Dziecięce</a></div></div></div><div class="position-relative"><div class="nav-center-nested row text-center"><div style="display: none;" class="col" data-p="368" data-v="371"><a class="text-black" href="#"> testgorskie</a></div><div style="display: none;" class="col" data-p="368" data-v="374"><a class="text-black" href="#"> testgorskie1-1</a></div><div style="display: none;" class="col" data-p="368" data-v="375"><a class="text-black" href="#"> testgorskie1-2</a></div></div></div><div class="position-relative"><div class="nav-center-nested row text-center"><div style="display: none;" class="col" data-p="371" data-v="372"><a class="text-black" href="#"> testgorskie2</a></div></div></div><div class="position-relative"><div class="nav-center-nested row text-center"><div style="display: none;" class="col" data-p="372" data-v="373"><a class="text-black" href="#"> testgorskie3</a></div></div></div>
</nav>
<p>What is Lorem Ipsum?
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Why do we use it?
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
Where does it come from?
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.</p>
</body>
关于html - 前台导航——基于引导类和自定义 js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55221885/
我正在尝试使用中介包在 R 中进行中介分析。我查看了有关如何执行此操作的文档,并通读了 R 提供的示例(即,我已经运行了“example(mediate)”)。尽管如此,我还是无法运行最简单的中介。理
我在我的应用程序中引导 View 时遇到问题。 我试图在 bootstrap 中获取 View 实例,以便我可以分配 View 变量等。 问题是我似乎无法按照推荐的方式来做。我可以做这个: $this
我已经遵循了几个有关运行 RMI 应用程序的教程。但是,我似乎无法使其工作,因为我一直陷入相同的错误:ClassNotFoundException。我知道这个错误意味着我将文件放在了错误的位置,但我尝
最后,我开始与 Aurelia 合作。有一个入门套件可用 Here这有助于初始化 Aurelia。但它是一个模板,应该在网站模板中使用。 我有一个预配置 WebApi项目,我想在其中使用 Aureli
对于回归问题,我有一个训练数据集: - 3个具有高斯分布的变量 - 20 个均匀分布的变量。 我的所有变量都是连续的,在 [0;1] 之间。 问题是用于对我的回归模型进行评分的测试数据对所有变量具有均
我正在尝试“拉伸(stretch)”或扩展第 1 列中的 A 部分以填充该行的高度。 1行2列: +---------------------+---------------------+ |
已关闭。此问题旨在寻求有关书籍、工具、软件库等的建议。不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以
我正在使用 bootstrap 4 填充功能。默认情况下,bootstrap4 中的 col 或 col-12 类在左右应用 15px 填充。我想为移动设备设置左右padding 0,所以我使用下面的
我正在尝试通过自己编写引导加载程序来引导 linux 内核,但不知道如何加载内核。 所有人都在说使用 int 13h 将扇区从硬盘加载到内存。 其中部门应该加载??加载扇区后怎么办? 如果可以的话,请
如何合并两者以创建垂直菜单?我有一个基本的路由设置(它可以工作并呈现为标准的水平菜单): Home Gallery Contact 从 react-bootst
我的应用程序中有一些状态来自服务器并且不会更改(在用户 session 的生命周期内)。此状态在 HTML 中引导。 我应该将它合并到 reducer 中作为商店的一部分吗?const bootstr
有没有办法使用 styled-components与 react-bootstrap 一起? React-bootstrap 为其组件公开了 bsClass 属性而不是 className ,这似乎与
除了 YouTube 播放器的大小之外,以下代码运行良好。我无法将其调整为我想要的大小。 我试着把 width="150"和 height="100"在 iframe 但什么也没发生。
我正在尝试使这个东西与 this one 相同。我已经打印了。但崩溃消耗不起作用。 @foreach($faqs as $faq)
我想在启动 Play 应用程序时运行一些代码。这似乎不起作用。有什么线索吗? public class Global extends GlobalSettings { @Override
我了解监督学习和无监督学习之间的区别: 监督学习是一种使用标记数据“教导”分类器的方法。 无监督学习让分类器“自行学习”,例如使用聚类。 但是什么是“弱监督学习”?它如何对示例进行分类? 最佳答案 更
我对 python 还是很陌生,所以请原谅我,如果这是非常简单的或非常错误的思考方式。 我安装了 python 2.7。根据我在运行以下代码时的理解,它列出了它查找模块的目录。 Python 2.7.
我想使用 bootstrap carousel 制作一个 slider ,但我的 slider 不滑动即使我点击按钮也不会滑动 我测试了很多其他的 bootstrap slider ,我也遇到了同样的
我正在尝试通过替换 base 形状为 (4,2) 的 2D numpy 数组按行进行采样,比如 10 次。最终输出应该是一个 3D numpy 数组。 尝试了下面的代码,它有效。但是有没有不用 for
我是 Bootstrap 的新手,现在我正在检查它的 slider 功能。简单的 slider 和动画效果 - 一切正常。 但是我看不懂,我可以做这样的东西吗? - http://www.owlcar
我是一名优秀的程序员,十分优秀!