Solved

Nav collapse doesn't work correctly

Posted on 2014-11-18
9
85 Views
Last Modified: 2014-11-20
Hello, on mkmeals.com/responsive/index.html, when you make the browser small or use it on a phone, the toggle expands the menu correctly, but it doesn't toggle back to collapse.

I hope I've explained that correctly. Thanks.
0
Comment
Question by:mel200
  • 6
  • 3
9 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40453345
Same old thing mel200.  The code is not valid.  It is full of tagging errors whose nature would definite create an unstable condition. Cleaning up the code might solve this and if not at least we will know what to expect from the code.  Trying to fix presentation issues when the code is not stable is generally not very productive.

Cd&
0
 

Author Comment

by:mel200
ID: 40453392
I've heard that the validator doesn't work on Bootstrap, in fact I can probably find that here somewhere, I'll find the question.
0
 

Author Comment

by:mel200
ID: 40453406
Here's what I'm talking about, but I'll run the validator now. Thanks.

http://moz.com/community/q/how-important-is-w3c-validation-for-mobile-sites
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:mel200
ID: 40453476
Ok, all but two are corrected, I can't seem to fix those, they are related:

 Error Line 144, Column 8: End tag for body seen, but there were unclosed elements.

      </body>


Error Line 31, Column 26: Unclosed element div.

                  <div class="container">
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40455309
The link you posted is full of incorrect information, and I doubt any of the posters to it have ever actually seen what browser code looks like. I have and the validator follows exactly the same steps as the parser in modern browsers.  The fact that bootstrap results in invalid code is because it is not optimized for anything but Twitter functionality and like many large site they have in-house staff that has develop code that optimizes for their site.  They ignore standards which means that you get inefficient and frequently unreliable code.

Every error forces the parser to execute extra code because the errors have to be resolved by the parser or what get serialize into the the CSS Object and Document Object can crash the browser with an uncaught exception.

As for the remaining error (2 messages but both are caused by the same error), the fact that the container div is not closed means that every element in the page is inheriting from is and it has padding and margin properties that have a definite impact on positioning.

So either close the container or remove if if it is actually extemporaneous.

Cd&
0
 

Author Comment

by:mel200
ID: 40455493
Will adding a </div> at the end of the document close that correctly?
0
 

Author Comment

by:mel200
ID: 40455502
Nope, that doesn't do it. I'm not sure where to put the end div.
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 500 total points
ID: 40455973
Well putting at the end will still let it inherit and I have no clue what the scope of the element is supposed to be the browser has been assuming everything to the end of the page.

but it looks to me like the problem is one of the typical bootstrap messes.  When I inspect that menu I see an element that has multiple classes that conflict, and there are overrides all over the place. Plus it may also be getting scripted, and the @media declarations further complicate it.  I am not surprised that the browser does not seem to get it right because I don't have a clue what the right values are for the menu elements.

You would probably get it working faster if you get rid of the Bootstrap declarations on it and just style straight up using the id as the declaration. There might still be some inheritance issues but those should be manageable.  However if it is being scripted all bets are off because that will override all efforts.

Cd&
0
 

Author Closing Comment

by:mel200
ID: 40456408
Ok... this works correctly: mkmeals.com/responsive/side-nav-basic.html

So I'm going to start from scratch with that again, testing as I go. until it breaks. Maybe that will tell me what's going wrong. Thanks for your help.
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question