@maaaashi/long-press-button
v0.1.0
Published
A long press button component
Downloads
2
Readme
Long Press Button
Table of Contents
Usage
<!-- default -->
<long-press-button></long-press-button>
<!-- edit duration -->
<long-press-button duration=1000></long-press-button>
<!-- edit text -->
<long-press-button text="クリック" holding-text="Holding..."></long-press-button>
script src
<head>
<script src="https://maaaashi.github.io/long-press-button/bundle.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
const button = document.querySelector('long-press-button');
button.onLongPress = () => alert('外部から渡された関数が実行されました!');
});
</script>
</head>
<body>
<long-press-button></long-press-button>
</body>
npm
$ npm install @maaaashi/long-press-button
import '@maaaashi/long-press-button'
const longPressButton = document.querySelector('long-press-button');
button.onLongPress = () => alert('外部から渡された関数が実行されました!');
<long-press-button></long-press-button>