Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
梁建民
/
liebaochHtml
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5340d5b8
authored
Apr 09, 2024
by
LJM
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
css
parent
e253fa38
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
0 deletions
css/style.less
css/style.min.css
css/style.min.css.map
js/global.js
css/style.less
View file @
5340d5b8
...
...
@@ -30,6 +30,7 @@
}
.menu-box {
position: relative;
height: 100%;
.menu {
...
...
@@ -91,6 +92,15 @@
}
}
.slider {
position: absolute;
bottom: 0;
left: 0;
height: 5px;
background: #FFFFFF;
transition: all 0.3s ease;
}
.simplified-chinese {
.iconfont {
margin-right: 4px;
...
...
css/style.min.css
View file @
5340d5b8
...
...
@@ -217,6 +217,7 @@ body {
height
:
58px
;
}
.head-wrap
.head
.main
.menu-box
{
position
:
relative
;
height
:
100%
;
}
.head-wrap
.head
.main
.menu-box
.menu
{
...
...
@@ -265,6 +266,14 @@ body {
.head-wrap
.head
.main
.menu-box
.menu
li
:hover
dl
{
display
:
block
;
}
.head-wrap
.head
.main
.menu-box
.slider
{
position
:
absolute
;
bottom
:
0
;
left
:
0
;
height
:
5px
;
background
:
#FFFFFF
;
transition
:
all
0.3s
ease
;
}
.head-wrap
.head
.main
.menu-box
.simplified-chinese
.iconfont
{
margin-right
:
4px
;
font-size
:
20px
;
...
...
css/style.min.css.map
View file @
5340d5b8
This diff is collapsed.
Click to expand it.
js/global.js
View file @
5340d5b8
...
...
@@ -4,6 +4,7 @@
this
.
created
(
this
).
handleBind
(
this
);
},
created
:
function
()
{
new
WOW
().
init
();
//全局页面动画初始化
$
(
"#slideBox"
).
slide
({
...
...
@@ -18,8 +19,31 @@
}
});
this
.
menuChnage
();
return
this
;
},
/**
* 菜单里滑块效果
*/
menuChnage
:
function
()
{
// 创建滑块标记并添加到导航条中
const
$slider
=
$
(
'<div class="slider"></div>'
);
$
(
'.menu-box'
).
append
(
$slider
);
// 监听鼠标移入菜单项事件
$
(
'.menu li'
).
on
(
'mouseenter'
,
function
()
{
const
$currentItem
=
$
(
this
);
const
offsetLeft
=
$currentItem
.
position
().
left
;
const
width
=
$currentItem
.
outerWidth
();
// 更新滑块标记位置和宽度
$slider
.
css
({
'width'
:
width
+
'px'
,
'transform'
:
'translateX('
+
offsetLeft
+
'px)'
});
});
},
handleBind
:
function
(
opt
)
{
$
(
window
).
scroll
(
function
()
{
...
...
@@ -88,6 +112,7 @@
});
});
return
this
;
},
},
$
(
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment