Reputation: 854
For some reason every time I try to implement jquery into my code it doesn't work. I know the basics of writing jquery and look up what I'm trying to do but apparently can never get it right even if my code is exactly similar to an online example.
All I am trying to do here is make #time slide down from off of the screen to it's normal position on page load. I tried .slideDown and .animate (top)
<div id="time">
<h1>Good Evening</h1>
</div>
#time {
width: 100%;
height: 50px;
background-color: #000;
}
#time h1 {
color: #D4AF37;
font-size: 38px;
font-family: 'Arimo', sans-serif;
font-weight: 700;
text-align: center;
letter-spacing: 5px;
font-style: italic;
margin-top: 0px;
line-height: 50px;
}
$(function() {
$('#time').animate({
top: '50px'), 200
});
});
https://jsfiddle.net/d025dsqb/
Upvotes: 0
Views: 32
Reputation: 336
please see working solution here:
https://jsfiddle.net/aq9hszmv/2/
$(function() {
$('#time').animate({
top: '0px'}, 2000
);
});
#time {
width: 100%;
height: 50px;
background-color: #000;
top: -50px;
position: absolute;
}
Upvotes: 1