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. 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.

+ 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

              
                <div class="container">

  <section class="brand-sponsor">
    <div class="container">
        <h1 class="sponsor-title">This is a dummy text</h1>
    </div>
  </section>
  <section class="section-faq">
    <div class="container">
      <div class="row">
        <div class="col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3">
          <div id="faqAccordion" class="faq-accordion">
            <script id="faqAccord" type="text/x-handlebars-template">
              {{#each EbayFaq}}
              <div class="panel">
                <div class="panel-heading">
                  <h4 class="panel-title question collapsed" data-toggle="collapse" data-target="#answer--{{@index}}">{{question}}</h4>
                </div>
                <div class="panel-body panel-collapse collapse" id="answer--{{@index}}">
                  <div class="answer">
                    {{answer}}
                  </div>
                </div>
              </div>
              {{/each}}
            </script>
          </div>
        </div>
      </div>
    </div>

  </section>
</div>
              
            
!

CSS

              
                .question 
  cursor pointer
  color red
              
            
!

JS

              
                var EbayFaq = [{
  'question': 'What is this dummy text?',
  'answer': 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum..'
}, {
  'question': 'What type of information?',
  'answer': 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliq'
}, {
  'question': 'What type of information?',
  'answer': ']Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
}, {
  'question': 'Is this really a big question, so that you can test your screen width',
  'answer': 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
}, {
  'question': 'Can Refresh browser so that this text doesn\'t make any sense?',
  'answer': '			Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
}]

$(document).ready(function() {
  // Using Handlebars
  var target = $('#faqAccord').html(); // to get innerHTML of target script
  var template = Handlebars.compile(target); // call handlebars compiler on target
  $('#faqAccordion').append(template({EbayFaq})); // append data  to template

  $('.question').first().removeClass('collapsed'); // to keep first one open and follow bootstrap classes standard
  $('.panel-body').first().addClass('in'); // to keep first one open

});
              
            
!
999px

Console