Git Product home page Git Product logo

double's Introduction

Double

Double is a jQuery plugin for hiring doubles for your elements.

Ever wished to change an element's properties, style and behavior and instantly restore to what it was before the mess ? That's what Double enables you to do. You make a double, change it, and then, eventually, recall the original.

Usage:

var box = $('#box');

box.css('background', 'black'); // We set its background to black
box.double().css('background', 'red'); // Now it has a red background, but we are actually looking at its double
box.recall(); // Here we recall the original, restoring its background to black

The method double() is a reference to the element's double. You can chain multiple calls just like you do with regular jQuery objects. That's because it is a regular jQuery object.

box.double().text("Hello, I'm a double!").css('font-size', '48px');
box.double().text("I do dangerous stuff for you.");

box.recall();

Whatever changes you've done to its double, it will be undone when you recall the original. All styles and bindings, everything back to what it was before the first time you called double().

double's People

Contributors

haggen avatar

Watchers

Fred avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.