JSFiddle

  • justify vertical flex

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

    <div class="parent">
        <div class="top"><div class="content"></div></div>
        <div class="middle">
            <div class="content">
                <div class="rule"></div>
                <div class="vrule"></div>
            </div>
        </div>
        <div class="bottom"></div>
        <div class="rule"></div>
        <div class="vrule"></div>
    </div>
  • deep inheritance....

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

    function Parent() {
        console.log('parent constructor');
        this.a = 1;
    }
    Parent.prototype.method = function () {
        console.log('parent method', this.a);
    };
    
    Parent ...
  • pattern/gradient

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

    <div class="header">Hello world</div>
  • microgalery

    miniGalery with animation

    jQuery(function ($) {
        var aSpeed = 500;
        var $imgContainer = $('.gallery .imageContainer');
        //заполним картинками
        for (var i = 1; i < 11; i++) {
            var img ...
  • Private variables #19 is the latest revision

    Using private variables with inheritable prototype.

    (function (exports) {
        /*
         * sample prototype,
         *
         * inherit @boolean if true - return privates object,
         *
         */
        function A(inherit) {
            var privates = { //setup private vars, they ...
  • submit button find

    jQuery 2.1.0, HTML, CSS, JavaScript

    $('#test').submit(save);
    function save(e,submittedBy) {
        e.preventDefault();
        alert($(submittedBy).val()); 
    }
    
    $(':submit').click(function(e) {
        e.preventDefault();    
        $(this).parents ...
  • календарь

    jQuery 2.0.2, HTML, CSS, JavaScript, jQuery UI 1.10.3

    $(function () {
        var events = {
            '07.05.2014': {
                title: "Чудесный день",
                desc: "Прекрасный день чтобы изучить javascript"
            }
        }
    
        $('.datepicker').datepicker({
            dateFormat: 'dd.mm ...
  • sample pseudo message router

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

    //*********************************************
    funciton() {
        var a = 1;
        socketNew.off('message', 'mysuperid');
        socketNew.on('message', {
            id: 'mysuperid',
            filter: 'Todos'
        }, callback);
    
        function callback(msg) {
            console ...
  • image mouse scrolling

    jQuery 1.5, HTML, CSS, JavaScript, jQuery UI 1.8.7

    $(document).ready(function() {
    
        
        var wrapper = $('#wrapper'),
            content = $('#scroll-content'),
            width=0.
            wrapper_width=wrapper.outerWidth(),
            w_half=wrapper_width/2;
        var w_left=wrapper.position ...
  • paste replace.

    in textarea

    //используем плагин, для получения позиций курсора http://dwieeb.github.io/jquery-textrange/jquery-textrange.js 
    $('#input').bind('paste', function (e) {
        var $this ...