Last active
January 16, 2017 08:10
-
-
Save Mons1eurEnzo/f5c4eeaf3427d82a8df9e7962176a990 to your computer and use it in GitHub Desktop.
Html, css, JS - Плавающее меняющееся меню(headhesive)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Подключить скрипт */headhesive.min.js*/ | |
<div class="menu"> | |
<div class="mid"> | |
<img src="images/photo.jpg" alt="logo" class="logotype"> | |
123 | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var options = { | |
offset: 500 | |
} | |
var header = new Headhesive('.header', options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.mid{ | |
width: 800px; | |
margin: 0 auto; | |
text-align: justify; | |
} | |
.menu{ | |
background: #FB8; | |
opacity: 0; | |
} | |
.logotype{ | |
width: 48px; | |
height: auto; | |
margin-right: 10px; | |
vertical-align: middle; | |
} | |
.headhesive{ | |
background: #FB8; | |
position: fixed; | |
width: 100%; | |
transition: 0.5s; | |
padding: 20px 0; | |
opacity: 1; | |
} | |
.headhesive--stick{ | |
padding: 10px; | |
background: rgba(0,0,0,0.77); | |
color: #fff; | |
} | |
.headhesive--stick .logotype{ | |
width: 24px; | |
height: auto; | |
transition: 0.5s; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment