openstack-manuals/www/static/common/js/navigation.js
Tom Fifield c7ed201cf5 New homepage design
This commit adds all files for the new landing design by
Wes Wilson, modifies templates and pages to use the new
design.

Change-Id: I3447172321731989703849b7c99eb030b04fd74f
2015-01-30 15:36:50 +08:00

68 lines
2.0 KiB
JavaScript

// Open header search bar
$(function() {
$(".search-icon").click(function() {
$(".navbar-main").toggleClass("show");
$(".search-container").toggleClass("show");
$(".search-icon").toggleClass("show");
$('#gsc-i-id1').focus();
});
});
// Close header search bar
$(function() {
$(".close-search").click(function() {
$(".navbar-main").toggleClass("show");
$(".search-container").toggleClass("show")
$(".search-icon").toggleClass("show");
});
});
// Open header drop downs on hover
jQuery(document).ready(function(){
if (jQuery(window).width() > 767) {
$('ul.navbar-main li ul.dropdown-menu').addClass('dropdown-hover');
$('ul.navbar-main li').hover(function() {
$(this).find('.dropdown-hover').stop(true, true).delay(400).fadeIn(100);
}, function() {
$(this).find('.dropdown-hover').stop(true, true).delay(100).fadeOut(200);
});
} else {
$('ul.navbar-main li ul.dropdown-menu').removeClass('dropdown-hover');
}
});
jQuery(window).resize(function () {
if (jQuery(window).width() > 767) {
$('ul.navbar-main li ul.dropdown-menu').addClass('dropdown-hover');
$('ul.navbar-main li').hover(function() {
$(this).find('.dropdown-hover').stop(true, true).delay(400).fadeIn(100);
}, function() {
$(this).find('.dropdown-hover').stop(true, true).delay(100).fadeOut(200);
});
} else {
$('ul.navbar-main li ul.dropdown-menu').removeClass('dropdown-hover');
}
});
// Remove Search text in smaller browser windows
jQuery(document).ready(function(){
if (jQuery(window).width() < 1050) {
$('#search-label').text('');
} else {
$('#search-label').text('Search');
}
});
jQuery(window).resize(function () {
if (jQuery(window).width() < 1050) {
$('#search-label').text('');
} else {
$('#search-label').text('Search');
}
});
// Show placeholder text in Google Search
setTimeout( function() {
$(".gsc-input").attr("placeholder", "search openstack");
}, 1000 );