Creating a hover effect for a menu simulation

I've created a menu with a special CSS effect that blurs each item on hover:

    {<style>
a.blur
{
text-decoration: none;
color: #128;
}

a.blur:hover, a.blur:focus
{
    text-decoration: underline;
    color: #933;
}

.textshadow a.blur, .textshadow a.blur:hover, .textshadow a.blur:focus
{
    text-decoration: none;
    color: rgba(0,0,0,0);
    outline: 0 none;
    -webkit-transition: 100ms ease 50ms;
    -moz-transition: 100ms ease 50ms;
    transition: 100ms ease 50ms;
}

.textshadow a.blur,
.textshadow a.blur.out:hover, .textshadow a.blur.out:focus
{
    text-shadow: 0 0 4px #989898;
    font-size:24px;
}

.textshadow a.blur.out,
.textshadow a.blur:hover, .textshadow a.blur:focus
{
    text-shadow: 0 0 0 #000;
}
</style>}

Now, when you hover over an item, it becomes blurred. My question is, is there a way to make all other items blur when one is hovered over? I don't want all the items to be blurred initially, just when they are not the focus. When an item is no longer being hovered, all should return to their normal state.

Thank you!

Answer №1

If you're searching for information on how to create mouseover events using jQuery, you may want to check out the following resource:

By utilizing these events, you can customize the appearance of an element. For instance, the tutorial provides this example:

$("div").mouseover(function(){
    $("div").css("border-color", "blue");
});

Your specific implementation might resemble something like this:

$("button").mouseover(function(){
    $("html").css("font-size", "16px");
});

I don't have much experience with the blur style properties, but I hope this guidance proves useful for your needs.

Answer №2

Yes, absolutely! Using jQuery makes it so easy.

Check out the demo on jsFiddle: http://jsfiddle.net/9zqsk235/

$('ul li').on('mouseover',function(){
    $('ul li').not($(this)).css('text-shadow',' 2px 2px #989898');
})

$('ul li').on('mouseout',function(){
    $('ul li').not($(this)).css('text-shadow','none');
})

If you're new to jQuery, the code might seem a bit mysterious at first, but once you grasp it, it feels like reaching enlightenment.

In simple terms, each li element has a hover listener. When hovering over one, all other li elements will appear blurred. The same applies when moving the cursor away from them.

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

React - Attempted to access properties of an undefined object

Within my component, I am passing an object named SelectedMovie as a prop. This SelectedMovie object contains an attribute called moviePoster which is itself an Object with an attribute called imageUrl. However, when trying to render the imageUrl attribut ...

Execute the script before the Vue.js framework initiates the HTML rendering

In order to determine if the user is logged in or not, and redirect them to the login page if they are not, I am looking for a way to check the user's login status before the HTML (or template) loads. I have attempted to use beforeCreate() and variou ...

Initiate the function one time

The Introduction: I need assistance with a form that triggers a jQuery function when a button is clicked. The issue arises after the initial execution, as the function continues to run one more time. My dilemma is figuring out how to ensure that the funct ...

implementing the CSS property based on the final value in the loop

I have created multiple divs with a data-line attribute. I am trying to loop through each div, extract the individual values from the data-line attribute, and apply them as percentages to the width property. However, it seems to only take the last value an ...

Utilizing an EllipseCurve for Extrusion Paths in Three.js - How is it Done?

The issue: I'm struggling to convert an EllipseCurve into a path that can be extruded along in Three.js. When I try to use the EllipseCurve as the extrude path, nothing shows on the screen even though there are no errors. However, if I switch it to a ...

Sliding down a hidden div using Jquery causes it to jump to the top of the

Whenever I click a link, a hidden div slides up or down, but it keeps taking me back to the top of the page, forcing me to scroll all the way down again... I've heard that I need to set a fixed height, but my content is constantly changing so that&ap ...

Display a variety of images all in one slider page effortlessly with the ngb-carousel feature

I'm currently utilizing Angular 6 and ng-bootstrap to implement a carousel feature on my website. Although the carousel is functioning correctly, I am facing an issue where only one image is being displayed in each slide instead of four images per sl ...

Troubleshooting Bootstrap 4 Button Alignment on the Right

I am a newcomer to Bootstrap 4 and I am in the process of creating a straightforward page with it. Within my navigation bar, I have successfully added a logo and company name on the left side. However, I am encountering difficulty in placing two buttons on ...

Looking for a solution to fix the VueJS calculator that only works once?

My calculator project using VueJS, HTML and CSS is almost complete. However, I'm facing an issue where it only works once. For example, if I input 6x3, it correctly gives me 18. But if I then clear the result and try to input a new calculation like 3 ...

retrieve a string value from a function within a ReactJS component

I am facing an issue with returning a string from a function. Here is the function I am using: const getImage = (name) => { const imageRef = ref(storage, name); getDownloadURL(imageRef).then((url) => { return url; }); }; Even tho ...

Unlocking the Power of Dynamic Title Text in Your Content

Recently, I came across a tooltip code on Stack Overflow which I have been using. The issue I am facing is that the text in the title section is hardcoded and I need to customize it for different labels. How can I modify the code to make it flexible enough ...

403 error: jQuery Ajax POST denied

I'm encountering an issue while trying to execute a simple ajax post using jQuery: $.ajax({ type: 'POST', url: "ucUploadDownloadCommand.ascx/UploadXLSFile", data: "{}", dataType: 'json', contentType: "application/json; c ...

Prevent touching the pseudo content of an element

My issue involves a toggle button component where I have utilized the ::before pseudo class to add text. The problem arises when clicking on the text within the toggle button causes the button's state to change. How can this be prevented? Here is the ...

Can you explain how the Facebook Like button code functions and how I can create a similar feature on my own platform?

I have a website with 250 different items, each containing its own Like button using the standard Facebook "Like" code: div class="fb-like" data-href="http://www.mywebpage.com/myproductpage" data-send="false" data-layout="button_count" data-width="80" dat ...

Can someone please guide me on how to transfer information from a material ui datagrid Row to a form input?

I need assistance. I have a table that holds user data and I want to create a functionality where clicking on the edit button opens a dialogue box with a form pre-filled with the user's initial data. However, I'm currently only able to pass the u ...

When decoding a JWT, it may return the value of "[object Object]"

Having some trouble decoding a JSON web token that's being sent to my REST API server. I can't seem to access the _id property within the web token. Below is the code I'm currently using: jwt.verify(token, process.env.TOKEN_SECRET, { comp ...

What are some ways to incorporate table pagination with next and previous buttons utilizing jQuery and Bootstrap?

Currently, I have a bootstrap table that contains 79 rows, but I am only displaying 10 rows at a time with the help of pagination. I have successfully implemented the pagination feature, but now I am looking to add previous and next buttons. How can I im ...

Organizing my website directories using external tools

I am dealing with a website that follows this specific structure: \ |--css | \ | |--vendors | | \ | | |--normalize.css | | |--... | | | |--styles.css | |--media-queries.css | |--js | \ | |--vendors | | \ | | |- ...

I find it confusing how certain styles are applied, while others are not

Working on my portfolio website and almost done, but running into issues with Tailwind CSS. Applied styling works mostly, but some disappear at certain breakpoints without explanation. It's mainly affecting overflow effects, hover states, and list sty ...

Building on Angular 7, generate a fresh object by extracting specific values from an existing object

My object structure is as follows: const Obj = "Value1": { "value1value": "1" }, "Value2": { "value2value": "2" }, "Value3": { "value3value": "3" }, "BTest": { "1": "1", "2": "2" }, "Value4": { "value4value": "value4value" }, "ATes ...