Skip to content

Commit 16b0313

Browse files
LightLight
authored andcommitted
fix: 修复当分类名称中包含"#"字符时无法导航的问题
1 parent 8495eff commit 16b0313

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/footer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function show_date_time() {
5252
$(this).parent("li").addClass("active");
5353
e.preventDefault();
5454
const href = $(this).attr("href");
55-
let pos = $(href).offset().top;
55+
let pos = $(`[data-set-nav=${href}]`).offset().top;
5656
const searchInput = document.querySelector('.search-input');
5757
if (isMobile) {
5858
pos -= searchInput && window.isSearchTop == '1' ? 150 : 25;

src/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class="fa fa-heart xiaotubiao"
8787
<?php if (count($categories->children) === 0) : ?>
8888
<?php $this->widget('Widget_Archive@category-' . $categories->mid, 'pageSize=10000&type=category', 'mid=' . $categories->mid)->to($posts); ?>
8989
<h4 class="text-gray"><i class="linecons-tag" style="margin-right: 7px;"
90-
id="<?php $categories->name(); ?>"></i><?php $categories->name(); ?></h4>
90+
data-set-nav="#<?php $categories->name(); ?>"></i><?php $categories->name(); ?></h4>
9191
<div class="row">
9292
<?php while ($posts->next()) : ?>
9393
<div class="col-sm-3">

0 commit comments

Comments
 (0)