Var winH=$(window). Height ();
$(' body, HTML). The animate ({
ScrollTop: winH
}, 600, the function () {
})
})
$(' works'). Click (function () {
Var winH=$(window). Height ();
$(' body, HTML). The animate ({
ScrollTop: winH * 2
}, 600, the function () {
})
})
$(' skill '). Click (function () {
Var winH=$(window). Height ();
$(' body, HTML). The animate ({
ScrollTop: winH * 3
}, 600, the function () {
})
})
$(' contavt '). Click (function () {
Var winH=$(window). Height ();
$(' body, HTML). The animate ({
ScrollTop: winH * 4
}, 600, the function () {
})
Asked how the four merged into a similar code
CodePudding user response:
; [' about ', 'works',' skill ', 'contavt']. ForEach (function (v, I) {
$(v). Click (function () {
Var winH=$(window). Height ();
$(' body, HTML). The animate ({
ScrollTop: winH * (I + 1)
}, 600, the function () {
})
})
});
CodePudding user response:
[' about ', 'works',' skill ', 'contavt']. ForEach (function (v, I) {$(v). Click (function () {
Var winH=$(window). Height ();
$(' body, HTML). The animate ({
ScrollTop: winH * (I + 1)
}, 600, the function () {
})
})
});
Remove the first semicolon? thank you
CodePudding user response: