I am currently working on this code snippet:
$(function(){
$("#modal-launcher, #modal-background, #modal-close").click(function () {
$("#modal-content,#modal-background").toggle("slow");
return false;
});
});
and here is the corresponding HTML:
<button id='modal-launcher'>
Launch Modal Window
</button>
<div id='modal-background'></div>
<div id='modal-content'>
<button id='modal-close'>Close Modal Window</button>
</div>
You can view a live example here.
Currently, the modal pops up in the center upon clicking the button. However, I would like to implement an animation where the modal appears to originate from the "Launch Modal Window" button and then transitions to the center. Is this achievable through coding? I have been searching online for examples but haven't found one yet. Any assistance or guidance on achieving this would be greatly appreciated.
Is there anyone who can help me with this? Thanks in advance!