Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3232902
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:12:54+00:00 2026-05-17T17:12:54+00:00

I am slowly learning how to modify and write jQuery from scratch and have

  • 0

I am slowly learning how to modify and write jQuery from scratch and have been trying to modify some pre-written code, which simply makes an image opacity: 1 and all other images in the same HTML element opacity: 0.2.

When I use fadeTo and I move across the images fast it will stop doing the animation and hang for a while until it fixes itself. Could anyone advise on this situation.

Sorry for being a bit vauge 🙂

Here is the code:

$(window).load(function(){
var spotlight = {
     // the opacity of the "transparent" images - change it if you like
    opacity : 0.2,

    /*the vars bellow are for width and height of the images so we can make
    the <li> same size */
    imgWidth : $('#portfolio ul li').find('img').width(),
    imgHeight : $('#portfolio ul li').find('img').height()

};

//set the width and height of the list items same as the images
$('#portfolio ul li').css({ 'width' : spotlight.imgWidth, 'height' : spotlight.imgHeight });

//when mouse over the list item...
$('#portfolio ul li').hover(function(){

    //...find the image inside of it and add active class to it and change opacity to 1 (no transparency)
    $(this).find('img').addClass('active').fadeTo('fast', 1);

    //get the other list items and change the opacity of the images inside it to the one we have set in the spotlight array
    $(this).siblings('li').find('img').fadeTo('fast', 0.2);

    //when mouse leave...
}, function(){

    //... find the image inside of the list item we just left and remove the active class
    $(this).find('img').removeClass('active');

});

//when mouse leaves the unordered list...
$('#portfolio ul').bind('mouseleave',function(){
    //find the images and change the opacity to 1 (fully visible)
    $(this).find('img').fadeTo('fast', 1);
});

});

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T17:12:55+00:00Added an answer on May 17, 2026 at 5:12 pm

    Use the hoverIntent plugin. It allows you to set a small configurable delay after which the hover is triggered and not just if you move your mouse over elements really fast.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been slowly learning SQL the last few weeks. I've picked up all
We have a production machine and are trying to slowly introduce some 3.0 and
I have been slowly learning iPhone development and seem to keep hitting walls where
I've been slowly learning Ruby (at this point, maybe the first language I've invested
I'm slowly learning Objective-C and Cocoa, and the only way I see so far
I've been slowly working on a personnel project to run a webmud like game
I've been slowly working my way through the list of Project Euler problems, and
We are slowly rolling out team foundation, and I have to get up to
Over the years I have slowly developed a regular expression that validates most email
I have a page that renders slowly. The trip across the net is quick.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.