Skip to content

Instantly share code, notes, and snippets.

@kilinkis
Forked from matthewcrist/readme.md
Created December 9, 2017 17:23
Show Gist options
  • Save kilinkis/85ba4861768e62e08e61c5021601048a to your computer and use it in GitHub Desktop.
Save kilinkis/85ba4861768e62e08e61c5021601048a to your computer and use it in GitHub Desktop.
Auto height iFrames on Boston.gov

iFrames that resize based on the content of the page is possible for Boston.gov. In order to get them working, you will need to include a snippet of JS on the page that will be iframed. The code for this is:

<script>
    window.iFrameResizer = {
    targetOrigin: 'https://www.boston.gov'
  }
</script>
<script src="https://www.boston.gov/sites/all/themes/custom/boston_public/dist/js/resizer.client.js"></script>

Drop this code into the <head> of your HTML document. In Drupal, select Auto when adding the iFrame component.

If you have any issues, send an email to feedback@boston.gov. Make sure to include the URL of the page you're adding the component to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment