8.28. Foundation modal box

发布时间 :2025-10-25 12:24:32 UTC      

The modal box is a pop-up window displayed at the head of the page.

We can use the container elements (such as <div id="myModal" ) use a unique ID and add .reveal-modal Class and data-reveal Property to add a modal box. We can use it on any element. data-reveal-id="id" The property Ali opens the mode box. id Must be consistent with the container id (instance is “myModal”).

If you want to close the modal box by clicking outside the modal box. You can click the close button in the mode box <a> Add to the label .close-reveal-modal Class to implement.

注意: The slider needs to use JavaScript. So you need to initialize Foundation JS:

8.28.1. Example

<!-- Trigger the Modal -->
<button type="button" class="button" data-reveal-id="myModal">Click To
Open Modal</button>
<!-- The Modal Content -->
<div id="myModal" class="reveal-modal" data-reveal>
  <h2>Heading in Modal.</h2>
  <p>Some text in the modal.</p>
  <p>Some text in the modal.</p>
  <a class="close-reveal-modal">&times;</a>
</div>
<!-- Initialize Foundation JS -->
<script>
$(document).ready(function() {
    $(document).foundation();
})
</script>

尝试一下 »

Modal box size

You can add the following classes to the modal box container to set the size of the modal box:

  • .tiny : 30% width

  • .small : 40% width

  • .medium : 60% width

  • .large : 70% width

  • .xlarge 95% width

  • .full 100% width and height

注意: It defaults to 80% width on tablets, laptops, PC computers and 100% width on small screen devices.

8.28.2. Example

<div id="myModal" class="reveal-modal
tiny|small|medium|large|xlarge|full" data-reveal>

尝试一下 »

Embedded modal box

You can embed a modal box in the modal box, and you can add a new trigger button to the first modal box. You must set a unique id for the embedded modal box:

8.28.3. Example

<!-- Trigger the modal -->
<a href="#" class="button" data-reveal-id="myModal">Click To Open
Modal</a>
<!-- The First Modal -->
<div id="myModal" class="reveal-modal" data-reveal>
  <h2>First Modal</h2>
  <p>Some text..</p>
  <p><a href="#" data-reveal-id="secondModal" class="button">Open Second
Modal</a></p>
  <a class="close-reveal-modal">&times;</a>
</div>
<!-- The Second Modal -->
<div id="secondModal" class="reveal-modal" data-reveal>
  <h2>Tada! Second Modal</h2>
  <p>Some text..</p>
  <a class="close-reveal-modal">&times;</a>
</div>

尝试一下 »

The second modal box replaces the first modal box. If you want to open the second modal box, do not close the first modal box. Can be added on the second modal box data-options="multiple_opened:true;" Attributes:

8.28.4. Example

<div id="secondModal" class="reveal-modal" data-reveal
data-options="multiple_opened:true;">

尝试一下 »

Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.