how to create stackoverflow notification which is just like this
isit created in javascript? I want to know how to create in.
how to create stackoverflow notification which is just like this
isit created in javascript? I want to know how to create in.
You could do it like in this fiddle: http://jsfiddle.net/X7RNK/
html:
<div id=container>
<img id=pic src='https://fbcdn-profile-a.akamaihd.net/hprofile-ak- prn2/s48x48/592272_191755377529982_1348162633_q.jpg' id=pic>
</div>
css:
#container{
border: 1px SOLID #FF000;
display: box;
width: 48px;
height: 48px;
overflow: hidden;
}
#pic{
position: relative;
top: 0px;
}
jquery:
$(document).ready(function(){
setInterval(slidedown,2000);
});
function slidedown(){
$("#pic").animate({
top: '48px'
},500)
setTimeout(function(){
$("#pic").css({
top: '0px'
});
},1000);
}
You need jquery.
EDIT: http://jsfiddle.net/X7RNK/1/ If you whant the fade effect aswell EDIT: 2 implemented numeric value instead of image in this fiddle: http://jsfiddle.net/X7RNK/5/ (Same princip as above)
You don't need jQuery, you can do it all with CSS3, if you want to, of course.
Please see the example here: http://spiritofchristmas.org.uk
HTML:
<span id="snow1" class="snow smallSnowflake"></span>
CSS:
.smallSnowflake {
background: url('../assets/small_snowflake.png') no-repeat center;
}
.snow {
position: absolute;
-webkit-animation-name: snowAnimation;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
-moz-animation-name: snowAnimation;
-moz-animation-iteration-count: infinite;
-moz-animation-timing-function: linear;
animation-name: snowAnimation;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
#snow1 {
left: 50%;
width: 2000px;
height: 2000px;
margin-top: -1000px;
margin-left: -1000px;
-webkit-animation-duration: 10s;
-moz-animation-duration: 10s;
animation-duration: 10s;
}
@-webkit-keyframes snowAnimation {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
top: 0;
opacity: 0;
}
50% {
-webkit-transform: rotate(180deg);
transform: rotate(180deg);
opacity: 1;
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
top: 100%;
opacity: 0;
}
}
@keyframes snowAnimation {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
top: 0;
opacity: 0;
}
50% {
-webkit-transform: rotate(180deg);
transform: rotate(180deg);
opacity: 1;
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
top: 100%;
opacity: 0;
}
}