ui-lib/lib/ui/popup.html
2023-04-10 08:33:10 +08:00

28 lines
747 B
HTML

<div>
<h1>popup</h1>
<hr />
<p>
创建弹出窗口。
</p>
<hr />
<h2>示例</h2>
<div id="popup-sample">
<button id="button-popup">Popup</button>
</div>
<script type="text/javascript">
const ui = window['lib-ui'];
document.querySelector('#button-popup').addEventListener('click', () => {
const popup = ui.createPopup('title', 'content',
{ text: 'Ok', trigger: () => true });
document.body.appendChild(popup);
setTimeout(() => popup.style.opacity = 1);
});
</script>
<style type="text/css">
:root {
--title-bg-color: lightgray;
--title-color: #333;
}
</style>
</div>