Objective:
Implementation of a responsive navigation with bootstrap Navbar component
Understand how bootstrap Navbar component works (excluding collepse.js)
Know what to do when you add a defined class name
Refit according to one's own needs
Compare your own implementation to find the difference.
1. Implementatio
Navbar source code analysis in the Bootstrap navigation bar,
1. This document analyzes the bootstrap navigation bar and Its responsive implementation methods to improve its css level.
First, paste a bootstrap navigation bar template.
Http://v3.bootcss.com/examples/navbar-fix
Bootstrap source code analysis: foRm, navbar 1, Form (foRm)
Source code file:_ Form. scssMixins/_ form. scss
1. hierarchical classification: form-group-> form-control/input-group/form-static-control-> tags2. Form-group/form-control/input-group/form-static-control containers can be displayed in two ways: block and inline-block. Table-cell is used to implement the input-group level.
.input-group {
elements11, Navbar-text, NAVBAR-BTN: On the default based on the compatibility of the corresponding settings12, NavBar provides the default, inverse two kinds of topics, under each theme to their respective parts have done the corresponding style compatible processing13, the navigation bar itself, the style is not much, itself only provides
displayed, greater than this value is hidden (and, toggle display is right floating, and as a relative positioning element):
. Navbar-toggle{position:relative;float: Right;Margin-right:$navbar-padding-horizontal;padding:9px 10px;@include navbar-vertical-align (34px); B
the bootstrap elements have two, different styles, one is the label page, the other is a button group, so-called breadcrumb navigation bar is not a good solution, Because the drop-down menu in the bootstrap must be presented in the form of buttons, written text, in the IE8 is also thankless, of course, you can choose to throw away bootstrap, the great god of CSS
understanding is not thorough.A full Page selection button group basic style is as follows,
Will change as the size of the browser changes, of course, when compressed to the extreme, will not be like bootstrap with the navigation bar navbar like that, quietly lying in a button,
This group of selection buttons can be no doubt compatible with IE8, except that the button group without the Pull-down menu
, the margin-right properties of the body overflow, modal, and. Overflow are adjusted before and after modal loading to override the styles in Bootstrap.cssThe functions are as follows:Resolve Modal Popup page left and right move problem Modal.prototype.adjustBody_beforeShow = function () { var body_scrollheight = $ (' body ') [ 0].scrollheight; var docheight = document.documentElement.clientHeight; if (Body_scrollheight > Docheight) { $ (' body '). CSS ({ ' overflow ': ' H
: Modal.prototype.show = function (_relatedtarget) {this.adjustbody_beforeshow ();... other code}modal.prototype.hide = function (e) {this.adjustbody_aftershow (); ... other code} But that's how I use it: (function () {varmodal={};//resolves Modal page-to-move issue when Popup modal.adjustbody_beforeshow= function () {varbody_scrollheight=$ (' body ') [0].scrollheight;vardocheight= Document.documentelement.clientheight;if (body_scrollheight>docheight) {$ (' body '). css ({ ' overflow ' : ' hidde
assistance outside of the code to help guide2. The company has to use the market to buy a set of UI is not less than 99 yuan, light is tens of thousands. Even if you buy the UI, it takes time and effort to let the staff develop the basic module to build a sound framework, less than 99 dollars a step, save the cost of your own calculation3. master great God to do reverse telecommuting with their own set of UI set up will not be a short time, the fastest and most fast one day. The company added a
four times repeatedly, I think the master should not write so, I am still a rookie, But I don't want to use silly methods.Then I consulted others, as if I could do it in another way.$ (document). Ready (function() { $ ('. Accordion-group '). Find (' span '). Click (function () {$ (this). Toggleclass (' glyphicon-plus-sign glyphicon-minus ')}) ;But only the point icon, not the button, because the click event is only bound in span, so only the span, not to dom,button that level, so there is a pr
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.