Dropdown sidebar with collapsible sections

I am looking to create a unique navigation system for my website. I have a standard HTML list with menu items that will serve as anchor links on a long-scrolling page. My idea is to design it as a minimal vertical side navigation bar, where each item initially displays as a small colored circle without text - similar to traffic lights but all the same color. When a user hovers over a circle, I want the full text of that item to pop out to the side. The challenge is that I don't have direct access to the HTML code since it's generated by a third-party tool. However, I can utilize JavaScript to access the DOM if necessary.

The starting code snippet I have is:

<ul id="navigation">
  <li><a href="#link1">Link1</a></li>
  <li><a href="#link2">Link2</a></li>
  <li><a href="#link3">Link3</a></li>
</ul>

I've been searching for examples where individual items in a side panel pop out rather than the entire panel, but haven't found much luck. If anyone has any tips or suggestions on how to achieve this effect, I would greatly appreciate it. Thank you!

Answer №1

How about something along these lines:

a {
 opacity: 0;
 transform: translateX(-100%);
 transition: all .3s ease;
 display: inline-block;
}

li:hover a {
  transform: translateX(0);
  opacity: 1;
}
<ul id="navigation">
  <li><a href="#link1">Link1</a></li>
  <li><a href="#link2">Link2</a></li>
  <li><a href="#link3">Link3</a></li>
</ul>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is it possible for me to create an HTML script that can transfer data from the script to a cell within Qubole?

Is it possible to create an HTML script that allows user interaction, pass the data back to a zeppelin cell, and trigger a rerun of the data? Thank you! Update: I have made some progress in rerunning the cell with an HTML click. The cell I want to rerun ...

Why does it seem like only one div is being added?

I am facing an issue with dynamically appending multiple div elements. Despite my efforts, only one div element is showing up on the browser when I try to test the code. I have searched for similar problems but could not find any solutions. Any assistanc ...

What are some ways I can troubleshoot my contact form?

As someone new to web design, I recently completed my very first site using a combination of HTML, CSS, and a touch of JavaScript. I managed to create a small contact form within the site, but now I'm wondering if there's a way to make it functio ...

Flask does not provide a direct boolean value for checkboxes

After struggling for a week, I am still lost on where to make changes in my code. I need the checkbox to return a boolean value in my Flask application. Below are snippets of the relevant code: mycode.py import os, sqlite3 from flask import Flask, flash ...

Pass a jQuery value to a PHP variable

I am looking to send a value when I click a button. For example, when I click on <a id="link1"> Page Home </a>, it should send the value to a custom variable php. Here is an example: <?php $linkredirect = ''; // This will be sent ...

Is there a way to prevent Vetur from automatically converting colSpan and rowSpan tags?

Currently, I am utilizing nativescript-vue and I require the colSpan and rowSpan tags to remain unchanged. The code formatter in Vetur changes rowSpan="2" to rowspan="2". Is there a way to deactivate the automatic lowercasing feature o ...

php print some additional php script

I am struggling with implementing PHP code that contains an echo statement. However, I need this echo to output PHP code within it. Here is a brief example: <!php echo '<?php echo "test"; ?>'; ?> The main issue arises when I try to ...

The onchange event for the input type=file is failing to trigger on Google Chrome and Firefox

Update: Solved: http://jsfiddle.net/TmUmG/230/ Original question: I am facing an issue with handling image/logo upload alongside a hidden input type=file: <form class="image fit" id="theuploadform"> <input title="click me to chan ...

Manage the size of the menu element within Material-UI

I'm currently working on incorporating a menu item with a login form inside it. The functionality is there, but the width of the form is way too small. I've been searching through the documentation for a solution, but haven't come across any ...

What is the best way to make multiple HTML tables sortable?

I recently implemented an open-source JavaScript table sorter in my project. You can find more information about it here: However, I encountered an issue where only the most recently added table on my page is sortable. When users press a button, new table ...

Necessary Quasar Select Dropdown Class

Looking to set an asterisk (*) next to the Select component in Quasar when it is marked as "required". While I can achieve this with the input component, replicating the same behavior for dropdowns has proved challenging. I attempted using the :deep selec ...

Converting HTML into an image in a Node.js Buffer

Can you suggest a simple method to convert a raw HTML string, like the following: <b>Hello World</b> into a regular PNG image in Node.js Buffer form? I've been exploring various npm packages for a solution that supports this functionali ...

Include dropdown lists for selecting the year, month, and day on a web page

Is there a way to implement a dropdown style date selector that dynamically updates the number of days based on the selected year and month using JavaScript? For example, February 2008 has 29 days, April has 30 days, and June has 31 days. Any suggestions ...

The PHP index is not being identified when accessed through the post method

I am delving into the world of PHP as a beginner and still learning the ropes. I tried to replicate a small script exactly from one language to another, but encountered an issue where the index from my HTML file is not being recognized in PHP. The tutorial ...

Tips for sending two values to a PHP file using JavaScript Ajax

I have created a code for two dropdown menus. The goal is to select values from both menus and send them to a php file using the GET method. The values should be sent to the php file only when both menus have selections made. Below is the code snippet: ...

Why is it that lists always begin outside of the enclosing element?

I've always found this incredibly frustrating. Why do lists behave this way? When you set the margin and padding to 0, you would expect them to align normally with the surrounding text on the left, right? But no. That's where the text within the ...

the display:block property totally ruins my aesthetic

I'm facing an issue with filtering a table using an input box within one of the elements. Whenever I type something in the input box, the table automatically filters its rows based on the input. The strange thing is that when I try to use display:bl ...

Chrome has some issues with resizing the SVG Pattern element

Utilizing inline svgs, I have a svg circle filled with a pattern that should cover 100% of the container size. However, when the parent element is resized via JavaScript, the pattern no longer reflects the 100% width and height as expected. This issue seem ...

Using Firebase with the async pipe in Angular 5

I am struggling to implement async pipe in Angular firebase and encountering an error that I cannot resolve: ERROR Error: InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe' Utilizing the Firebase NoSQL database: { "bos ...

When accessing the innerHTML and outerHTML properties on an HTMLElement, they may return undefined without triggering

Task: My goal is to take an HTML string, make changes to certain attributes of image tags within it, and then return the modified HTML string. The function I have developed follows these steps: private resolveImagesInHTML (body: string): string { le ...