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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:06:56+00:00 2026-06-17T10:06:56+00:00

On the page i have multiple thumbs images, each has it’s own id, generated

  • 0

On the page i have multiple thumbs images, each has it’s own id, generated by php.

I need to do the jQuery animation for each element.

I’m stuck here, how i can detect witch thumb_id-?? the user is hovering, and animate it?

I know i can do two simple js function for onmouseover/out and pass the id.. but there is another method of doing it with jQuery?

<script>
$(document).ready(function(){
    $('#thumb_id- ??? ').mouseover(function(){
                div = $('div.thumb-img-hover');
                div.animate({opacity: '1'}, 150);
    }).mouseout(function(){
                div.animate({opacity: '0'}, 150);
    });
});
</script>

foreach($arr as $val){
    echo '  
    <a class="group1" text="TESTING" title="" href="'.$baseurl.'uploads/'.$val["filename"].'">
    <div class="thumb-img-container right">
    <div class="thumb-img" style="position:relative;background:url(\''.$baseurl.'uploads/thumbs/'.$val["filename"].'\') no-repeat center center;background-size: cover;">
    <div id="thumb_id-'.$val["id"].'" class="thumb-img-hover"><a href="'.$baseurl.'index.php?action=image&id='.$val["id"].'">test</a></div>
    </div>
    </div>
    </a>
    ';
}
  • 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-17T10:06:57+00:00Added an answer on June 17, 2026 at 10:06 am

    You can use attribute starts with selector, $('div[id^=thumb_id]'), but why not using class selector?

    $(document).ready(function(){
        $('div.thumb-img-hover').mouseenter(function(){
             $(this).stop().animate({opacity: '1'}, 150); // this refers to the current element
        }).mouseleave(function(){
             $(this).stop().animate({opacity: '0'}, 150);
        });
    });
    

    You can also use CSS:

    div.thumb-img-hover {
       opacity: 0.5;
       -webkit-transition: opacity 150ms;  
       -moz-transition: opacity 150ms; 
       -o-transition: opacity 150ms;  
       transition: opacity 150ms;
    }
    div.thumb-img-hover:hover {
        opacity: 1;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page that displays multiple Formsets, each of which has a prefix.
I have multiple forms on a page, for each of them I want the
I have multiple ajax forms on page that cointain same elemets, I have jquery
So i have a page that is gonna have multiple modal popups. Each one
i have an html page where i have multiple checkboxes each of them are
I have multiple iframes on my page and this jQuery replaces them all with
On a page I have multiple Jquery UI Sliders that fade out/in the opacity
I have multiple input fields on my page. I Regex them with a css
I have multiple datepickers in one page. I user class name to set the
I have multiple menues on my page... <div class=menu> <div>Menu header</div> <div>Menu content</div>// should

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.