mirror of
https://github.com/hacks-guide/Guide_3DS.git
synced 2025-08-30 20:00:09 +02:00
begin lang implementation
This commit is contained in:
@@ -29,8 +29,8 @@ $(document).ready(function(){
|
||||
$(".sticky").Stickyfill();
|
||||
|
||||
var stickySideBar = function(){
|
||||
var show = $(".author__urls-wrapper button").length === 0 ? $(window).width() > 1024 : !$(".author__urls-wrapper button").is(":visible");
|
||||
// console.log("has button: " + $(".author__urls-wrapper button").length === 0);
|
||||
var show = $(".author__urls-wrapper #toggle-nav").length === 0 ? $(window).width() > 1024 : !$(".author__urls-wrapper #toggle-nav").is(":visible");
|
||||
// console.log("has button: " + $(".author__urls-wrapper #toggle-nav").length === 0);
|
||||
// console.log("Window Width: " + windowWidth);
|
||||
// console.log("show: " + show);
|
||||
//old code was if($(window).width() > 1024)
|
||||
@@ -54,9 +54,9 @@ $(document).ready(function(){
|
||||
|
||||
// Follow menu drop down
|
||||
|
||||
$(".author__urls-wrapper button").on("click", function() {
|
||||
$(".author__urls-wrapper #toggle-nav").on("click", function() {
|
||||
$(".author__urls").fadeToggle("fast", function() {});
|
||||
$(".author__urls-wrapper button").toggleClass("open");
|
||||
$(".author__urls-wrapper #toggle-nav").toggleClass("open");
|
||||
});
|
||||
|
||||
// init smooth scroll
|
||||
|
10
assets/js/main.min.js
vendored
10
assets/js/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -6,15 +6,15 @@
|
||||
*/
|
||||
|
||||
var $nav = $('#site-nav');
|
||||
var $btn = $('#site-nav button');
|
||||
var $btn = $('#site-nav #toggle-nav');
|
||||
var $vlinks = $('#site-nav .visible-links');
|
||||
var $hlinks = $('#site-nav .hidden-links');
|
||||
var $hlinks = $('#site-nav .hidden-links.links-menu');
|
||||
|
||||
var breaks = [];
|
||||
|
||||
function updateNav() {
|
||||
|
||||
var availableSpace = $btn.hasClass('hidden') ? $nav.width() : $nav.width() - $btn.width() - 30;
|
||||
var availableSpace = $btn.hasClass('hidden') ? $nav.width() : $nav.width() - $btn.width() - 80;
|
||||
|
||||
// The visible list is overflowing the nav
|
||||
if($vlinks.width() > availableSpace) {
|
||||
@@ -65,8 +65,28 @@ $(window).resize(function() {
|
||||
});
|
||||
|
||||
$btn.on('click', function() {
|
||||
$hlinks.toggleClass('hidden');
|
||||
$(this).toggleClass('close');
|
||||
if($hlinks.is(":visible")){
|
||||
$hlinks.addClass('hidden');
|
||||
$btn.removeClass('close');
|
||||
} else {
|
||||
$hlinks.removeClass('hidden');
|
||||
$('.lang-menu').addClass('hidden');
|
||||
$btn.addClass('close');
|
||||
$('.lang-selector').removeClass('close');
|
||||
}
|
||||
});
|
||||
|
||||
// Language selector button
|
||||
$('.lang-selector').on('click', function() {
|
||||
if($('.lang-menu').is(":visible")){
|
||||
$('.lang-menu').addClass('hidden');
|
||||
$('.lang-selector').removeClass('close');
|
||||
} else {
|
||||
$('.lang-menu').removeClass('hidden');
|
||||
$('.lang-selector').addClass('close');
|
||||
$hlinks.addClass('hidden');
|
||||
$btn.removeClass('close');
|
||||
}
|
||||
});
|
||||
|
||||
updateNav();
|
||||
|
Reference in New Issue
Block a user