JSFiddle

  • Prevent Scrolling #92 is the latest revision

    jQuery 1.7.2, HTML, CSS, JavaScript

    (function($, document, undefined){
    /*
       scroll-sensitive keys:
             9:  Tab (A11Y much?)
            32: Space
            33: PageUp
            34: PageDown
            35: End
            36: Home
            37 ...
  • Javascript: The Little Things - original code #17 is the latest revision

    jQuery 1.7.2, HTML, CSS, JavaScript

    $('#menu > ul > li').on('mouseenter', function(){
        $('>ul', this).stop().fadeIn(300);
    }).on('mouseleave', function(){
        $('>ul', this).stop().fadeOut(300);
    });
  • Simple Draggable Demo

    jQuery 1.7.1, HTML, CSS, JavaScript

    var $doc = $(document),
        $moving = null,
        mouse = {x: 0, y: 0},
        pos = {x: 0, y: 0},
        move = function(e) {
            $moving.css ...
  • Avoid click event on mouse move #29 is the latest revision

    Often enough, especially when dragging stuff around, you want to avoid triggering the click event after releasing the mouse. Since browsers don't do this natively, here's a simple solution

    // mouse move click prevent
    (function($){
        var $doc = $(document),
            moved = false,
            pos = {x: null, y: null},
            abs = Math.abs,
            mclick = {
            'mousedown ...
  • Raphael: Arrows #4 is the latest revision

    Raphael 2.1.0, HTML, CSS, JavaScript

    var r = new Raphael(document.getElementById('canvas'), 500, 500),
        π = Math.PI;
    
    function angle(a, b) {
        // ATan2(dy , dx) where ...
  • Raphael: Perpendicular of a Line #9 is the latest revision

    Raphael 2.1.0, HTML, CSS, JavaScript

    var r = new Raphael(document.getElementById('canvas'), 500, 500),
        π = Math.PI;
    
    function angle(a, b) {
        // ATan2(dy , dx) where ...
  • Raphael.js Bug - global leakage of arrow

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

    var r = Raphael(document.getElementById('canvas'), 300, 300),
        p1, p2;
    
    // draw a line with arrow
    p1 = r.path([
        'M', 0 ...
  • AccessifyHTML5 - improved #19 is the latest revision

    Some improvements to AccessifyHTML5

    /*
     * Accessifyhtml5.js
     *
     * Source: https://github.com/yatil/accessifyhtml5.js
     */
    (function($, undefined){
        
        $.accessifyHtml5 = function(options) {
            var selectors = $.accessifyHtml5.defaults;
            
            // import special ...
  • storage Event | IE8-compatible #106 is the latest revision

    Passing messages between browser windows of the same domain

    $(function(){
        // localStorage sends a "storage" Event to all connected windows
        // this event does not bubble
        // Internet Explorer expects the event ...
  • The simple <a> IDL-Attribute Decomposition #23 is the latest revision

    <a> element to access and modify components of an URL

    /*
        The simple <a> URL Mutation "Hack"
        http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#url-decomposition-idl-attributes
     */
    
    function out(a, key ...</a>