How can I edit css with a click only for a few seconds?

How can I edit css with a click only for a few seconds?

I need to change an image size by a click for a few seconds and then it should return to the original size, using functions and selectors. I changed the size but I don't know how to return to the original size.
$(document).ready(function () {
   if $("myId").click(function () {
        if $(this).css({ width: "500", height: "500" }, 1000)
    });
});