all AI news
Creating a Sidebar with Active Links
Nov. 19, 2023, 8:25 p.m. | Cisco Vlahakis
DEV Community dev.to
Suppose we want to create a sidebar menu that tracks active links.
First, let's create the sidebar container div:
<div id="sidebar-container">
</div>
Assume our data-sidebar-links are being passed from an ERB file:
<div id="sidebar-container" data-sidebar-links='<%= @sidebar_links %>'>
</div>
Now, let's set a title at the top of the sidebar:
<div id="sidebar-container" data-sidebar-links='<%= @sidebar_links %>'>
<div class="sidebar-heading">
<%= @title %>
</div>
</div>
Now, we can loop through each link. We can place an href around a div containing an icon and …
More from dev.to / DEV Community
Jobs in AI, ML, Big Data
Software Engineer for AI Training Data (School Specific)
@ G2i Inc | Remote
Software Engineer for AI Training Data (Python)
@ G2i Inc | Remote
Software Engineer for AI Training Data (Tier 2)
@ G2i Inc | Remote
Data Engineer
@ Lemon.io | Remote: Europe, LATAM, Canada, UK, Asia, Oceania
Artificial Intelligence – Bioinformatic Expert
@ University of Texas Medical Branch | Galveston, TX
Lead Developer (AI)
@ Cere Network | San Francisco, US