A beary cute toggle.
A Pen by Anastasia Goodwin on CodePen.
A beary cute toggle.
A Pen by Anastasia Goodwin on CodePen.
| function listToMatrix(list, elementsPerSubArray) { | |
| var matrix = [], i, k; | |
| for (i = 0, k = -1; i < list.length; i++) { | |
| if (i % elementsPerSubArray === 0) { | |
| k++; | |
| matrix[k] = []; | |
| } | |
| matrix[k].push(list[i]); | |
| } | |
| return matrix; |
| # Advanced JS | Summary | |
| The purpose of this sprint is to learn: | |
| - Types, values and properties | |
| - Function expressions vs function declarations | |
| - Hoisting | |
| - Closures | |
| - Strict mode | |
| - Context |
Just migrated it from Codepen.io to markdown. Credit goes to David Conner.
| Working with DOM | Working with JS | Working With Functions |
|---|---|---|
| Accessing Dom Elements | Add/Remove Array Item | Add Default Arguments to Function |
| Grab Children/Parent Node(s) | Add/Remove Object Properties | Throttle/Debounce Functions |
| Create DOM Elements | Conditionals |
| <?php | |
| function optimize_heartbeat_settings( $settings ) { | |
| // Experiment with these two settings below | |
| $settings['autostart'] = false; // default is true | |
| $settings['interval'] = 60; // 15 sec by default | |
| return $settings; | |
| } | |
| add_filter( 'heartbeat_settings', 'optimize_heartbeat_settings' ); |
| <!-- Call css apart --> | |
| <style type="text/css"> | |
| body { | |
| color: #333333; | |
| font-family: 'Helvetica', arial; | |
| height:1500px; | |
| } | |
| .wrap { | |
| padding: 40px; | |
| text-align: center; |
| <script type="text/javascript"> | |
| function initialized() { | |
| var map; | |
| var bounds = new google.maps.LatLngBounds(); | |
| var mapOptions = { | |
| mapTypeId: 'roadmap' | |
| }; | |
| // Display a map on the page with div id show_map_div |
| <?php | |
| /* | |
| * Creating a function to create our CPT LENEROS | |
| * | |
| */ | |
| function create_posttype_leneros() { | |
| register_post_type( 'leneros', | |
| // CPT Options |