What you need to do is fire a function when the page is loaded, that reads out the fragment from the URL ("myModal" in this case), finds a link that has an attribute data-reveal-id="myModal"
(which is how Foundation registeres which link opens which modal) and simulate a click on that.
document.addEventListener("DOMContentLoaded", function(event) {
var id = window.location.hash.substring(1); // remove the #
var element = document.querySelector('[data-reveal-id="' + id + '"]');
element.click();
});
The only browser this might not work in is safari because it doesn't support the click()
method, but there's a workaround for that