1.5.3 • Published 2 months ago

@kjojs/idom v1.5.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

@kjojs/idom

  • provides a concise and intuitive dom manipulation API
  • like jquery, but only partial features
  • not support cross browsing and use native api, so small and fast
  • small size (6kb)

Installation

npm install @kjojs/idom --save

Getting Started

import idom from '@kjojs/idom';

const popupDom = idom(document.getElementById('id')); // or idom('#id')

popupDom.css({
  'position': 'fixed',
  'top': 0,
  'right': 0,
  'bottom': 0,
  'left': 0,
  'background-color': 'rgba(0, 0, 0, 0.8)',
}).transition(
  'transform',
  'translateX(100px)',
  {
    duration: 1000,
    timingFunction: 'ease-in-out',
  },
).on({
  'click': () => {
    console.log('clicked!');
  },
});

Features

  • Events
    • .on(eventName, eventHandler, life?)
    • .on(eventSpecification)
    • .once(eventName, eventHandler)
    • .once(eventSpecification)
    • .off()
    • .off(eventName)
    • .off(eventName, eventHandler)
  • Styles and Attributes
    • .css(cssProperty)
    • .css(cssProperty, cssValue)
    • .css(cssMap)
    • .attr(attrName)
    • .attr(attrName, attrValue)
    • .attr(attrMap)
    • .data(dataKey)
    • .data(dataKey, dataValue)
    • .data(dataMap)
  • DOM Tree
    • .get(index)
    • .find(selector)
    • .first()
    • .last()
    • .rect()
    • .text()
    • .text(innerText)
    • .html()
    • .html(innerHTML)
  • Animation
    • .transition(cssProperty, cssValue, transitionOption)
1.5.3

2 months ago

1.5.2

3 months ago

1.5.1

3 months ago

1.5.0

3 months ago

1.4.0

3 months ago

1.2.0

3 months ago

1.3.0

3 months ago

1.2.1

3 months ago

1.1.1

3 months ago

1.1.0

3 months ago

1.0.1

3 months ago

1.0.0

3 months ago

0.3.0

3 months ago

0.2.1

3 months ago

0.2.0

3 months ago

0.2.2

3 months ago

0.1.1

4 months ago

0.1.0

4 months ago