Skip to content

Instantly share code, notes, and snippets.

@nelsonJM
Created November 25, 2013 19:29
Show Gist options
  • Save nelsonJM/7647255 to your computer and use it in GitHub Desktop.
Save nelsonJM/7647255 to your computer and use it in GitHub Desktop.
JS: Notice Bar
var closeNotice = document.querySelector(".close-notice");
var notice = document.getElementById("notice");
EventUtil.addHandler(closeNotice, "click", function(event){
event = EventUtil.getEvent(event);
EventUtil.preventDefault(event);
alert("hello there");
notice.setAttribute("class", "hide");
});
#notice {
font-size: 22px;
text-align: center;
background: #698FEE;
color: #fff;
padding: 20px;
}
.close-notice {
font-size: 12px;
font-weight: bold;
color: #fff;
display: block;
padding: 7px;
background: #3061DF;
position: absolute;
right: 401px;
top: 15px;
border-radius: 85px;
width: 18px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment