JSFiddle

  • DataTables Column Alignment

    jQuery 2.2.4, HTML, CSS, JavaScript

     $('.datatable').DataTable({
       paging: false,
       searching: false,
       info: false,
       //scrollCollapse: true,
       //"scrollY": 400,
       "scrollX": true,
       //autoWidth: false
     });
     
     
     
    // https://stackoverflow.com/questions ...
  • jQuery Upsert

    jQuery 2.2.4, HTML, CSS, JavaScript

    $.fn.upsert = function(selector, htmlString) {
    	// upsert - find or create new element
      // find based on css selector   	https://api.jquery.com ...
  • State Driven Buttons

    No-Library (pure JS), HTML, CSS, JavaScript

    // on layout.js
    $savebuttons = $('.non-idempotent-action')
    
    $savebuttons.click(function() {
    		this.enabled = false;
    });
  • Table CSS Settings

    jQuery 2.2.4, HTML, CSS, JavaScript

    <h4>Width Not Set</h4>
    
    <table id="example1" >
      <thead>
        <tr>
          <th>Name</th>
          <th>Type</th>
          <th>Start</th>
          <th>Stop</th>
          <th>View</th>
          <th>Edit</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>Regular Size Name</td>
          <td>Order</td>
          <td>01/01/2017</td>
          <td>02/02/2017</td>
          <td><a href="#View">View ...</a></td></tr></tbody></table>
  • Auto resizing the SELECT element #16 is the latest revision

    jQuery 2.2.4, HTML, CSS, JavaScript

    (function($, window){
      var arrowWidth = 30;
    
      $.fn.resizeselect = function(settings) {  
        return this.each(function() { 
    
          $(this).change(function(){
            var $this = $(this);
    
            // create ...
  • Get Select Element's Previous Value

    jQuery 2.2.4, HTML, CSS, JavaScript

    // save select for re-use
    var $dropdown = $("#event-type");
    
    
    // store existing value on first load
    $dropdown.data("prev-value", $dropdown.val())
    
    
    $("#event-type").change ...
  • Array Plus Delay

    jQuery (edge), HTML, CSS, JavaScript, Firebug Lite

    function ArrayPlusDelay1(array, delegate, delay) {
    
      // initialize all calls right away
      array.forEach(function (el, i) {
        setTimeout(function() {
            // each loop, call ...
  • jQuery Validate - Wrap Validation Error #3 is the latest revision

    No-Library (pure JS), HTML, CSS, JavaScript

    $(function () {
      var valSettings = $("form").data("validator").settings
    	valSettings.highlight = wrap($.validator.defaults.highlight, highlightDecorator)
      valSettings.unhighlight = wrap($.validator.defaults.unhighlight ...
  • Wild Card Logo

    No-Library (pure JS), HTML, CSS, JavaScript

    // http://www.teacherschoice.com.au/Maths_Library/Trigonometry/solve_trig_SAS.htm
    // https://stackoverflow.com/a/12830454/1366033
    // https://css-tricks.com/transforms-on-svg-elements/
    // http ...
  • Converting string to date in js #1 is the latest revision

    No-Library (pure JS), HTML, CSS, JavaScript

    function stringToDate(dateAsString, format, delimiter) {
      var formatLowerCase = format.toLowerCase();
      var formatItems = formatLowerCase.split(delimiter);
    
      var dateItems = dateAsString.split(delimiter);
    
      var ...