JSFiddle

  • Dynamically resize body text

    just testing

    function makeSizer(size) {
      return function() {
        document.body.style.fontSize = size + 'px';
      };
    }
    
    var size12 = makeSizer(12);
    var size14 = makeSizer(14);
    var ...
  • Odd IE8 behavior

    Mootools 1.4.5, HTML, CSS, JavaScript

    <h4>IE8 Only:</h4>
    <div class="box">
    <input type="text" value="y" class="code">
    <input type="text" value="b" class="desc">
    </div>
    <ul>
    <li>Click in the yellow and tab to the blue. The blue hides the yellow.</li>
    <li>Tab back with <kbd>Shift ...</kbd></li></ul>
  • Change selected radio #9 is the latest revision

    jQuery 1.8.3, HTML, CSS, JavaScript

    $(document).ready(function(){
        
        $("button").click(function(){
        
        $("input[value='D']").attr("checked","checked");
        });
        
        console.log( $("input[value='tt']")        );
        console.log( $("input ...
  • Punch all little siblings

    jQuery 1.8.3, HTML, CSS, JavaScript

    $(".firstborn").nextAll().each(function(){
        //alert("a little sibling!");
        $(this).addClass("punched");   
        
    });
  • does .closest() check itself first?

    jQuery 1.8.3, HTML, CSS, JavaScript

    $(".baby").on("click", function(){
        $(this).closest("div").addClass("bright");   
        
    });
  • PaperForm: Form inputs resembling paper forms

    jQuery 1.8.3, HTML, CSS, JavaScript

    <div class="field">
        <label class="label">Phone Number</label>
        <input type="text" placeholder="(555) 555-5555">
    </div>
    
    <div class="field drop">
        <div class="label">Choose One:</div>
        <select><option>One</option>
            <option>Two</option>
            <option>Three</option>
        </select>
    </div>
    
    <div class="field drop print">
        <div class="label">Choose One:</div>
        <select><option>One</option>
            <option>Two</option>
            <option>Three</option>
        </select>
    </div>