nav js modified

This commit is contained in:
ARvind Tiwari 2017-07-29 18:37:56 +05:30
parent 6724729ae4
commit 391d123f31
2 changed files with 3 additions and 7 deletions

View File

@ -91,16 +91,12 @@
var href = $(this).attr('data-url'); var href = $(this).attr('data-url');
$('.navbar-collapse').removeClass('in'); $('.navbar-collapse').removeClass('in');
$('.navbar-collapse').addClass('collapsing'); $('.navbar-collapse').addClass('collapsing');
var url = window.location.pathname; if ($(href).length) {
var urlSplit = url.split('/');
if (urlSplit.length === 3 && urlSplit[2] === 'datacenterlight') {
$('html, body').animate({ $('html, body').animate({
scrollTop: $(href).offset().top scrollTop: $(href).offset().top
}, 1000); }, 1000);
} else { } else {
var allUrl = window.location.href; window.location.href = '/datacenterlight' + href;
var redirect = allUrl.split('whydatacenterlight')
window.location.href = '/en-us/datacenterlight' + href;
} }
}); });
} }

View File

@ -33,7 +33,7 @@
</ul> </ul>
</li> </li>
<li> <li>
<a href="{% url 'datacenterlight:index' %}/whydatacenterlight" >{% trans "Why Data Center Light?" %}</a> <a href="{% url 'datacenterlight:whydatacenterlight' %}" >{% trans "Why Data Center Light?" %}</a>
</li> </li>
<li> <li>
<a class="url" href="{% url 'datacenterlight:index' %}#contact" data-url="#contact" >{% trans "Contact" %}</a> <a class="url" href="{% url 'datacenterlight:index' %}#contact" data-url="#contact" >{% trans "Contact" %}</a>