ang*_*ela 6 jquery click jquery-animate
当一个元素滑入时我需要另一个元素滑出.目前我已将其设置为fadeOut.这是我到目前为止的代码:
$('#contact').click(function () {
$('#contact-info').animate({
width: 'toggle'
});
$('#work-menu').fadeOut('100');
});
$('#menu').click(function () {
$('#work-menu').animate({
width: 'toggle'
});
$('#contact-info').fadeOut('100');
});
Run Code Online (Sandbox Code Playgroud)
如何更改此代码以使相对的元素向下滑动,而另一个元素滑入视图?
使用'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'
});
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
146 次 |
| 最近记录: |