Skip to content

Instantly share code, notes, and snippets.

@taea
Last active December 10, 2015 04:58
Show Gist options
  • Select an option

  • Save taea/4385026 to your computer and use it in GitHub Desktop.

Select an option

Save taea/4385026 to your computer and use it in GitHub Desktop.
overlay.js
#overlay-content-wrapper
#overlay-layer
#overlay-content
%section.contens
$(function(){
  var trigger = "#overlay-trigger"
  var content = "#overlay-content-wrapper"
  var layer = "#overlay-layer"
  var cancel = "#overlay-cancel-button"
$(trigger).click(function () {
    $(content).fadeIn("slow");
  });
$(cancel).click(function () {
$(content).fadeOut("slow");
return false;
});
$(layer).click(function () {
$(content).fadeOut("slow");
return false;
});
});
#overlay-content-wrapper
display: none
position: absolute
z-index: 2
#overlay-layer
background: rgba(0, 0, 0, .3)
width: 100%
height: 100%
top: 0
left: 0
position: fixed
display: block
#overlay-content
background: rgba(255, 255, 255, .5)
width: $overlay-width
padding: 5px
+box-shadow(rgba(0, 0, 0, .5) 0 0 10px)
+border-radius(6px)
position: fixed
top: 100px
left: 50%
z-index: 3
margin-left: -1 * ($overlay-width) / 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment