1.0.3 • Published 3 years ago

touch-dom-zoom v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

A library that implements zoom dom, It can works with React, Vue, etc

npm install --save touch-dom-zoom

Look Demo Display

<div><img src="./default.png" alt="" /></div>
<div><img src="./girl3.jpeg" alt="" /></div>
<div><img src="./girl4.png" alt="" /></div>
<script src="./node_modules/touch-dom-zoom/lib/umd.js"></script>
<script>
  window.onload = function () {
    const doms = document.querySelectorAll('div')
    zoomDom(doms)
  }
</script>
commonjs
const zoomDom = require('touch-dom-zoom/lib/cjs')
...
import zoomDom from 'touch-dom-zoom'

async
componentDidMount()
{
  const { data } = await fetch('......').json()
  this.setState({ dataSource: data }, () => {
    zoomDom(document.querySelectorAll('.item'))
  })
}
render()
{
  const { dataSource } = this.state
  return (
    <div>
      {dataSource.map((item) => {
        return (
          <div className={'item'}>
            <img />
            .....
          </div>
        )
      })}
    </div>
  )
}
1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago