- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在练习一个新网站。这个网站有一个单杠。 (文本是我要标记的地方)。
我的问题是。单击选项卡时如何制作它。它将转到该选项卡并显示写入该选项卡的任何内容。
我一直尝试的一切都行不通。我需要上课吗?
感谢所有帮助过我的人!
我的代码:
<!DOCTYPE html>
<html lang="en">
<head> </head>
<title>Title - Title</title>
<body>
<body style="background-color:pink;">
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover {
background-color: #111;
}
</style>
<ul>
<li><a class="active" href="#text">text</a></li>
<li><a href="#text">text</a></li>
<li><a href="#text">text</a></li>
<li><a href="#text">text</a></li>
<li><a href="#text">text</a></li>
<li><a href="#text">text</a></li>
</ul>
</body>
</html>
最佳答案
$(function(){
$(document).on('click', '.open-panel', function(e){
$('.panel-item').each(function(){
$(this).removeClass('active');
});
var $this = $(this);
setTimeout(function(){
var panel = $this.data('panel');
$('#' + panel).addClass('active');
}, 500);
});
});
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover {
background-color: #111;
}
.panel-item {
position: relative;
max-height:0;
transition: max-height ease-in-out .4s;
-webkit-transition: max-height ease-in-out .4s;
-moz-transition: max-height ease-in-out .4s;
-o-transition: max-height ease-in-out .4s;
-ms-transition: max-height ease-in-out .4s;
overflow: hidden;
}
.panel-item.active{
max-height: 400px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<ul>
<li><a href="#text" class="open-panel" data-panel="text">text</a></li>
<li><a href="#text1" class="open-panel" data-panel="text1">text</a></li>
<li><a href="#text2" class="open-panel" data-panel="text2">text</a></li>
<li><a href="#text3" class="open-panel" data-panel="text3">text</a></li>
<li><a href="#text4" class="open-panel" data-panel="text4">text</a></li>
</ul>
<div class="panel-container">
<div id="text" class="panel-item">
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.
</div>
<div id="text1" class="panel-item">
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).
</div>
<div id="text2" class="panel-item">
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.
</div>
<div id="text3" class="panel-item">
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.
</div>
<div id="text4" class="panel-item">
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
</div>
</div>
关于HTML 水平制表符。单击显示的选项卡时如何制作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46459302/
使用制表符 - 最初,当我构建表时,我可以在列定义中提供验证选项: {title:"Rating", field:"rating", editor:"input", validator:"requir
在 Notepad++ 中有一个非常方便的按钮,我可以按下它来查看空格、制表符和换行符所在的符号,这样我就可以看到哪些空格是由空格引起的,哪些是由制表符引起的。我可以在 emacs 中做到这一点吗?如
我在 .NET Windows 窗体应用程序中使用 RichTextBox 控件。我允许用户在文本框本身内按 TAB 键。但是,当我将 .Text 值保存在文本框中时,它将显示如下: "This[]i
我想知道如何使用 Interactive Demo 上使用的选择器来清除过滤器对于性别标题。 最佳答案 如果您询问如何向选择 header 过滤器添加空选项,则只需在 headerFilterPara
我有一个包含搜索结果的制表器。这是代码: var table = new Tabulator("#json-table", { layout:"fitDataFill", //init
我正在尝试构建一个可由用户修改的交互式表格。就我而言,原始数据集是本地对象数组。 制表符具有用于删除行的buttonCross选项,但它仅影响表格视觉效果。如何让它找到该行呈现的匹配对象并将其从表数据
我正在制作许多原始 html 表格并使用它们将它们转换为制表符 var table = new Tabulator("#main", { layout:"fitColumns", to
这个问题在这里已经有了答案: Any way for a combo box with 2 values per line? (3 个答案) 关闭 9 年前。 我有一个包含各种项目的 CSV 文件。
我是 JavaScript 的新手,目前正在学习如何使用 Tabulator(除此问题外它工作得很好)。 我想为每个列标题添加一个菜单按钮,然后打开一个下拉菜单。从此菜单中,用户应该能够选择“Grou
我正在尝试处理文本区域中的粘贴代码,并希望对粘贴到第一个非间距字符的内容进行左 trim 。我想采用以下代码: if (foo) { console.log(bar);
我预计 TAB 字符会比 SPACE 字符宽,但在 HTML5 canvas 中,它们是相同的。加上其他一些,这不是那么重要: var c=document.getElementById('mycan
在 shell(GNU bash,版本 4.2.47(1)-release (x86_64-suse-linux-gnu))中,当我点击自动完成选项卡时,“$”在之后被转义变量名称已完成,但如果没有完
我正在制作一个程序,我将从 mysql 表中的 txt 文件加载数据。我将创建具有特定字段的表,然后我将从其中的 txt 文件加载数据。我正在使用 java 来执行该程序。 我写的是下面的内容: pr
Tabulator 有一个名为Column Calculations 的模块。 我需要添加页面总和和总和 例如,我可以添加页脚来计算总和,但我无法添加可见行总和,或者换句话说当前页面的总和仅在同一时间
我不是 javascript 专家,所以我有一个简短的问题,有人知道如何在这里使用 JavaScript tabifier - http://www.barelyfitz.com/projects/t
这是我之前问题的延续(如果你好奇,请检查它们)。 我已经看到了隧道尽头的曙光,但还有最后一个问题。 出于某种原因,每一行都以制表符开头。 我怎样才能忽略第一个字符(在我的例子中是“制表符”(\t))?
请指教以下理解问题??? 我在我的 Linux 机器上输入:(以便通过 top 命令获取总内存) top -n1 | grep Mem: Mem: 2075024k total, 2059064
我该如何解决这个问题: 原因: java.lang.IllegalArgumentException: String [\t] with length 2 cannot be co
1.用法 \t 表示制表符,相当于制表符 前面的输出内容位数为8的倍数,\t将输出8个空格 前面的输出内容位数不是8的倍数,\t将补足8位 2.测试用例 少于8位 等于8位 大于8位
我正在尝试将 Tabulator v4.6.3 与 fitData 布局一起使用。这是我的代码: var table = new Tabulator("#cowTable", { da
我是一名优秀的程序员,十分优秀!