javascript - Page/Div Content fade in and out on click -
i have been working on recruiting website days now. newbie in programming. please need script load employment review content fade out on click of of each employment vacancy div , fade in on clicking "close" on employment review content page. thanks.
you can use jquery achieve this: http://api.jquery.com/fadeout/
$( "#vacancy-div-id" ).click(function() { $( "#id-of-what-you-want-to-fade-out" ).fadeout( "slow", function() { // animation complete. }); });
to fade in can use this: http://api.jquery.com/fadein/
$( "#close-button-id" ).click(function() { $( "#id-of-what-you-want-to-fade-in" ).fadein( "slow", function() { // animation complete }); });
more detailed example - put in html:
<script> $( "#close-button-id" ).click(function() { $( "#id-of-what-you-want-to-fade-in" ).fadein( "slow", function() { // animation complete }); }); </script>
if not know id of want click trigger fadein animation, can right click on element , click inspect, show html of page.
Comments
Post a Comment