Tips for displaying sub links when hovering over a link

My code can be found at http://jsfiddle.net/ChvjL/4/

I need the sub links link1a, link1b, link1c to appear when the mouse pointer is over Link1.

The same functionality should apply for Link2 as well.

If anyone can assist me in solving this issue, I would greatly appreciate it.

Thank you in advance! Amith

Answer №1

Here is a suggested structure for your specific case:

HTML

<ul>
    <li><a href="#">Link1</a> 
        <ul>
            <li><a href="USEPCreate.html">Link1a</a></li>
            <li><a href="USEPUpdate.html">Link1b</a></li>
            <li><a href="USEPRecovery.html">Link1c</a></li>
        </ul>
    </li>
    <li><a href="#">Link2</a>
        <ul>
            <li><a href="USEPCreate.html">Link2a</a></li>
            <li><a href="USEPUpdate.html">Link2b</a></li>
            <li><a href="USEPRecovery.html">Link2c</a></li>
        </ul>
    </li>
</ul>

CSS

ul > li { width:100px; float:left; }
ul > li > ul { display:none; }
ul > li:hover > ul { display:block; }
ul > li > ul { padding-left:10px; }

View the code on http://jsfiddle.net/ChvjL/10/

Answer №2

Do you mean that if someone hovers over the provided link, another link will appear?

Here's an example you can look at for reference. It's quite similar, you just have to update the content:

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

Create a React component using Material UI that remains fixed at the top of the page when scrolling, without being

My AppBar is working fine without using sticky, but I need the element on my page to stick at the top when the user scrolls. I found a solution that seems to work here: https://www.w3schools.com/howto/howto_css_sticky_element.asp However, in my React page ...

Is it possible to insert items into Vue component data? I'm interested in creating a table following JavaScript filtering and manipulation

I'm working on a website that will have multiple pages, each containing tables. To streamline this process, I wanted to create a table component. However, I haven't added any data to the tables yet because I need to manipulate it using JavaScript ...

Generate an error upon submission if a particular checkbox is chosen from a group of checkboxes

To prevent form submission and display an error message if checkbox id="check1" is selected, follow the code below: <form name="form1" method="post" action=""> <span id="group"> <input type="checkbox" name="check1" id="check1" ...

Is there a way to execute code right before the jQuery submit() function is run?

I'm currently facing an issue with executing codes before a validation function runs in my form. I have tried different methods including referring to How to order events bound with jQuery, but without success. This is the code snippet I am working w ...

AngularJS Jasmine test failure: Module instantiation failed

Everything was running smoothly with my angular app and tests using karma and jasmine. However, after adding a dependency in ui.bootstrap, my app continues to function as expected but now my tests won't run. Here is what I have: app.js - added depend ...

Encountering a 400 bad request error when attempting to utilize AJAX within a WordPress environment

I am encountering a 400 error while attempting to retrieve the response from WordPress AJAX. Despite multiple attempts, I have been unable to pinpoint the root cause of the issue. The jQuery version being used is 3.6 and the filter.js file appears to be fu ...

"Encountered an issue with ng-annotate during processing

I'm attempting to utilize ng-annotate on my Angular application, but it seems to be not working at all. Here is the configuration part: (function () { 'use strict'; angular.module('app') .config(/*@ngInject*/ ro ...

Unlock the power of Bootstrap CDN with these easy steps!

I am currently trying to incorporate a CDN for Bootstrap in order to enhance the performance of my website. Surprisingly, directly referencing the CSS works perfectly fine but using the CDN does not. Could someone provide me with guidance on how to resolv ...

The getStaticProps() function in next.js isn't retrieving items as expected

I've been facing issues while trying to load items onto my next.js page: import {getadminInfo} from '../../dataFetch/adminInfo' import {addItem} from '../../dataFetch/catalog' import {useState} from "react" import { getLi ...

Align content distributed evenly will not display a division

I am currently using React to code and learning by doing so. I have two different images displayed, each followed by a div element with a height of 20px and a brown background color. I have set the height to "100%" and justifyContent to "space-between", bu ...

Error message: "The variable 'bitmap' is not defined in jQuery/CreateJS $.ajax"

I recently acquired a product designer that uses CreateJS and jQuery. Within the code, there is a function called UrlLoader which wraps an $.ajax call. function UrlLoader(params) { $.ajax({ url: url, type: 'POST' ...

Angular static dropdown option

<input [formControl]="twitterHandle" id="twitterHandle" placeholder="twitterHandle"> Fetching the input value from the Twitter handle input field using the following code: twitterHandle = new FormControl(); this.twitterHandle.value; Similarly, if ...

How can I send data in JSON format to a JavaScript AJAX request?

I've created a method that looks like this: public String getUTResult() throws IOException { BuildResultParser bp = new BuildResultParser(); BuildResultBean b = bp.getreadFile("C:\\bc.txt"); String str = b.getuTresult(); ...

The "Go" button on iPhone triggers an error before the page is sent back

I am facing an issue with a web page that has a form containing multiple submit buttons with different functionalities like clearing the form, performing a calculation, or adding another entry line. The problem arises only on iPhone devices (tested on bot ...

Mongoose - Child Subdocument with References to Parent Schema

Could a Mongoose Schema be structured similar to this example: var categorySchema = new Schema({ name : String }); var childSchema = new Schema({ name : String, category : { type : Schema.Types.ObjectId, ref : 'parent.categori ...

What HTML template is your go-to when starting a new project?

Is this the ultimate solution for creating a basic "Hello World" HTML template? I have been experimenting with this starter code to develop simple websites. Are there any other interesting tags I could incorporate to enhance it further? Usually, I refer ...

When running collection.find().toArray(callback) in node.js with mongodb, the result is coming back

When I run my code, mydocuments.find({}).toArray is returning empty. I have seen some solutions posted but they don't apply to my situation since I am using MongoClient.connect. Any help would be greatly appreciated. var MONGOHQ_URL="mongodb://harish ...

Is it possible to modify the dropdown menu so that it opens on the right side instead of using a select tag?

Is there a way to make the drop-down from the select tag open to the right side(drop-right)? <label for="ExpLabel">Select Message Expiry:</label> <select name="ExpSelect" id="Expiry"> <option value="ExpiryDate">1 Day</opt ...

Nodejs cron application

Currently, I have set up Cronjobs for server-side scheduling tasks. However, I now require a graphical interface that allows me to manage, add, and remove tasks easily. What is the most efficient approach to achieve this? I am seeking suggestions or idea ...

Experiencing issues with references while trying to import tone.js

I am facing an issue with my express.js server setup on my Mac. I am trying to incorporate Tone.js, which can be found at , following the provided instructions. npm install tone To integrate Tone.js successfully: import * as Tone from 'tone' Ho ...