Created
November 16, 2018 20:14
-
-
Save firatoezcan/7210e6551930863ca2870cd61f162edf to your computer and use it in GitHub Desktop.
The previous code of the dynamic navigation generation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function screenClass() { | |
if ($(window).innerWidth() < 725) { | |
// getting the data from the navigation | |
var subNav = '<div id="subNavigation">' + navData + '</div>'; | |
if (!$('#subnavigation').length) { | |
$('#content').prepend(subNav); | |
$('#content').css("padding-left", "0px"); | |
$('.col-left ul:first').clone().appendTo('#subnavigation'); | |
$('#subnavigation').click(function () { | |
$('#subnavigation i').toggleClass('fa-chevron-down fa-chevron-up'); | |
$('#subnavigation ul:first').slideToggle('slow'); | |
}); | |
$('.col-left').hide(); | |
} | |
} else { | |
$('.col-left').show(); | |
$('#content').css("padding-left", "25%"); | |
$('#subNav').remove(); | |
} | |
} | |
$(window).bind('resize', function () { | |
screenClass(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment