mirror of
https://github.com/mdbootstrap/mdb-ui-kit.git
synced 2024-11-10 19:57:13 +03:00
bit improvement to page animation (still sucks but it's a bit better)
This commit is contained in:
parent
295064bafe
commit
1f75a69761
18
index.html
18
index.html
|
@ -960,17 +960,29 @@ push = +refs/heads/master:refs/heads/master
|
||||||
}).trigger("resize");
|
}).trigger("resize");
|
||||||
|
|
||||||
$(".menu li").click(function() {
|
$(".menu li").click(function() {
|
||||||
|
// Menu
|
||||||
if (!$(this).data("target")) return;
|
if (!$(this).data("target")) return;
|
||||||
|
if ($(this).is(".active")) return;
|
||||||
$(".menu li").not($(this)).removeClass("active");
|
$(".menu li").not($(this)).removeClass("active");
|
||||||
$(this).addClass("active");
|
$(".page").not(page).removeClass("active").hide();
|
||||||
window.page = $(this).data("target");
|
window.page = $(this).data("target");
|
||||||
var page = $(window.page);
|
var page = $(window.page);
|
||||||
window.location.hash = window.page;
|
window.location.hash = window.page;
|
||||||
$(".page").not(page).removeClass("active").hide();
|
$(this).addClass("active");
|
||||||
|
|
||||||
|
|
||||||
page.show();
|
page.show();
|
||||||
|
|
||||||
|
var totop = setInterval(function() {
|
||||||
|
$(".pages").animate({scrollTop:0}, 0);
|
||||||
|
}, 1);
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
page.addClass("active");
|
page.addClass("active");
|
||||||
}, 50);
|
setTimeout(function() {
|
||||||
|
clearInterval(totop);
|
||||||
|
}, 1000);
|
||||||
|
}, 100);
|
||||||
});
|
});
|
||||||
|
|
||||||
function cleanSource(html) {
|
function cleanSource(html) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user