1
嗨我寫了一個簡單的淡入淡出菜單的兩個jquery函數,它基本上分裂了一半的屏幕,並允許你去兩個網站之一。在這些功能工作之前,如何設置延遲時間2秒?這裏是我的代碼:功能上的jquery延遲
$('#retailNav').bind({
mouseenter: function() {
$('#retailFull:not(:animated)').fadeIn('slow');
$('#residentialNav:not(:animated)').fadeOut('slow');
},
mouseleave: function() {
$('#retailFull').fadeOut('slow');
$('#residentialNav').fadeIn('slow');
}
});
$('#residentialNav').bind({
mouseenter: function() {
$('#retailHalf:not(:animated)').fadeOut('slow');
$('#retailNav:not(:animated)').fadeOut('slow');
$('#residentialFull p').html('Click to enter residential');
},
mouseleave: function() {
$('#retailHalf').fadeIn('slow');
$('#retailNav').fadeIn('slow');
$('#residentialFull p').html('Residential');
}
});
難道我莫名其妙地在另一個函數包裝嗎?