JSFiddle

  • Intersection area of two rectangle

    jQuery 1.7.1, HTML, CSS, JavaScript, jQuery UI 1.8.16

    var divs = $('.tester').resizable().draggable({
        drag: function(){
            var d0 = divs.eq(0).position(),
                d1 = divs.eq(1).position(),
                x11 = d0 ...
  • 自动求解器

    利用牛顿法来自动求得一元函数的近似解。

    $("#exp").on('keydown', function (event) {
        if (event.keyCode == 13) {
            cal($("#exp").val());
        }
    });
    
    $("#eq").click(function () {
        cal($("#exp").val());
    });
    
    $('#exp').bind ...
  • 照片任意变形后取遮罩

    jQuery 2.1.0, HTML, CSS, JavaScript

    <input type="file" id="take-picture" accept="image/*">拍照</input>
    <button type="button" onclick="doClip()">剪裁测试</button>
  • 线圆相交测试

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

    var stage = new createjs.Stage('stage');
    TweenLite.ticker.addEventListener("tick", stage.update, stage);
    
    var circle = new createjs.Shape();
    circle.graphics ...
  • 圆线碰撞 #10 is the latest revision

    jQuery 1.11.0, HTML, CSS, JavaScript

    var stage = new createjs.Stage('stage');
    TweenLite.ticker.addEventListener("tick", stage.update, stage);
    
    var circle = new createjs.Shape();
    circle.graphics ...
  • 自动求解器 #29 is the latest revision

    利用牛顿法来自动求得一元函数的近似解。

    $("#exp").on('keydown', function (event) {
        if (event.keyCode == 13) {
            cal($("#exp").val());
        }
    });
    
    $("#eq").click(function () {
        cal($("#exp").val());
    });
    
    $('#exp').bind ...
  • 二叉查找树测试 #6 is the latest revision

    jQuery 1.9.1, HTML, CSS, JavaScript

    $('#test').click(function () {
        var bst = new BinarySearchTree();
        var dic = {};
        var num = parseInt($("#nodes").val(), 10);
        var key;
        var start = 'bob ...
  • 表达式运算 #5 is the latest revision

    jQuery 2.1.0, HTML, CSS, JavaScript

    $("#exp").on('keydown', function (event) {
        if (event.keyCode == 13) {
            $('#result').html(calInfixExpression($("#exp").val()));
        }
    });
    
    $("#eq").click( function() {
        $('#result').html(calInfixExpression ...
  • 汉诺塔 #179 is the latest revision

    jQuery 2.1.0, HTML, CSS, JavaScript

    var stage = new createjs.Stage('stage');
    TweenLite.ticker.addEventListener("tick", stage.update, stage);
    
    var hanoi = new createjs.Container();
    stage.addChild ...
  • 简易多项式运算 #10 is the latest revision

    jQuery 2.1.0, HTML, CSS, JavaScript

    $("#add").click(function () {
        var p1 = extractPoly($("#p1").val());
        var p2 = extractPoly($("#p2").val());
        var sum = p1.add(p2);
        $("#result").html ...