I want to show a message at the bottom-right of the page. I searched Google and I got the right code for it but I have some confusion...some please help me to understand.
Here is the code:
<a href="#" class="notify">Show Notification</a>
<div id="notify">You are sexy today!</div>
#notify {
position: fixed;
right: 10px;
bottom: -200px;
width: 150px;
line-height: 80px;
text-align: center;
background-color: #ccc;
}
$('.notify').click(function(e) {
e.preventDefault();
$('#notify').animate({ bottom: "10px" }, 250);
});
$('#notify').click(function() {
$(this).animate({ bottom: "-200px" }, 250);
});
- Why is
right10px in CSS? - Why has
line-heightbeen set in CSS? - What does
animatedo here? If it will increase 10px then how long it will increase? - What is the meaning of this line:
$(this).animate({ bottom: "-200px" }, 250);?
Please help me to understand those above point. Thanks.