I'm trying to have a page slide down and then another page slide up. But, for some reason, I can't figure it out.
http://maximsiebert.com/unamed/Untitled-1.html
If you look on here, you can see that if I click the About
navigation link, the page slides up, if I click again it slides back down. Same for the Contact page
.
The problem is, while, I have the About page
up and I click on the contact link, I need the About page
to slide down, while the Contact page
slides up, vice versa. But I can't seem to get it to work.
Here's my code: ps: in "divPages" I have #aboutpage and #contactpage
$(document).ready(function() {
$('.about').click(function() {
if (!$('#aboutpage').is(":visible")) {
$('#portfolio').slideUp(1000);
$('#aboutpage').slideDown(1000);
}else{
$('#portfolio').slideDown(1000);
$('#aboutpage').slideUp(1000);
}
});
});
$(document).ready(function() {
$('.contact').click(function() {
if (!$('#contactpage').is(":visible")) {
$('#portfolio').slideUp(1000);
$('#contactpage').slideDown(1000);
}else{
$('#portfolio').slideDown(1000);
$('#contactpage').slideUp(1000);
}
});
});
$(document).ready(function() {
$('.welcome').click(function() {
if ($(divPages).is(":visible")) {
$('#portfolio').slideDown(1000);
$(divPages).slideUp(1000);
}else{
$('html, body').animate({scrollTop:0}, 'slow');
}
});
});