Professional Documents
Culture Documents
elements in and out, and more. // appear once the #menu-button element is
clicked.
$('#menu').show();
});
$('#hide-menu-button').on('click', () => {
$('#menu').hide();
});
$('#show-menu-button').on('click', () => {
$('#menu').show();
});
page.
$('#menu-button').on('click', () =>{
$('#menu').toggle();
});
jquery fadeIn effect method
The jQuery .fadeIn() effect method causes a hidden
element to gradually appear on the page. The method // The '#menu' element will gradually
takes optional parameters. appear
The first optional parameter specifies the duration of the // on the page when the '#menu-button' is
fading effect. The default value is 400 milliseconds.
clicked.
});
The first optional parameter specifies the duration of the // the page when the '#menu-button' is
fading effect. The default value is 400 milliseconds.
clicked.
});
and appearing every time the event listener is triggered. // gradually disappearing and gradually
This method takes optional parameters. appearing
});
jquery slideDown method
The jQuery .slideDown() effect method causes a hidden
element to gradually appear on the page by sliding down // The '#menu' element will gradually
its content. appear on
This method takes an optional parameter that specifies // the page by sliding down its content
the duration of the effect in milliseconds. If not specified, when the
$('#menu-button').on('click', () => {
$('#menu').slideDown();
});
This method takes an optional parameter that specifies // from the page by sliding up its content
the duration of the effect in milliseconds. If not specified,
when
$('#menu').slideUp(500);
});
appearing by sliding down and gradually disappearing by // gradually sliding down and gradually
sliding up every time the event listener is triggered. sliding up
$('#menu').slideToggle();
});