8.13. Foundation drop-down menu

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

The Foundation drop-down menu allows the user to select a value from a predefined drop-down list:

8.13.1. Example

<!-- Trigger the Dropdown -->
<a href="#" data-dropdown="id01" class="button dropdown">Dropdown
Button</a>
<!-- Dropdown content -->
<ul id="id01" data-dropdown-content class="f-dropdown">
  <li><a href="#">Link 1</a></li>
  <li><a href="#">Link 2</a></li>
  <li><a href="#">Link 3</a></li>
</ul>
<!-- Initialize Foundation JS -->
<script>
$(document).ready(function() {
    $(document).foundation();
})
</script>

尝试一下 »

Case analysis

.dropdown Class to add a downward arrow symbol icon to the button.

Using buttons or links data-dropdown="id" Property to open the drop-down menu.

id The value needs to match the contents of the drop-down menu (id01).

In < div >, < nav > <ul> Add in .f-dropdown Class and data-dropdown-content Property to create the contents of the drop-down menu.

Finally, initialize the Foundation JS.

注意: On the small screen, the width of all drop-down menus is 100%.

Drop-down menu size

使用 .tiny , .small , .medium , .large .mega 来修改下拉菜单的宽度。

注意: On the small screen, the width of all drop-down menus is 100%.

8.13.2. Example

<!-- Tiny Dropdown: max-width is 200px -->
<ul id="id01" data-dropdown-content class="f-dropdown tiny">..
<!-- Small Dropdown: max-width is 300px -->
<ul id="id02" data-dropdown-content class="f-dropdown small">..
<!-- Medium Dropdown: max-width is 500px -->
<ul id="id03" data-dropdown-content class="f-dropdown medium">
<!-- Large Dropdown: max-width is 800px -->
<ul id="id04" data-dropdown-content class="f-dropdown large">..
<!-- Mega Dropdown: 100% width -->
<ul id="id04" data-dropdown-content class="f-dropdown mega">..

尝试一下 »

Drop-down menu margin

Can be used .content Class to add an inner margin to the drop-down menu

8.13.3. Example

<!-- Default Dropdown -->
<ul id="id01" data-dropdown-content class="f-dropdown">..
<!-- Dropdown with padding -->
<ul id="id02" data-dropdown-content class="f-dropdown content">..

尝试一下 »

Other instances

< div > add multimedia elements to the drop-down menu:

8.13.4. Example

<a href="#" data-dropdown="id01" class="button dropdown">Dropdown
Button</a>
<div id="id01" data-dropdown-content class="f-dropdown medium content">
  <h4>Paris Title</h4>
  <p>Some text.. some text..</p>
  <img src="paris.jpg" alt="Paris" width="400" height="300">
  <p>Paris, je t'aime.</p>
</div>

尝试一下 »

Drop-down menu direction

By default, the drop-down menu is at the bottom, and you can add data-options="align:left|right|top" To change its orientation:

8.13.5. Example

<a href="#" data-dropdown="id01" data-options="align:right"
class="button dropdown">Right</a>
<a href="#" data-dropdown="id02" data-options="align:top" class="button
dropdown">Top</a>
<a href="#" data-dropdown="id03" data-options="align:bottom"
class="button dropdown">Bottom</a>
<a href="#" data-dropdown="id04" data-options="align:left" class="button
dropdown">Left</a>

尝试一下 »

Pull-down menu trigger condition

By default, the drop-down menu is displayed after the button is clicked. If you need to display after the mouse is moved up, you can use it on the button data-options="is_hover:true" Attributes:

8.13.6. Example

<a href="#" data-dropdown="id01" data-options="is_hover:true"
class="button dropdown">Hover over me</a>
<ul id="id01" data-dropdown-content class="f-dropdown">
  <li><a href="#">Link 1</a></li>
  <li><a href="#">Link 2</a></li>
  <li><a href="#">Link 3</a></li>
</ul>

尝试一下 »

Split button

We can add it to the button .split Class to set a split effect button, which generates a downward icon button on the < span > element:

8.13.7. Example

<button class="button split">Split Button
  <span data-dropdown="id01"></span>
</button>
<ul id="id01" data-dropdown-content class="f-dropdown">
  <li><a href="#">Link 1</a></li>
  <li><a href="#">Link 2</a></li>
  <li><a href="#">Link 3</a></li>
</ul>
<!-- Initialize Foundation JS -->
<script>
$(document).ready(function() {
    $(document).foundation();
})
</script>

尝试一下 »

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.