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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T22:13:04+00:00 2026-06-18T22:13:04+00:00

I have these 2 functions to create opacity effect <script> function trans(id) { $(.pris_+id).stop().fadeOut(1000);

  • 0

I have these 2 functions to create opacity effect

<script>
    function trans(id)
    {
       $(".pris_"+id).stop().fadeOut(1000);
       $(".pris_"+id).css({ opacity: 0.1});
       stop();
    }

    function trans_reverse(id)
    {
       $(".pris_"+id).stop().fadeIn(1000);
       $(".pris_"+id).css({ opacity: 0.8});
       stop();
    }
</script>


<div id="productos_image_soon" class="pris_1"    onmouseover="trans('1');"onmouseout="trans_reverse('1');">
   Product in a few time
</div>

Into the div i call each function , the problem is when i put mouseover the div all time and in recursive mode the second function execute and after the first function and continue executed , the effect is when mouseover the opacity low and when mouseout opacity grow

Working ….. here jsfiddle.net/dSesq/

I don´t know why this happens, I’ve tried the stop() function but the problem continues

  • 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-18T22:13:05+00:00Added an answer on June 18, 2026 at 10:13 pm

    It makes no sense why you are setting the opacity of the element after fading it in. Use fadeTo!

    function trans(id, opacity) {
        $(".pris_"+id).stop().fadeTo( 1000, opacity);
    }
    

    And you should probably use mouseenter and mouseleave. Also you are going to get weird results having the mouse over an element that is going to disappear.

    Your code could be written as

    $(".trigger").on("mouseover mouseout", function(evt){
        var opacity = evt.type=="mouseover" ? 1 : .8;
        $(this).stop().fadeTo(1000, opacity);    
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have in my javascript these 2 functions classes: // product class function Product()
So, I have these two functions ref() and pointy() that respectively create a local
I do not understand the following example, let's say I have these functions: #
I have these two functions (with Point2D & LineVector (has 2 Point2D member variables)
Alright this is my first day with JQuery so have fun with these functions
I have made a map of functions. all these functions are void and receive
I have looked at the documentation on MSDN about these 2 functions. However, I
I have a web application with multiple WARS. These WARS all perform different functions
I have 3 function in my class B. These three function have to access
i have custom cell with 2 buttons(the function of these buttons is just to

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.