Solved

Nav collapse doesn't work correctly

Posted on 2014-11-18
9
81 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:mel200
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
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
Comment Utility
Will adding a </div> at the end of the document close that correctly?
0
 

Author Comment

by:mel200
Comment Utility
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
Comment Utility
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
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
jQuery or CSS 9 37
HTML page and JavaScript 2 49
How can I expand text with explaination 5 18
Windows 10 bookmarks html file 6 26
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now