$(function () {
Var fa=true;
Var top=$(' actv '). The offset (). The top;
Var top1=$(' con '). The offset (). The top;
$(' body, HTML). Stop (). The animate ({
ScrollTop: 0
})
Togg ();
The function togg () {
If ($(document). ScrollTop () & gt; Top1)={
$(' daohangl '). SlideDown (100);
} else {
$(' daohangl '). SlideUp (300);
}
If ($(document). ScrollTop () & gt;={top)
$(' dianti '). FadeIn (100);
} else {
$(' dianti '). FadeOut (300);
}
}
//scroll to make navigation inside every small plates of different colors
$(window). Scroll (function () {
Togg ();
If (fa) {
$(' eq '). Each (function (I, e) {
If ($(document). ScrollTop () & gt;=$(e). Offset (). The top) {
}
})
}
})
//click the return to the top
$(' BCTL ') on (' click ', function () {
$(' body, HTML). Stop (). The animate ({
ScrollTop: 0
});
})
//click to jump to different plate
$(' diant1 ') on (' click ', function () {
Fa=false;
Var index=$(this). The index ();
Var cont=$(' eq '). The eq (index). Offset (). The top;
$(' body, HTML). Stop (). The animate ({
ScrollTop: cont + - 50,
}, function () {
Fa=true;
})
Var as=[' # DC143C ', '# FF8C00', 'deeppink', 'burlywood', 'goldenrod', '# FF0036]
$(' diant1 '). Eq (index). Each (function (I, d) {
I=index;
$(d). The CSS (" backgroundColor ", as [I])
$(d). Siblings (). The CSS ({
BackgroundColor: 'black',
Opacity: 0.6
})
})
})
//delimit make every small plate different colors
$(' diant1 '). Hover (function () {
Var index=$(this). The index ()
Var as=[' # DC143C ', '# FF8C00', 'deeppink', 'burlywood', 'goldenrod', '# FF0036]
$(' diant1 '). Eq (index). Each (function (I, d) {
I=index;
$(d). The CSS (" backgroundColor ", as [I])
$(d). Siblings (). The CSS ({
BackgroundColor: 'black',
Opacity: 0.6
})
})
})
})
CodePudding user response:
No part of the HTML codeCodePudding user response: