@tyler.thayn/jquery.properties

0.1.1 • Public • Published

jquery.properties

jQuery extension for setting data properties with listeners

Installation

npm install @tyler.thayn/jquery.properties

Usage

require(['jquery', '../jquery.properties.js'], ($) => {
	$(() => {
		$('.Test').Property('MyProp', function (...args) {
			console.log(this)
			console.log(args)
		})
		$('.Test').Property('OtherProp', function (...args) {
			console.log(this)
			console.log(args)
		})
		$('.Test').Property('AnotherProp', function (...args) {
			console.log(this)
			console.log(args)
		})

		$('.Test').Property('MyProp', 'MyVal')
		$('.Test').data({OtherProp: 115, AnotherProp: true})
	})
})
fetch('https://cdn.jsdelivr.net/npm/@tyler.thayn/jquery.properties@latest/jquery.properties.js').then(t => t.text()).then(eval)

Readme

Keywords

Package Sidebar

Install

npm i @tyler.thayn/jquery.properties

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

382 kB

Total Files

8

Last publish

Collaborators

  • tyler.thayn