navbar link hash fixed, footer links fixed
This commit is contained in:
parent
3ed2399337
commit
5550867870
6 changed files with 80 additions and 59 deletions
|
|
@ -86,6 +86,20 @@
|
|||
}
|
||||
|
||||
function _initNavUrl() {
|
||||
$('.url-init').each(function(idx, el) {
|
||||
var $this = $(el);
|
||||
var currentPath = window.location.pathname;
|
||||
var thisPaths = $this.attr('href').split('#')
|
||||
if ($this.hasClass('dropdown-toggle') && window.matchMedia("(max-width: 767px)").matches) {
|
||||
$this.removeClass('url-init');
|
||||
$this.attr('href', '');
|
||||
} else if ($('#'+thisPaths[1]).length) {
|
||||
$this.removeClass('url-init').addClass('url');
|
||||
$this.attr('href', '#' + thisPaths[1]);
|
||||
} else {
|
||||
$this.removeClass('url-init');
|
||||
}
|
||||
});
|
||||
$('.url').click(function(event) {
|
||||
event.preventDefault();
|
||||
var href = $(this).attr('href');
|
||||
|
|
@ -95,8 +109,6 @@
|
|||
$('html, body').animate({
|
||||
scrollTop: $(href).offset().top
|
||||
}, 1000);
|
||||
} else {
|
||||
window.location.href = '/datacenterlight' + href;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue