Pen Settings

HTML

CSS

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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

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.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!DOCTYPE html>
<html>
  <head>
    
  </head>
  <body>
    <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
    <section id="services"></section>
  </body>
</html>
              
            
!

CSS

              
                
              
            
!

JS

              
                $(function(){
  let items;

  function createRows(rowIndex) {

    //Creates Rows inside container
    var row = document.createElement("div");
    row.setAttribute('id', 'row' + rowIndex);
    row.classList.add('row', 'mb-5');

    //Appends Row to Container
    var getSection = document.getElementById('container');
    getSection.appendChild(row);

    for (var j = 0; j < 3; j++) {
      createColumns(rowIndex, j);
      for (var k = 0; k < 3; k++) {
        createIcons(rowIndex, j, k);
      }; //End of k Loop

    }; // End of j loop


    //createIcons(i);

  }; //End of createRows function

  
  function createColumns(rowIndex, columnIndex) {
    var columns = document.createElement("div");
    columns.setAttribute('id', 'columns' + columnIndex);
    columns.classList.add('col-md-4', 'slide-in-demo'); 
    columns.style.left = '0%';

    //appends columns inside the rows
    var getRow = document.getElementById('row' + rowIndex);
    getRow.appendChild(columns);
    console.log(getRow);

  }; //End of createColumns function

  function createIcons(rowIndex, columnIndex, iconIndex) {
    //Pulls the images from the list
    var icon = document.createElement("img");
    icon.setAttribute('id', 'icon' + iconIndex);
    icon.style.width = '15%';
    icon.src = items[rowIndex].IconImage1.Url;

    //Pulls header from the list
    var header = document.createElement("h5");
    header.setAttribute('id', 'header' + iconIndex);
    header.innerHTML = items[rowIndex].Title;
    header.classList.add("font-weight-bold", "my-4");

    //Creates buttons
    var button = document.createElement("button");
    button.classList.add('btn', 'btn-primary', 'btn-sm', 'waves-effect', 'waves-light');
    button.setAttribute('id', 'button' + rowIndex);
    button.setAttribute('href', '#');

    //Appends elements columns
    var getColumns = document.getElementById('columns' + columnIndex);
    getColumns.appendChild(icon);
    getColumns.appendChild(header);
    getColumns.appendChild(button);

    var txt = document.createTextNode('LEARN MORE');

    var getButton = document.getElementById('button' + rowIndex);
    getButton.appendChild(txt);

    /*var para = document.createElement("p");
                                        para.classList.add('grey-text', 'mb-md-0', 'mb-5');*/


  }; //End of createIcons function

})
$.ajax({
  url: "https://bc-net/Sandbox/juandev/_api/web/lists/GetByTitle('Qlinks')/items",
  method: "GET",
  headers: {
    "Accept": "application/json; odata=verbose"
  },
  success: function(data) {

    items = data.d.results;


    if (items.length > 0) {
      //Creates Container
      var container = document.createElement("div");
      container.setAttribute('id', 'container');
      container.classList.add('container', 'text-center', 'my-5');

      //Gets Section in DOM
      var getSection = document.getElementById('services');
      getSection.appendChild(container);

      for (var i = 0; i < 3; i++) {

        createRows(i);

      }; //End of i Loop

    }; //End of if statement

  },
  error: function(data) {
    console.error("Error: " + JSON.stringify(data));
  }
}); //End Service Icons
              
            
!
999px

Console