Solved

Nav collapse doesn't work correctly

Posted on 2014-11-18
9
87 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 

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

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

705 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