7.25. Bootstrap5 prompt box

发布时间 : 2025-10-25 13:35:27 UTC      

Page Views: 9 views

The prompt box is a small pop-up window that appears when the mouse moves over the element and disappears when the mouse moves outside the element.

7.25.1. How to create a prompt box

By adding to elements data-bs-toggle="tooltip" let’s create a prompt box.

title property is what is displayed in the prompt box:

<button type="button" class="btn btn-primary" data-bs-toggle="tooltip" title="I am the prompt content!">Move the mouse over to mebutton>    

Note: the prompt box should be written in the initialization code of JavaScript: then call on the specified element tooltip() method.

The following examples can use prompt boxes anywhere in the document:

Example

var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')) var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) { return new bootstrap.Tooltip(tooltipTriggerEl) }) 

7.25.2. Specify the location of the prompt box

By default, the prompt box is displayed above the element.

You can use the ‘data bs placement’ attribute to set the direction of the prompt box display: top , bottom , left or right :

Example

<a href="#" data-bs-toggle="tooltip" data-bs-placement="top" title="I am the prompt content!">Move the mouse over to mea> <a href="#" data-bs-toggle="tooltip" data-bs-placement="bottom" title="I am the prompt content!">Move the mouse over to mea> <a href="#" data-bs-toggle="tooltip" data-bs-placement="left" title="I am the prompt content!">Move the mouse over to mea> <a href="#" data-bs-toggle="tooltip" data-bs-placement="right" title="I am the prompt content!">Move the mouse over to mea>       
                
                
            
        
        
《地理信息系统原理、技术与方法》  97

最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。