Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bplokjs-dom-utils

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bplokjs-dom-utils

`npm install --save bplokjs-dom-utils`

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

bplokjs-dom-utils

安装

npm install --save bplokjs-dom-utils

API

  • css

    const css = require('bplokjs-dom-utils/css');

    • css(element, propName) 获取指定的css值
    • css(element, [...propName]) 获取一组css属性值,返回对象: {propName: value}
    • css(element, object) 批量设置元素css属性
    • css(element, propName, value) 设置元素css属性
  • classes

    const {hasClass, addClass, removeClass, toggleClass} = require('bplokjs-dom-utils/classes')

    • hasClass(element, className)
    • addClass(element, className)
    • removeClass(element, className)
    • toggleClass(element, className)
  • offset

    const offset = require('bplokjs-dom-utils/offset')

    • offset(element) 获取元素相对窗口的位置
    • offset(element, rect/* rect.left, rect.top */) 设置元素相对窗口的位置
  • position

    const position = require('bplokjs-dom-utils/position')

    • position() 获取元素相对offsetParent的位置
  • querySelectorAll

    const querySelectorAll = require('bplokjs-dom-utils/querySelectorAll')

    • querySelectorAll(element, selector)
  • closest

    const closest = require('bplokjs-dom-utils/closest')

    • closest(element, selector)
  • contains

    const contains = require('bplokjs-dom-utils/contains')

    • contains(parent, child)
  • matches

    const matches = require('bplokjs-dom-utils/matches')

    • matches(element, selector)
  • events

    const { on, off, filter, listen } = require('bplokjs-dom-utils/events')

    • on(element, eventName, handler, capture)
    • off(element, eventName, handler, capture)
    • var unlisten = listen(element, eventName, handler, capture)
    • filter(selector, handler)

    listen(element, 'click', filter( '.test', handler ))

  • scrollIntoView

    scrollIntoView(element, [scrollParent])

  • scrollBarSize

    scrollBarSize()

  • domReady

    domReady(fn)

FAQs

Package last updated on 30 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc