我試圖弄清楚如何創建一個側面彈出視窗/橫幅,類似于右鍵單擊并按下searchMac 時出現的彈出視窗。

我不確定要搜索什么或如何開始,有人可以告訴我該做什么并將我推向正確的方向(最好使用順風,但我可以適應)?提前致謝。
uj5u.com熱心網友回復:
它被稱為popovers,您可以搜索任何順風元素或組件站點,您會發現很多
- https://tailwind-elements.com/docs/standard/components/popover/
- https://tailwinduikit.com/components/webapp/UI_element/popover
- 更多在https://www.google.com/search?q=make popovers in tailwind
注意:代碼片段在 cdn tailwind 上存在問題,它適用于普通的 tailwind CLI one
var popoverTriggerList = [].slice.call(
document.querySelectorAll('[data-bs-toggle="popover"]')
);
var popoverList = popoverTriggerList.map(function(popoverTriggerEl) {
return new Popover(popoverTriggerEl);
});
<script src="https://cdn.tailwindcss.com"></script>
<div class="flex justify-center flex-wrap">
<button type="button" class="
px-7
py-3
bg-red-600
text-white
font-medium
text-sm
leading-snug
uppercase
rounded
shadow-md
hover:bg-red-700 hover:shadow-lg
focus:bg-red-700 focus:shadow-lg focus:outline-none focus:ring-0
active:bg-red-800 active:shadow-lg
transition
duration-150
ease-in-out
" data-bs-toggle="popover" data-bs-title="Popover title" data-bs-content="And here's some amazing content. It's very engaging. Right?">
Click to toggle popover
</button>
</div>
<!-- Required popper.js -->
<script src="https://unpkg.com/@popperjs/[email protected]/dist/umd/popper.min.js" charset="utf-8"></script>
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/419384.html
標籤:
