cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

              <div class="head">
  <h1>State Level Obesity Rates</h1>
<div id="tiles"></div>
              body {
  @import url('https://fonts.googleapis.com/css?family=Open+Sans');
  font-family: 'Open Sans', sans-serif;

h1 {
  font-size: 3.0vw;

.head {

.tile {
  padding-top: 20px;

#tiles img {
  width: 100%;

.tile-title {
  font-size: 2.0vw;

.cover {
  background: white;
  position: absolute;
/*   border: 1px black solid; */
              // get states
var states = [
'New Hampshire',
'New Jersey',
'New Mexico',
'New York',
'North Carolina',
'North Dakota',
'Rhode Island',
'South Carolina',
'South Dakota',
'West Virginia',
//sort array
sortedStates = states.sort();

function loadImages(list) {
    // loop through states and generate image for each one
    for (i = 0; i < sortedStates.length; i++) { 
      //parse the array of states and assign the current state
      var state = sortedStates[i];
      //get the url of our viz with the state filter added
      var url = "https://public.tableau.com/views/Regional_207/map?:showVizHome=no&:embed=yes&:toolbar=no&:format=png&State="+state;

       //add some HTML to load the image into our "tiles" container
      $("#tiles").append("<div class='tile' style='opacity:0;' id='tile-"+i+"'><span class='tile-title'>"+state+"</span><img src='"+url+"'><div class='cover'></div></div>");

  //do something once the images are loaded
    //when the loading is complete do this
    .done( function() {

      //set the "opactity" to 1 which makes the tile visible
      $(".tile").each(function() {

//run this baby
Loading ..................