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

  • SEARCH
  • Home
  • 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 230447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:51:00+00:00 2026-05-11T19:51:00+00:00

I am currently working on my portfolio website which uses a very simple navigation.

  • 0

I am currently working on my portfolio website which uses a very simple navigation.
However what I want to do is have the drop shadow beneath the type become stronger (read: higher opacity/ darker) when the type is being hovered on.

Right now my code looks as follows and does not generate any errors but simply does not do anything either.

For a good understanding of what I mean please have a look at the website with a live example.

/* Work | Play | About | Contact */
/* Shadow Opacity */
$(document).ready(function() {
    $('#workShadow', '#playShadow', '#aboutShadow', '#contactShadow').fadeTo( 0, 0.1);
});

/* Shadow Hover effect */
$(document).ready(function() {
    $('a#work').hover(function() {
        $('#workShadow').fadeTo( 200, 0.5);
    }, function() {
        $('#workShadow').fadeTo( 400, 0.1);
    });
});

/* Type movement on hovering */
$(document).ready(function() {  
    $('a.shift').hover(function() { //mouse in  
        $(this).animate({ paddingTop: 85, paddingBottom: 2 }, 200);  
    }, function() { //mouse out  
        $(this).stop().animate({ paddingTop: 75, paddingBottom: 12 }, 400);  
    });  
});

Basically I need the opacity of the shadow elements (4 individual ones) to start at 10% opacity and while the user hovers, the type moves down (this part is working) and simultaneously the shadow becomes stronger, increases to 60% opacity. Then revert back to 10% when on mouseOut.

  • 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-11T19:51:01+00:00Added an answer on May 11, 2026 at 7:51 pm

    This line is wrong – it is passing a bunch of arguments to the $() function.

    $('#workShadow', '#playShadow', '#aboutShadow', '#contactShadow').fadeTo( 0, 0.1);
    

    As the documentation notes, jQuery doesn’t expect N arguments as a selector, but 1:

    $('#workShadow, #playShadow, #aboutShadow, #contactShadow').fadeTo( 0, 0.1);
    

    It is common (and good) practice to give a set of objects that should do something a common class or to select them in a smarter than just listing all their IDs. Based on your current HTML, this selector gets all the shadow <div>s in the menu, and is much shorter – you won’t have to modify your code if you add a new menu element later on, for example:

    $('div','#navigationFrame').fadeTo(0, 0.1);
    

    I also see you have this:

    <li id="work"><a id="work" ...>
    

    This is really, really, wrong. IDs should be unique in the document. By having more than 1 ID in the document not only are you breaking best practices, ID selection on jQuery will go crazy and won’t work as expected. Like the fadeTo selector, you can change the shadow changing code to a cleaner:

    $('a','#navigationFrame').hover(function() {
        $(this).next('div').fadeTo(200, 0.5);
    }, function() {
        $(this).next('div').fadeTo(400, 0.1);
    });
    

    I tested the website with these changes and it works fine.

    What the selectors in my examples are doing is taking advantage of jQuery’s context. By doing this:

    $('a','#navigationFrame');
    

    Or this:

    $('div','#navigationFrame');
    

    We are telling jQuery “only give me the <a> (or <div>) elements inside #navigationFrame.

    It is equivalent to this:

    $('#navigationFrame').find('a');
    

    It is a good idea to take advantage of this. I see you have a tendency to manually list the elements you’re trying to do stuff to do even if they are all similar in some way. Try to shake this habit and let jQuery’s powerful selectors get what you want from the document.

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

Sidebar

Related Questions

Currently working on something which uses ajax for some pagination. What I'm looking to
I`m currently working out the design for simple graphic editor, who support trivial operations
Im currently working with an API which requires we send our collection details in
I`m currently working on a script, and I have the following situation. function somnicefunction()
My website currently uses a custom jQuery gallery system that I've developed... it works
Im currently working on a site which will contain a products catalog. I am
Im currently working on a c# project that uses another .net library. This library
im currently working in a simple program that implements plugins whith dll libraries (using
I'm currently working on my new portfolio you can see here: http://katharinakoeth.de/neu/ And there's
Currently working on a 3D media engine using C# and I have come across

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.