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 7903529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:46:13+00:00 2026-06-03T09:46:13+00:00

I am trying to apply opacity effects to a whole form when it is

  • 0

I am trying to apply opacity effects to a whole form when it is either hovered over or an input box is clicked while the mouse has left hover so that effect does not disappear.

At the moment I have the following html:

<form id="search">
    <input id="search-input" type="text" value="Search" />
    <input id="search-submit" type="submit" value="" />
</form>

And this jQuery:

$('form#search').hover(function() { 
    $(this).stop().animate({"opacity": 1}); 
},function() { 
    $(this).stop().animate({"opacity": 0.6}); 
});

At the moment it only works when you however over and not if the #search-input is clicked while the mouse is elsewhere on the screen, how can I add this final part?

This is not possible to do with CSS3 because you can’t apply the opacity affect to the whole form when only an input is focused as there is no parent selector.

Pseduo Code Final Goal

$($('form#search').hover(), $('form#search input').focus()).functionOn(){
    $('form#search').stop().animate({"opacity": 1}); 
}, functionOff(){
    $('form#search').stop().animate({"opacity": 0.6}); 
});
  • 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-06-03T09:46:14+00:00Added an answer on June 3, 2026 at 9:46 am

    The code should work pretty well in getting the job done. This also handles for if someone mouses out while they are currently editing an input, and if you are editing an input then click into another “fadeable” div, it should then make the proper transition to the new “fadeable” div.

    Only thing missing is your animations, but I think you could change up the addClass/removeClass to your animate, and you should be good to go.

    This took some time, so hopefully it helps!

    http://jsfiddle.net/vpz2S/

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

Sidebar

Related Questions

I'm trying to apply a CSS mask to an element that also has child
I am trying to apply a box shadow to an img element and I
While trying to apply policy-based design, I got stuck on this one (simplified): template
I'm trying to apply a box-shadow on all four sides. I could only get
I'm trying to apply jQuery UI autocomplete to three input boxes at the same
I'm trying to apply a style to a combo box but instead of getting
I am trying to apply TDD for the first time with a Form for
Im trying to apply different background color to even and odd items in a
im trying to apply this JSON code to my Google Map: [ { stylers:
I'm trying to apply a DataTrigger to a Button and it depends on a

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.