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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:54:09+00:00 2026-06-05T02:54:09+00:00

I am using a hack to make a file upload input display the same

  • 0

I am using a hack to make a file upload input display the same across browsers. The trick is to basically set the opacity of the upload input to zero, and position a regular input overtop of it, with custom styling. After the user uploads a file, I am using jquery to grab the value of the filename and to store it in the input that is above it (the fake input).

My Jquery is:

    var browse = $("#browse");

    $('.wpcf7-file').on('change', function(){
            $('#fakeUpload').val(this.value).css({'background':'#f1f1f1', 'text-indent':'72px'});
            browse.css('backgroundPosition' , '5px -60px');
    });

    $("input.wpcf7-file").hover(function(){
        browse.css('backgroundPosition' , '5px -28px');
    }, function(){
        browse.css('backgroundPosition' , '5px 4px');
    });

As you can see, there are two things being done here: taking a value from the .wpcf7 input and storing it as the value of #fakeUpload. The div, browse is more or less a button that indicated the status of the upload. After the user selects the file, the browse button goes to an inactive state.

The problem is after the user goes to this “inactive state”, the hover effect below it still remains active. After the use uploads the file (on change of input) I want to disable all hover effects. What is the best way to go about this?

If you need to see my html/css let me know, but I figured it is pretty straightforward jquery question.

  • 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-05T02:54:11+00:00Added an answer on June 5, 2026 at 2:54 am

    I think this may work for you:

    var browse = $("#browse");
    
    $('.wpcf7-file').on('change', function(){
            $('#fakeUpload').val(this.value).css({'background':'#f1f1f1', 'text-indent':'72px'});
            browse.css('backgroundPosition' , '5px -60px');
            $("input.wpcf7-file").off("mouseenter ").off("mouseleave")
    });
    
    $("input.wpcf7-file").hover(function(){
        browse.css('backgroundPosition' , '5px -28px');
    }, function(){
        browse.css('backgroundPosition' , '5px 4px');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using a hack to make the file input appear consistent across all
I'm using subdomains in django for user pages via a middleware hack in a
I've been using Eclipse ${project_name} variable as a configuration class hack to determine which
What is your opinion of using the infix operator hack in production code? Issues:
Using PyGtk's IconView, I can set the icons to be reorderable by calling gtk.IconView.set_reorderable(True)
Using Java,I have to fetch multiple sets of values from an XML file to
Using MVVM. I have a DataTemplate which I am using to display an expander
Is using more than one <strong> tag actually make the word stronger? i.e. is
I'm using Visual Source Safe 6.0d (work requirement) and I've been trying to hack
I'm using Django 1.2. I would like to make a model with 3 fields,

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.