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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:31:36+00:00 2026-05-26T11:31:36+00:00

Not the best with jquery, can someone suggest a general approach for what i

  • 0

Not the best with jquery, can someone suggest a general approach for what i am trying to achieve please? I have a grid of photos, and when they are clicked on, an opaque overlay will be animated on top of the entire picture, the overlay will contain some dynamically set text. I have the images, and the onclick handler working, just trying to figure out the best way to apply the overlay. thanks

  • 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-26T11:31:37+00:00Added an answer on May 26, 2026 at 11:31 am

    Not very pretty semantically, but should get the job done :
    Let’s say your imgs are 200×200.

    <div class='imgcontain'>
    <img src='yourimg' alt='' width='200' height='200'>
    <p>Your text>/p>
    </div>
    
    <div class='imgcontain'>
    <img src='yourimg' alt='' width='200' height='200'>
    <p>Your text>/p>
    </div>
    
    <div class='imgcontain'>
    <img src='yourimg' alt='' width='200' height='200'>
    <p>Your text>/p>
    </div>
    

    // etc…

    Then, the CSS :

    .imgcontain
    {
    position: relative;
    width: 200px;
    height: 200px;
    overflow: hidden; // not sure you want to makes the overlay just show or slide from top. This is useful only if it should slide.
    }
    
    .imgcontain img
    {
    position: absolute;
    width: 200px;
    height: 200px;
    top: 0px;
    left: 0px;
    z-index: 2;
    }
    
    .imgcontain p
    {
    position: absolute;
    display: block;
    width: 200px;
    height: 200px;
    top:  0px; // if slide from top, -200px
    left: 0px;
    background: rgba(0,0,0,0.5) // or a background image like a transparent png with repeat
    z-index: 1;
    }
    
    .imgcontain:hover p
    {
    z-index: 3; // if slide from top, top: 0px
    }
    

    This is a pure CSS solution, without animation, works for users with Javascript of.

    If you want then to animate it using Jquery :

    $(.imgcontain p).hide().css('z-index','3'); // on ready, hide the overlay. Maybe throw the .css() in callback.
    

    then, on click/mouseover

    $(.imgcontain).click(function()
    {
    $(.imgcontain p).show();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

it's 3 am right now and I'm not the best at jquery, can someone
Hey everyone, I'm not the best at Jquery debugging, so I was hoping someone
I'm not the best at this jquery stuff. But I'm trying to seperate the
From what I have understood, it is not the best way to open a
I am trying to achieve a JQuery AJAX call to a controller action method
I'm after some help with jquery. Can some one tell me the best way
I'm not the best when it comes to CSS to here goes. I'm trying
Whats the best approach for jquery realtime validation checking? Onsubmit the span with each
I have a problem with jquery not loaded in an asp user control. I
I'm new to JQuery. I'm not looking necessarily for code -- just someone 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.