$(document).ready(function() {

  if(window.location.href.indexOf('#myModal') != -1) {
    $('#myModal').modal('show');
  }

});

$(document).ready(function() {

  if(window.location.href.indexOf('#thankyou') != -1) {
    $('#thankyou').modal('show');
  }

});

Update modal.js