Outils pour utilisateurs

Outils du site


html_css:bootstrap5:popovers

Popovers

Doc: https://getbootstrap.com/docs/5.0/components/popovers/

Un bouton qui affiche un formulaire dans un popover lorsqu'on clique dessus :

<button id="searchButton" class="btn btn-primary">Rechercher</button>
 
<div class="invisible">
    <div id="searchForm">
        <form>
            ...
            champs du formulaire
            ...
        </form>
    </div>
</div>
 
<script>
new bootstrap.Popover(
    document.getElementById('searchButton'),
    {
        placement: "bottom",
        html : true,
        trigger: "focus",
        title: "Rechercher",
        content: document.getElementById('searchForm')
    }
);
</script>
html_css/bootstrap5/popovers.txt · Dernière modification: 2023/07/27 13:43 par marclebrun