ナビゲーションバーに問題があります。私の目的は、通常の水平ナビゲーションバーをデスクトップ上に置いてから、折りたたみ可能なナビバーをモバイル上に置くことです。その1つは間違っています。私はリンクを隠してトグルボタンがクリックされたら、それらを表示することはできません。ナビゲーション応答の問題
Codepen:http://codepen.io/anon/pen/RRGvYV
HTML:
CSS(SASS):
@media (min-width : 768px)
.navigation-bar
list-style-type: none
ul
float: left
li
float: left
&:before, &:after
display: table
content: ""
.nav-right
float: right !important
.navigation-top
width: auto !important
padding: 5px 20px
float: left
line-height: 40px
.nav-toggle
display: none !important
.open
display: block!important
.collapase
display: none
.navigation-top
width: 100%
padding: 5px 20px
float: left
line-height: 40px
border-bottom: solid 1px #E5E5E5
.nav-name
font-weight: bold
float: left
.navigation-group
min-height: 50px
background-color: #fff
&:before, &:after
display: table
content: ""
.navigation-bar
li
position: relative
display: block
line-height: 40px
a
display: block
color: #000
text-align: center
padding: 5px 20px
font-weight: bold
text-decoration: none
&:before, &:after
display: table
content: ""
.navigation-name
float: left
padding: 10px 20px
font-size: 18px
text-decoration: none
font-weight: bold
color: red
.nav-toggle
display: block
font-size: 34px
font-weight: bold
position: relative
float: right
padding: 6px 12px
margin-top: 0px
margin-right: 15px
margin-bottom: 0px
background-color: transparent
background-image: none
border: 1px solid transparent
border-radius: 4px
cursor: pointer
outline: none
のjQuery:
$("#nav-toggle").click(function(){
$(".navigation-bar").toggle();
});
イムは、ブートストラップのようなシステムを探しています。
あなたはjQueryのを含めるのを忘れていますか?それはcodepenに存在しません。それ以外にも、一貫性と概要を得るには、CSSの ';'と角括弧を使うことを検討するべきです。そしてなぜBootstrap ..を使わないのですか? –