Travel outside US while my Petition is in progress

I am planning to travel outside US from April mid until June mid once lottery process is complete. I wanted to know if I can still submit the petition during this time and travel or I can only travel after my petition is approved.