1.0.9 • Published 3 years ago

jquery-plugin-chain v1.0.9

Weekly downloads
3
License
ISC
Repository
github
Last release
3 years ago

What is this?

A jQuery plugin for simplifying chain operation.

Installation

npm install jquery-plugin-chain --save

Usage

ES6 JavaScript

import $ from "jquery";
import "jquery-plugin-chain";


$(".something, .someone")
.css({
    color: "black";
    backgroundColor: "pink"
})
.chain(function(){
    let count = this.length;
    if (count % 2 == 0) {
        this.attr("even", "even");
        return this;
    } else {
        return this.filter(".important-feature");
    }
})
.addClass("yeah")
;

TypeScript

import $ from "jquery";
import "jquery-plugin-chain";


$(".something, .someone")
.css({
    color: "black";
    backgroundColor: "pink"
})
.chain(function(this: JQuery<HTMLElement>){
    let count = this.length;
    if (count % 2 == 0) {
        this.attr("even", "even");
        return this;
    } else {
        return this.filter(".important-feature");
    }
})
.addClass("yeah")
;
1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago