touch-dom-zoom
v1.0.3
Published
Touch Dom Such as Img to Zoom dom
Downloads
11
Maintainers
Readme
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>
)
}