Skip to content

Instantly share code, notes, and snippets.

@davinmsu
Last active August 29, 2015 14:24
Show Gist options
  • Select an option

  • Save davinmsu/5577c7a8fcadbb9b291c to your computer and use it in GitHub Desktop.

Select an option

Save davinmsu/5577c7a8fcadbb9b291c to your computer and use it in GitHub Desktop.
<div id="banner">
<div class="wrapper">
<h1>Содержимое баннера</h1>
</div>
</div>
<script>
$(html).addClass('superbannerOpened');
</script>
<style>
html.superbannerOpened body {
overflow: hidden;
}
html.superbannerOpened #banner {
display: block;
}
#banner {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 999999999;
}
#banner > .wrapper {
position: absolute;
margin: 0 auto;
top: 50%;
margin-top: -200px; /*здесь ты должен записать половину высоты внутреннего блока со знаком минус*/
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment