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.

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

 <!-- 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>
          <div class="oj-flex-item">
            <input id="address2" data-bind="ojComponent:{
                       component: 'ojInputText', 
                       value: otheraddress
                    }">
          </div>  
          <div class="oj-flex-item">
              <label for="othercity">City</label>
          </div>
          <div class="oj-flex-item">  
              <input id="othercity" data-bind="ojComponent:{
                       component: 'ojInputText', 
                       value: othercity
                       }">
         </div>
  </div>
</div>
            
          
!
            
              @import url('//cdn.rawgit.com/oracle/oraclejet/2a420014546d371d076ec741ef171f0a3c71f28d/dist/css/alta/oj-alta-min.css');
            
          
!
            
              require(['knockout',
  'ojs/ojcore',
  'jquery',
  'ojs/ojknockout',
  'ojs/ojinputtext',
  'ojs/ojcheckboxset'
], 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();
        
        $(element).toggle(ko.unwrap(value));
      },
       update: function(element, valueAccessor) {
        console.log("Calling update:");

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

requirejs.config({
  // Path mappings for the logical module names
  paths: {
    'knockout': '//cdnjs.cloudflare.com/ajax/libs/knockout/3.4.0/knockout-min',
    'jquery': '//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min',
    "jqueryui": "//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui",
    "jqueryui-amd": "//cdn.rawgit.com/jquery/jquery-ui/1-11-stable/ui",

    "promise": "//cdn.rawgit.com/components/es6-promise/c95149ffaa2e8162601c57d4282362eac84f929b/promise.min",
    "hammerjs": "//cdnjs.cloudflare.com/ajax/libs/hammer.js/2.0.4/hammer.min",
    "ojdnd": "//cdn.rawgit.com/oracle/oraclejet/2a420014546d371d076ec741ef171f0a3c71f28d/dist/js/libs/dnd-polyfill/dnd-polyfill-1.0.0.min",
    "ojs": "//cdn.rawgit.com/oracle/oraclejet/2a420014546d371d076ec741ef171f0a3c71f28d/dist/js/libs/oj/min",
    "ojL10n": "//cdn.rawgit.com/oracle/oraclejet/2a420014546d371d076ec741ef171f0a3c71f28d/dist/js/libs/oj/ojL10n",
    "ojtranslations": "//cdn.rawgit.com/oracle/oraclejet/2a420014546d371d076ec741ef171f0a3c71f28d/dist/js/libs/oj/resources",
    "text": "//cdnjs.cloudflare.com/ajax/libs/require-text/2.0.12/text.min",
    "signals": "//cdnjs.cloudflare.com/ajax/libs/js-signals/1.0.0/js-signals.min"

  },
  // 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'
      }
    }
  }
});
            
          
!
999px
Loading ..................

Console