Built own responsive menu solution to replace bootstraps

This commit is contained in:
Peter McAtominey 2013-07-31 08:17:05 +01:00
parent ab709b924d
commit 5d9a07cdb2
7 changed files with 53 additions and 23 deletions

View File

@ -6508,8 +6508,15 @@ body {
display: block;
}
}
@media (max-width: 480px) {
@media (max-width: 768px) {
.sub-nav-collapse {
display: none;
}
}
@media (min-width: 768px) {
.sub-nav-collapse {
display: block;
}
}
@media only screen and (max-width: 800px) {
/* Force table to not be like tables anymore */

View File

@ -6508,8 +6508,15 @@ body {
display: block;
}
}
@media (max-width: 480px) {
@media (max-width: 768px) {
.sub-nav-collapse {
display: none;
}
}
@media (min-width: 768px) {
.sub-nav-collapse {
display: block;
}
}
@media only screen and (max-width: 800px) {
/* Force table to not be like tables anymore */

View File

@ -6508,8 +6508,15 @@ body {
display: block;
}
}
@media (max-width: 480px) {
@media (max-width: 768px) {
.sub-nav-collapse {
display: none;
}
}
@media (min-width: 768px) {
.sub-nav-collapse {
display: block;
}
}
@media only screen and (max-width: 800px) {
/* Force table to not be like tables anymore */

View File

@ -6508,8 +6508,15 @@ body {
display: block;
}
}
@media (max-width: 480px) {
@media (max-width: 768px) {
.sub-nav-collapse {
display: none;
}
}
@media (min-width: 768px) {
.sub-nav-collapse {
display: block;
}
}
@media only screen and (max-width: 800px) {
/* Force table to not be like tables anymore */

View File

@ -238,13 +238,13 @@ if ($homepage && $homepage_url !== '/') {
<div class="left-column article-tree span3">
<!-- For Mobile -->
<div class="responsive-collapse">
<button type="button" class="btn btn-sidebar" data-toggle="collapse" data-target="#sub-nav-collapse">
<button type="button" class="btn btn-sidebar" id="menu-spinner-button">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div id="sub-nav-collapse" class="collapse in">
<div id="sub-nav-collapse" class="sub-nav-collapse">
<!-- Navigation -->
<?php echo build_nav($tree); ?>

View File

@ -8,16 +8,15 @@ $(function() {
// Bootstrap Table Class
$('table').addClass('table');
var mobileNavWorkaround = function() {
if($(window).width()< 768) {
$('#sub-nav-collapse').css('height', '0px');
} else {
$('#sub-nav-collapse').css('height', 'auto');
}
}
$(window).resize(function() {
mobileNavWorkaround();
// Responsive menu spinner
$('#menu-spinner-button').click(function() {
$('#sub-nav-collapse').slideToggle();
});
// Catch browser resize
$(window).resize(function() {
// Remove transition inline style on large screens
if ($(window).width() >= 768)
$('#sub-nav-collapse').removeAttr('style');
});
mobileNavWorkaround();
});

View File

@ -265,8 +265,11 @@ html, body {
}
}
.sub-nav-collapse {
@media (max-width: 480px) {
//display: none;
@media (max-width: 768px) {
display: none;
}
@media (min-width: 768px) {
display: block;
}
}