How to display the Favorites menu list on the web to the mobile view?

yana7
Tera Contributor

How to display the Favorites menu list on the web to the mobile view?

yana7_0-1742451505964.png

 

6 REPLIES 6

KKM
Tera Guru

Hi Yana,

To display the Favorites menu list on mobile view, you need to ensure it adapts responsively to smaller screens. Here are some key techniques:

1. Use a Responsive Design Approach
Use CSS media queries to adjust the menu layout for smaller screens.
Change the menu to a dropdown or sidebar for mobile users.

2. Implement a Mobile-Friendly Navigation
Convert the Favorites menu into a hamburger menu (☰) or an accordion-style list.

Example using HTML, CSS & JavaScript

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Responsive Favorites Menu</title>
<style>
body {
font-family: Arial, sans-serif;
}
.menu-container {
position: relative;
display: inline-block;
}
.menu-button {
background-color: #4a4a4a;
color: white;
padding: 10px;
border: none;
cursor: pointer;
}
.menu-list {
display: none;
position: absolute;
background: #333;
color: white;
list-style: none;
padding: 10px;
border-radius: 5px;
width: 200px;
}
.menu-list li {
padding: 8px;
cursor: pointer;
}
.menu-list li:hover {
background: #555;
}
@media (max-width: 768px) {
.menu-list {
position: static;
width: 100%;
}
}
</style>
</head>
<body>

<div class="menu-container">
<button class="menu-button" onclick="toggleMenu()">☰ Favorites</button>
<ul class="menu-list" id="menuList">
<li>🏠 Home</li>
<li>📄 Incidents</li>
<li>👤 User Administration - Users</li>
<li>👥 User Administration - Groups</li>
<li>🔒 User Administration - Roles</li>
</ul>
</div>

<script>
function toggleMenu() {
var menu = document.getElementById("menuList");
menu.style.display = menu.style.display === "block" ? "none" : "block";
}
</script>

</body>
</html>

Explanation:
CSS Media Query ensures the menu adapts for screens under 768px.
Clicking the menu button (☰) toggles the visibility of the menu.
The menu expands and collapses for mobile-friendly interaction.

This should solve your issue!

Kindly mark it as "Accepted Solution"/"helpful", as it resolves your query. Please press like button for the resolution provided.

With Regards,
Krishna Kumar M - Talk with AIT3ch
LinkedIn: https://www.linkedin.com/in/mkrishnak4/
YouTube: https://www.youtube.com/@KrishAIT3CH
Topmate: https://topmate.io/mkrishnak4 [ Connect for 1-1 Session]

KKM
Tera Guru

Hi Yana,

To display the Favorites menu list on mobile view, you need to ensure it adapts responsively to smaller screens. Here are some key techniques:

1. Use a Responsive Design Approach
Use CSS media queries to adjust the menu layout for smaller screens.
Change the menu to a dropdown or sidebar for mobile users.

2. Implement a Mobile-Friendly Navigation
Convert the Favorites menu into a hamburger menu (☰) or an accordion-style list.

Example using HTML, CSS & JavaScript

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Responsive Favorites Menu</title>
<style>
body {
font-family: Arial, sans-serif;
}
.menu-container {
position: relative;
display: inline-block;
}
.menu-button {
background-color: #4a4a4a;
color: white;
padding: 10px;
border: none;
cursor: pointer;
}
.menu-list {
display: none;
position: absolute;
background: #333;
color: white;
list-style: none;
padding: 10px;
border-radius: 5px;
width: 200px;
}
.menu-list li {
padding: 8px;
cursor: pointer;
}
.menu-list li:hover {
background: #555;
}
@media (max-width: 768px) {
.menu-list {
position: static;
width: 100%;
}
}
</style>
</head>
<body>

<div class="menu-container">
<button class="menu-button" onclick="toggleMenu()">☰ Favorites</button>
<ul class="menu-list" id="menuList">
<li>Home</li>
<li>Incidents</li>
<li>User Administration - Users</li>
<li>User Administration - Groups</li>
<li>User Administration - Roles</li>
</ul>
</div>

<script>
function toggleMenu() {
var menu = document.getElementById("menuList");
menu.style.display = menu.style.display === "block" ? "none" : "block";
}
</script>

</body>
</html>

Explanation:
CSS Media Query ensures the menu adapts for screens under 768px.
Clicking the menu button (☰) toggles the visibility of the menu.
The menu expands and collapses for mobile-friendly interaction.

This should solve your issue!

Kindly mark it as "Accepted Solution"/"helpful", as it resolves your query. Please press like button for the resolution provided.

With Regards,
Krishna Kumar M - Talk with AIT3ch
LinkedIn: https://www.linkedin.com/in/mkrishnak4/
YouTube: https://www.youtube.com/@KrishAIT3CH
Topmate: https://topmate.io/mkrishnak4 [ Connect for 1-1 Session]

Ankur Bawiskar
Tera Patron
Tera Patron

@yana7 

if you are referring to Now mobile app then check this

How to add favorites tab In Now mobile app 

also check this link

Understanding Mobile Favorites 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@yana7 

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader