Change or rewrite add to cart button functionality “

After clicking add to cart button by a user than i want to show checkout page in a popup instead of redirecting to cart, checkout pages.

My purpose is to show checkout page in a popup after clicking add to cart button