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.

+ add another resource


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


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.


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.


                <h4> Click on the checkbox below!! </h4>
<div class="oj-flex">  
    <input type='checkbox' data-bind='checked: displayAdvancedOptions'  />
       Use different Address

 <!-- other address input fields --> 
 <div class="oj-flex" data-bind='fadeVisible: displayAdvancedOptions'> 
    <div class="oj-flex-item">     
       <div class="oj-flex oj-sm-flex-direction-column">
          <div class="oj-flex-item">
             <label for="address2">Address</label>              
          <div class="oj-flex-item">
            <input id="address2" data-bind="ojComponent:{
                       component: 'ojInputText', 
                       value: otheraddress
          <div class="oj-flex-item">
              <label for="othercity">City</label>
          <div class="oj-flex-item">  
              <input id="othercity" data-bind="ojComponent:{
                       component: 'ojInputText', 
                       value: othercity


                @import url('//');


], function(ko, oj, $) {
  'use strict';

  var ViewModel = function() {
     var self = this;
     self.otheraddress = ko.observable();
     self.othercity = ko.observable();
     // used for transitions
     self.displayAdvancedOptions = ko.observable(false);
     // Here's a custom Knockout binding that makes elements shown/hidden
      ko.bindingHandlers.fadeVisible = {
       init: function(element, valueAccessor) {
        console.log("calling custom binding!!");
        var value = valueAccessor();
       update: function(element, valueAccessor) {
        console.log("Calling update:");

        var value = valueAccessor();
        ko.unwrap(value) ? $(element).fadeIn() : $(element).fadeOut();
  ko.applyBindings(new ViewModel());

  // Path mappings for the logical module names
  paths: {
    'knockout': '//',
    'jquery': '//',
    "jqueryui": "//",
    "jqueryui-amd": "//",

    "promise": "//",
    "hammerjs": "//",
    "ojdnd": "//",
    "ojs": "//",
    "ojL10n": "//",
    "ojtranslations": "//",
    "text": "//",
    "signals": "//"

  // Shim configurations for modules that do not expose AMD
  shim: {
    'jqueryui-amd': {
      exports: "$",
      deps: ['jquery']
    'jquery': {
      exports: ['jQuery', '$']
  config: {
    ojL10n: {
      merge: {
        //'ojtranslations/nls/ojtranslations': 'resources/nls/menu'
        // The following addes en-US to the r.js bundle
        //'ojtranslations/nls/ojtranslations': '../../oj/resources/nls/en-US/localeElements'