JSFiddle

  • Multiple Independent sliders

    vidur.io/for-sale

    $('.slider-control.prev').click(function() {
        var parent = $(this).parent();
        var currentSlide = parent.find('.slide.visible');
        var prevSlide = currentSlide.prev('.slide');
        var ...
  • Stripe Animations #2 is the latest revision

    jQuery 2.1.0, HTML, CSS, JavaScript

    $(document).ready(function() {
        $(window).click(function() {
            var stripe = $('#stripe');
    
            if(!stripe.hasClass('visible')) {
                stripe.addClass('visible');
            }
        });
    });
  • Nested fixed width columns

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

    <div id="container">
        <div class="fixed-left-bit">&nbsp;</div>
        <div class="right">
            &nbsp;
            <div class="fixed-right-bit">&nbsp;</div>
        </div>
    </div>
  • Grid Builder

    js and css. (no jquery)

    function buildGrid(numRows, numCols, rHeight, cHeight) {
        var rowHeight = rHeight || Math.floor((window.innerHeight || document.documentElement.offsetHeight) / numRows);
        var colWidth = cHeight ...
  • Google Maps JS - Detection

    Source: http://tech.bellycard.com/blog/where-d-the-water-go-google-maps-water-pixel-detection-with-canvas/

    $(function(){
       var latlon = "40.7300694,-74.0024224"; // Sample Lat,Long (Manhattan NYC)
    	var distance_between_people = 40; // Keep 40 pixels between people ...
  • Horizontally align divs #117 is the latest revision

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

    <div id="start" class="side">
        <span>1</span>
        <span>Lower</span>
    </div>
    <div id="range"></div>
    <div id="end" class="side">
        <span>10</span>
        <span>Higher</span>
    </div>
  • Win8 Fix - Line up Textarea #9 is the latest revision

    jQuery 1.6.4, HTML, CSS, JavaScript

    $("textarea[name='thing']").focus(function() {
        $(this).css( 'margin-bottom', '500px' );
        window.location.hash = '#prompt';
    });
    
    $("textarea[name='thing']").focusout(function() {
        $(this).css ...
  • JS Unique IDs

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

    var universe = {};
    (function() {
        var usedIDs = {};
        var id = 0;
    
        var Orangutan = function(params) {
            
            var _uniqueId = function(params.id) {
                if(typeof this ...
  • Grid Builder #3 is the latest revision

    js and css. (no jquery)

    function buildGrid(numRows, numCols) {
        var rowHeight = Math.floor((window.innerHeight || document.documentElement.offsetHeight) / numRows);
        var colWidth = Math.floor((window.innerWidth ...
  • Notch - Minecraft tunneling render #52 is the latest revision

    HN - http://news.ycombinator.com/item?id=4862830 -- I've renamed variables to make sense.

    var ctx;
    var pixels;
    
    var w = 212 * 2;
    var h = 120 * 2;
    
    var map = new Array(64 * 64 * 64);
    var ...