Foundation CSS JavaScript Utilities
Last Updated :
28 Apr, 2025
Foundation JavaScript Utilities is a collection of tools that can be used to enhance the functionality of your Foundation website. To use Foundation JavaScript Utilities, you first need to include the foundation.js file in your website. Once you have done this, you can use the various utilities by calling the corresponding function. For example, to create a custom animation, you would use the Foundation.Move() function.
Syntax
The syntax for calling a Foundation JavaScript Utility function is as follows:
Foundation.[Utility Name]([Arguments]);
Selector Engine
Throttle and Debounce
Data Options
Media Queries
Example 1:
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content=
"width=device-width, initial-scale=1.0">
<title>Foundation JS Utilities Example</title>
<link rel="stylesheet" href=
"https://cdnjs.cloudflare.com/ajax/libs/foundation/6.6.3/css/foundation.min.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="top-bar">
<div class="top-bar-left">
<ul class="dropdown menu" data-dropdown-menu>
<li class="menu-text">GeeksForGeeks</li>
<li>
<a href="#">Courses</a>
</li>
<li>
<a href="#">Tutorials</a>
<ul class="menu">
<li><a href="#">
Data Structure and Algorithm
</a></li>
<li><a href="#">System Design</a></li>
<li><a href="#">Web Development</a></li>
</ul>
</li>
<li>
<a href="#">Jobs</a>
<ul class="menu">
<li><a href="#">For Job Seekers</a></li>
<li><a href="#">For Recruiters</a></li>
</ul>
</li>
<li>
<a href="#">Contact</a>
</li>
</ul>
</div>
</div>
<script src=
"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js">
</script>
<script src=
"https://cdnjs.cloudflare.com/ajax/libs/foundation/6.6.3/js/foundation.min.js">
</script>
<script src="script.js"></script>
</body>
</html>
CSS
.top-bar, .top-bar ul {
background-color: white;
}
.menu{
color: green;
}
a,ul,li{
color: black;
}
a:hover{
color: green;
}
ul:hover{
color: green;
}
li:hover{
color: green;
}
JavaScript
$(document).foundation();
- In this example, we have included the Foundation CSS file using the CDN link provided, and the necessary JavaScript files for jQuery and Foundation. We have also added the required markup for a top bar navigation menu with a dropdown submenu.
- To ensure the Foundation JavaScript utilities work correctly, we have included the jQuery library before the Foundation JavaScript file. Finally, we have initialized the Foundation framework by calling $(document).foundation().
Output:

Example 2:
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content=
"width=device-width, initial-scale=1.0">
<link rel="stylesheet" href=
"https://cdnjs.cloudflare.com/ajax/libs/foundation/6.6.3/css/foundation.min.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<h1>GeeksForGeeks</h1>
<p>Best Programming Languages</p>
<ul class="accordion" data-accordion>
<li class="accordion-item" data-accordion-item>
<a href="#" class="accordion-title">Java</a>
<div class="accordion-content" data-tab-content>
Java is a high-level, class-based,
object-oriented programming language
that is designed to have asfew
implementation dependencies as possible.
</div>
</li>
<li class="accordion-item" data-accordion-item>
<a href="#" class="accordion-title">Python</a>
<div class="accordion-content" data-tab-content>
Python is a high-level, general-purpose
programming language. Its design philosophy
emphasizes code readability with the use of
significant indentation via the off-side rule.
</div>
</li>
<li class="accordion-item" data-accordion-item>
<a href="#" class="accordion-title">C++</a>
<div class="accordion-content" data-tab-content>
C++ was designed with systems programming
and embedded, resource-constrained software
and large systems in mind, with performance,
efficiency, and flexibility of use as its
design highlights.
</div>
</li>
</ul>
</div>
<script src=
"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js">
</script>
<script src=
"https://cdnjs.cloudflare.com/ajax/libs/foundation/6.6.3/js/vendor/what-input.min.js">
</script>
<script src=
"https://cdnjs.cloudflare.com/ajax/libs/foundation/6.6.3/js/foundation.min.js">
</script>
<script src="script.js"></script>
</body>
</html>
CSS
.container {
margin: 20px;
}
h1 {
color: green;
}
JavaScript
$(document).foundation();
- This example demonstrates the basic usage of the Foundation's accordion component. The example uses the Foundation CSS framework for styling and the Foundation JavaScript files to initialize the accordion functionality.
Output:

Reference: https://get.foundation/sites/docs/javascript-utilities.html.
Similar Reads
Foundation CSS JavaScript A Foundation CSS is an open-source and responsive front-end framework created by ZURB in September 2011 that makes it simple to create stunning responsive websites, apps, and emails that operate on any device. Many companies, like Facebook, eBay, Mozilla, Adobe, and even Disney, use it. The framewor
4 min read
Foundation CSS JavaScript Miscellaneous Utilities Foundation CSS is a responsive front-end framework for building web applications. It includes a set of CSS styles and JavaScript functions that can be used to create a responsive layout and add interactivity to a website. Foundation CSS JavaScript miscellaneous utilities: Foundation.GetYoDigits([num
4 min read
Foundation CSS JavaScript using Plugins Foundation CSS is an open-source & responsive front-end framework built by ZURB foundation in September 2011, that makes it easy to design beautiful responsive websites, apps, and emails to look amazing & can be accessible to any device. It is used by many companies such as Facebook, eBay, M
3 min read
Foundation CSS JavaScript Events Foundation CSS JavaScript is a set of JavaScript tools and plugins that can be used to add interactivity and functionality to your website. It includes a variety of plugins for things like modals, alerts, and accordions, as well as utility functions for handling events and working with the DOM. Foun
3 min read
Foundation CSS JavaScript Programmatic Use Foundation CSS is an open-source and responsive front-end framework created by ZURB in September 2011 that makes it simple to create stunning responsive websites, apps, and emails that operate on any device. Many companies, like Facebook, eBay, Mozilla, Adobe, and even Disney, use it. This framework
4 min read
Why learn JavaScript Foundations ? JavaScript is like a cornerstone in the world of programming languages. It's famous for being adaptable and everywhere. No matter if you're into making websites, or mobile apps, or diving into server stuff, understanding the basics of JavaScript is super important. Let's talk about why it's so cruci
4 min read