Creating a social media icon effect similar to Squarespace: A step-by-step guide

I am attempting to create social icon effects similar to those found on Squarespace for my project.

You can see examples of what I mean by visiting:

If you look at the social icons, when you hover over one icon, the others become transparent or turn grey. Does anyone know how to achieve this effect?

This is how the icons appear normally, without hovering over them with the cursor

When hovering over an icon, like Twitter for example, all the other icons fade out to a lighter color instantly

Answer №1

To achieve this using CSS, you can use the following code:

ul:hover li {
  opacity: 0.5;
}

ul:hover li:hover {
  opacity: 1;
}
<ul>
  <li>1</li>
  <li>2</li>
  <li>3</li>
  <li>4</li>
</ul>

Answer №2

Give this a Shot:

$(document).ready(function(){
    $("a").hover(function(){
        $('a').css('opacity',0.5);
        $(this).css('opacity',1);
    },function(){
        $('a').css('opacity',1);
    })
}) 
a {
    color: #000;
    margin-right:5px;
    transition: all 300ms;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>    
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">  
<a href="#"><i class="fa fa-twitter" aria-hidden="true></i></a>
<a href="#"><i class="fa fa-instagram" aria-hidden="true></i></a>
<a href="#"><i class="fa fa-linkedin" aria-hidden="true></i></a>

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

Utilizing a Python script within a Django project

I am a beginner in Django and HTML and I am looking to incorporate the following code into my Django project: import csv with open('FILE.csv', newline='') as csvfile: CSV_DATA = list(csv.reader(csvfile)) df = pd.DataFrame(CSV_DATA ...

How can you use JavaScript to retrieve the position of an element on a webpage?

As mentioned in the title, I am looking for a way to retrieve the x and y positions of an element relative to its location on the webpage and based on its positioning schemes such as absolute or relative. ...

How can I limit the impact of range with jQuery?

<table> ... </table> <script type="text/javascript"> $(selecctor).click(...) </script> The content above is meant to be dynamically loaded using ajax. My objective is to limit the scope of the selector so that it only impacts the ...

What causes additional method calls in an element's attributes to be triggered when using ng-click in AngularJS?

Currently delving into the world of angularJS, I find myself perplexed by the scenario where multiple methods are triggered even though only one is explicitly called. The line in question looks like this: <li ng-repeat="i in names" style="position: re ...

Track the number of visits originating from email links with query strings

Our strategy involves sending follow-up emails regarding our products, and I am interested in monitoring their effectiveness. This is my proposed approach: To measure the impact of these follow-up emails, I plan to update the URL in the email hyperlink t ...

Should Errors be Handled in the Service Layer or the Controller in the MVC Model?

Currently, I am in the process of developing a Backend using Express and following the MVC Model. However, I am uncertain about where to handle errors effectively. I have integrated express-async-errors and http-errors, allowing me to throw Errors anywher ...

Changes in a portion of the state for Vaadin's AbstractJavascriptComponent

I am currently working on implementing a JavaScript-based component for Vaadin that will be responsible for displaying and updating a large data set. To achieve this, I am extending AbstractJavaScriptComponent. My goal is to keep the JavaScript side as si ...

Unable to display remote image source in PhoneGap

Trying to accomplish a simple task here. I aim to showcase an image hosted on a remote server in my phonegap app, but despite my best efforts, I haven't been successful. • Experimented with using an absolute file path in the image tag within the HT ...

Modify HTML button text after successful action

I need help with toggling the content of an HTML button (activate or deactivate) when clicked. I want the button to change from "Activate" to "Deactivate" and vice versa, using AJAX. Here is my code: <button type="button" class="btn btn-success btn-sm" ...

Is there a way to set columns as initially hidden in MaterialTable?

I have a MaterialTable with many columns, and some of them are not always necessary to display. I am looking for a way to hide these columns unless the user specifically selects them. I attempted to use the hidden: true property in the column configuratio ...

Forge: Securely encrypting massive files

I rely on the forge framework for implementing PGP functionality, specifically for encrypting large files (2gb or larger) while minimizing RAM usage. What would be the most efficient approach to achieve this? ...

What is the best way to create a box-shadow with an inset effect and a touch of

Looking to dive into the world of css3 design and wondering how to achieve a box-shadow inset with a touch of transparency. Check out the example in this fiddle link: http://jsfiddle.net/TeGkt/4/ Any ideas on how to replicate this effect without relying ...

Utilize Javascript to Populate Form Fields Based on "Selected Name"

I am currently facing a challenge in using javascript to automatically populate a form, specifically when it comes to setting the value for the country field. <form action="/payment" method="post" novalidate=""> <div class="input_group"> ...

Tips for successfully passing an object via a Link

I am trying to pass an object through a Link component in react-router v6. Can someone please guide me on how to achieve this? Below is a snippet of my code where the user should be directed to another component. import React from 'react' import ...

Executing all promises later in Node.js using Promise.all

Having a series of promises set up as follows: module.exports = function (a, b, c) { return someAsync(() => { someFunc(a); }) .then(() => myPromises(a, b, c)) .then(result => { console.log(&apos ...

Tips for applying a jQuery class when the page is both scrolled and clicked

As I work on building a HTML website, I encountered an interesting challenge. I want to create a dynamic feature where, as users scroll through the page, certain sections are highlighted in the navigation menu based on their view. While I have managed to a ...

Connect the B-Button to an input file using BootstrapVue

I am attempting to create an input file button within a v-for loop without using the b-form-file tag. Despite trying various solutions, none of them have worked for me. Here is the code I have so far: <b-button @click="selectFile()" variant=& ...

Using ajax to retrieve and refresh data

I need to perform real-time updates to a column in my table and display the updated data instantly. Here is the code I am using: <html> <body> <div id="output"></div> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3. ...

Tips for dynamically changing the color of a React Native style based on data conditions

Just starting with react native. I'm working on a basic quiz feature for my app. I've created an api that provides questions, answers, and a boolean value indicating the correct answer, Something like this : { "question:"Demo quest ...

When using i18next interpolation in React components, the displayed output may show as [object Object]

In my React application, I am utilizing the next-i18next package. I want to include a React component within my interpolation: import React from 'react'; import { useTranslation } from 'next-i18next'; import { serverSideTranslations } f ...