mirror of
https://gitee.com/ulthon/layui-ul.git
synced 2026-07-09 13:42:48 +08:00
增加副标题
This commit is contained in:
@@ -603,6 +603,7 @@
|
|||||||
padding: 5px 0;
|
padding: 5px 0;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: #333;
|
color: #333;
|
||||||
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ul-nav-min-item:hover {
|
.ul-nav-min-item:hover {
|
||||||
|
|||||||
@@ -73,6 +73,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="right-tips-container" style="display: none;">
|
||||||
|
<div class="ul-nav-min right-tips-nav" style="width: 160px;">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="tpl" style="display: none;">
|
||||||
|
<a class="ul-nav-min-item">
|
||||||
|
个人中心
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
<script>
|
<script>
|
||||||
function renderRepeat(elem) {
|
function renderRepeat(elem) {
|
||||||
$(elem).find('[data-repeat]').each(function () {
|
$(elem).find('[data-repeat]').each(function () {
|
||||||
@@ -116,6 +126,32 @@
|
|||||||
layui.util.fixbar()
|
layui.util.fixbar()
|
||||||
|
|
||||||
|
|
||||||
|
$('.main-content h2,.main-content>.demo-page>fieldset>legend').each(function (index, elem) {
|
||||||
|
|
||||||
|
var id = 'title' + index;
|
||||||
|
$(elem).attr('id', id)
|
||||||
|
|
||||||
|
var navItem = $('.tpl .ul-nav-min-item').clone()
|
||||||
|
navItem.attr('href', '#' + id)
|
||||||
|
navItem.text($(elem).text())
|
||||||
|
navItem.appendTo('.right-tips-nav')
|
||||||
|
})
|
||||||
|
|
||||||
|
if ($('.right-tips-nav').children().length > 0) {
|
||||||
|
layer.open({
|
||||||
|
type: 1,
|
||||||
|
content: $('.right-tips-container'),
|
||||||
|
title: '目录',
|
||||||
|
offset: 'r',
|
||||||
|
closeBtn: 0,
|
||||||
|
shade: 0,
|
||||||
|
success(layero){
|
||||||
|
$(layero).css('margin-left','-15px')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user