Skip to content

Instantly share code, notes, and snippets.

@Mons1eurEnzo
Last active January 16, 2017 08:10
Show Gist options
  • Save Mons1eurEnzo/f5c4eeaf3427d82a8df9e7962176a990 to your computer and use it in GitHub Desktop.
Save Mons1eurEnzo/f5c4eeaf3427d82a8df9e7962176a990 to your computer and use it in GitHub Desktop.
Html, css, JS - Плавающее меняющееся меню(headhesive)
/*Подключить скрипт */headhesive.min.js*/
<div class="menu">
<div class="mid">
<img src="images/photo.jpg" alt="logo" class="logotype">
123
</div>
</div>
var options = {
offset: 500
}
var header = new Headhesive('.header', options);
.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