JSFiddle

  • simple counter

    http://stackoverflow.com/questions/17270047/create-a-counter-i-want-that-evry-1000-millisecond-it-increment

    $(function () {
        var md = $('.maindiv');
        var links = md.find('.divlink');
        setInterval(function(){
            var t = md.find('.divlink');
            var lasthref = t.eq ...
  • memory game #28 is the latest revision

    http://stackoverflow.com/questions/17282970/saving-and-comparing-table-cell-values

    $(document).ready(function () {
        var countCells;
    
        var createTable = function (col, row) {
            var str = '';
            for (var i = 1; i <= row; i++) {
                str += '<tr>';
                for (var j ...</=>
  • Testing the textarea #2 is the latest revision

    http://stackoverflow.com/questions/17130827/my-form-submits-data-even-if-it-is-invalid-but-my-validation-works-fine

    function validateEntry(entry) { /*validating*/
        var error_box = document.getElementById('error_box');
        if (isNaN(evalue)) {
            entry.style.background = "#ccffcc";
            return true;
            error_box.style ...
  • show element info on mouseover #11 is the latest revision

    http://stackoverflow.com/questions/16548160/html-javascript-scrolling-through-list-box-items-and-display-prompt-for-each/

    $(document).ready(function(){
        var lastli = null;
        var ci = $('#carinfo');
        $('.carlist li').hover(function(e){
            if (lastli == this) { return; } else {}
            var ...
  • simple slideshow #41 is the latest revision

    http://stackoverflow.com/questions/12164828/jquery-swap-animate-array-of-sequential-jpg-images

    var images = [];
    var i = 0;
    var interval = null;
    
    function preload_images() {
    /*
        var i;
        for (i = 0; i < 126; i++) {
            images[i ...
  • animate div on bezier curves

    http://stackoverflow.com/questions/12021750/move-object-from-one-point-to-another-point useful links: https://github.com/weepy/jquery.path/blob/master/README.markdown http://www.html5canvastutorials.com/tutorials/html5-canvas-bezier-curves/

    var bezier_params1 = {
        start: { x: 250, y: 10, angle: -10 },
        end: { x: 20, y: 10, angle: 20, length: 3.0 }
    };
    
    var ...
  • not inline css style

    http://stackoverflow.com/questions/12010506/how-to-get-the-css-property-from-external-css-file-if-the-inline-style-is-applie

    var el = document.getElementById('my').cloneNode(false);
    el.removeAttribute('style');
    var left = window.getComputedStyle(el, null).getPropertyValue('left');
    alert(left);
    
    
  • two column layout #20 is the latest revision

    http://stackoverflow.com/questions/11964927/restrict-the-resizing-of-div-on-browser-resize/

    
    
  • form submit

    http://stackoverflow.com/questions/11985931/i-dont-know-how-how-to-say-this-the-right-way-but

    $('#LoginPageForm').submit(function() {
        var retval = true;
        var user = $('#UserField');
        var pass = $('#PasswordField');
        if (user.val().replace(/\s/g, "") === "") {
            alert("You ...
  • sort object by property #654 is the latest revision

    http://stackoverflow.com/questions/1069666/sorting-javascript-object-by-property-value

    function sortObject(obj) {
        var arr = [];
        var prop;
        for (prop in obj) {
            if (obj.hasOwnProperty(prop)) {
                arr.push({
                    'key': prop,
                    'value ...