yanchengPowerSupply/node_modules/element-resize-event-polyfill/example/case.esm.html

36 lines
1.0 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<style>
.container {
width: 300px;
height: 200px;
border: 1px solid;
resize: both;
overflow: auto;
}
</style>
<title>Document</title>
</head>
<body>
<div class="container" id="container"></div>
</body>
<!-- <script src="../dist/element-resize-event-polyfill.umd.js"></script> -->
<script type="module">
import '../dist/element-resize-event-polyfill.umd.js'
const elm = document.getElementById('container')
elm.addEventListener('resize', function(e) {
console.log('Trigger resizable event by listener one')
})
elm.addEventListener('resize', function(e) {
console.log('Trigger resizable event by listener two')
})
elm.onresize = function(e) {
console.log('Trigger resizable event by handler')
}
</script>
</html>