prevent blink after click of menu elements

This commit is contained in:
Miguel Cardenas 2017-07-11 20:04:32 -05:00
parent f6ef24d8e6
commit fa277af33f
3 changed files with 1305 additions and 1132 deletions

File diff suppressed because it is too large Load diff

View file

@ -85,16 +85,26 @@
$(".dropdown-menu > li > a").css("color", "#fff");
}
}
function _initNavUrl() {
$('.url').click(function () {
var href = $(this).attr('data-url');
$('.navbar-collapse').removeClass('in');
$('.navbar-collapse').addClass('collapsing');
var url = window.location.pathname;
var urlSplit = url.split('/');
if (urlSplit.length === 3 && urlSplit[2] === 'datacenterlight') {
$('html, body').animate({
scrollTop: $(href).offset().top
}, 1000);
} else {
var allUrl = window.location.href;
var redirect = allUrl.split('whydatacenterlight')
window.location.href = '/en-us/datacenterlight' + href;
}
});
}
function verifiedUrl() {
if (window.location.href.indexOf('#success') > -1) {
form_success();
@ -127,6 +137,7 @@
_fetchPricing();
});
}
function _fetchPricing() {
Object.keys(cardPricing).map(function (element) {
//$('#'+cardPricing[element].id).val(cardPricing[element].value);
@ -142,9 +153,11 @@
$("#total").text(total);
$('input[name=total]').val(total);
}
function form_success() {
$('#sucessModal').modal('show');
}
function _calculate(numbers, price) {
$('#valueTotal').text(numbers * price * 31);
}

View file

@ -25,11 +25,11 @@
{% if request.resolver_match.url_name == "index" or request.resolver_match.url_name == "whydatacenterlight" %}
<li class="dropdown">
<a class="dropdown-toggle visible-mobile" href="#" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{% trans "Highlights" %}<span class="caret"></span></a>
<a class="dropdown-toggle url disabled visible-desktop" href="{% url 'datacenterlight:index' %}#how" data-url="#how" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{% trans "Highlights" %}<span class="caret"></span></a>
<a class="dropdown-toggle url disabled visible-desktop" data-url="#how" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{% trans "Highlights" %}<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a class="url" href="{% url 'datacenterlight:index' %}#your" data-url="#your" >{% trans "Scale out" %}</a></li>
<li><a class="url" href="{% url 'datacenterlight:index' %}#our" data-url="#our">{% trans "Reliable and light" %}</a></li>
<li> <a class="url" href="{% url 'datacenterlight:index' %}#price" data-url="#price" >{% trans "Order VM" %}</a></li>
<li><a class="url" data-url="#your" >{% trans "Scale out" %}</a></li>
<li><a class="url" data-url="#our">{% trans "Reliable and light" %}</a></li>
<li> <a class="url" data-url="#price" >{% trans "Order VM" %}</a></li>
</ul>
</li>
<li>