handle clicks and slides