As one element slides in I need the other element to slide out. At the moment I have set it to fadeOut. This is the code I have so far:
$('#contact').click(function () {
$('#contact-info').animate({
width: 'toggle'
});
$('#work-menu').fadeOut('100');
});
$('#menu').click(function () {
$('#work-menu').animate({
width: 'toggle'
});
$('#contact-info').fadeOut('100');
});
DEMO
How can I change this code to make the opposite elements slide back as the other one slides into view?
use 'hide'
$('#contact').click(function () {
$('#contact-info').animate({
width: 'toggle'
});
$('#work-menu').animate({
width: 'hide'
});
});
$('#menu').click(function () {
$('#work-menu').animate({
width: 'toggle'
});
$('#contact-info').animate({
width: 'hide'
});
});
DEMO
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With