Reputation: 2811
If you goto http://jsfiddle.net/BT4Bk/ you can see that the dark bar is visible.
This is padding for the #ajax div that will wrap the content inside. How do I hide the padding so its not displayed until it slides into view with the content?
Upvotes: 1
Views: 1395
Reputation: 9508
You need to remove the
#ajax{
padding: 0px 0; // padding value from here
}
Same to added $(".viewproject").click(function ()
$('#ajax').css("padding-top",40);
So all time padding is not taken when you request the item required padding set using jQuery. Here @Kiran done is absolutely correct.
Upvotes: 0
Reputation: 13820
Hide your #dark
until the link is clicked. I added #dark { display: none; }
to the CSS and $('#dark').show()
to your animate function:
This jsFiddle will prevent the black padding from shown before the animation runs.
Upvotes: 2
Reputation: 20313
Once you click on the Item 1 padding-top is updated.Look into the following updated fiddle:
Upvotes: 1