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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:08:39+00:00 2026-05-16T06:08:39+00:00

I have a problem as the topic name says: Lets say i have gallery

  • 0

I have a problem as the topic name says: Lets say i have gallery on site with 4 photos, they have set z-index for all images in this div. Anyways, i’d like to make my action of enlarging clicked image, to force z-index of rest of images go down (because i’m using fading in black background as part of image view)

Thanks in advance

<div id="main">
    <div id="masthead">
        <a href="#">click</a> </div>
    <div id="top_nav">
        <a href="http://www.google.pl">Start</a> <a href="http://www.google.pl">
        Opis</a> <a href="http://www.google.pl">Projekty</a>
        <a href="http://www.google.pl">Zdjecia</a>
        <a href="http://www.google.pl">Linki</a> <a href="http://www.google.pl">
        Kontakt</a> </div>
    <div id="content">
    <div id="textfield"> <p>Profesjonalny web design. </p>
    <span id="left"><a href="#">&#8592;</a></span>
    <span id="right"><a href="#">&#8594;</a></span>
    </div>
    <img id="second" src="model.jpg" alt="model" />
    <img id="third" src="model.jpg" alt="model" />
    <img id="fourth" src="model.jpg" alt="model" />
    <img id="first" src="model.jpg" alt="model" />
    </div>
    <div id="box"></div>
</div>
<div id="blackb"></div>

css

body {
    margin: 0;
    padding: 0;
    font-family: Verdana;
    background: silver url(bodygrad2.jpg) fixed;;
}
#main {
    width: 1280px;
    margin: 0 auto;
    padding-bottom: 10px;
}
#masthead {
    height: 40px;
    background: -webkit-gradient(linear, 0 0, 0 100%, from(gray), to(black));
    opacity: 0.3;
    margin-bottom: 4px;
    color: white;
    text-align: center;
    padding-top: 20px;
}
#masthead a{
    color: white;
    display: block;
    text-decoration: none;
}
#masthead a:hover{
    color: #FFFF66;
    display: block;
    text-decoration: none;
}

#top_nav {
    width: 100%;
    background: transparent;
    border-bottom: 1px solid #BFBB04;
}
#top_nav a {
    text-decoration: none;
    color: #a7a236;
    font-family: GraublauWeb; /* "Brush Script Std"; */
    font-size: 120%;
    padding: 0 5px;
}
#top_nav a:hover {
    color: #cfc944;
}
#content {
    height: 20px;
    width: 1px;
    background: gray url(content.jpg) 0 0 no-repeat;
}
#content div#textfield{
    display: none;
    position: absolute;
    top: 15%;
    right: 104px;
    width: 310px;
    height: 200px;
    border-bottom: 1px solid black;
    border-right: 1px solid black;
    background: #484B55;
    color: #CCCCCC;
    opacity: 0.5;
    z-index: 9;
}
#content div#textfield p{
    margin: 10px;
}
#content span#left{
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
}
#content span#right{
    display: block;
    position: absolute;
    bottom: 0;
    right: 0;
}
#content span a{
    text-decoration: none;
    color: #CCCCCC;
}
#content img {
    position: absolute;
    top: 50%;
    right: 50%;
    display: none;
    width: 160px;
    height: 116px;
    border: 2px solid white;
    z-index: 10;
}
#content img:hover {
    width: 164px;
    height: 120px;
    opacity: 0.9;
}
#content img#second {
    right: 35%;
}
#content img#third {
    right: 20%;
}
#content img#fourth {
    right: 5%;
}
#footer {
    position: fixed;
    bottom: 0;
    text-align: center;
    width: 100%;
    background: #ECE7E6;
    border-top: 1px solid #BBBFC8;
    font: 80% italic Arial,Verdana, sans-serif;
    color: silver;
    line-height: 1em;
    padding-bottom: 0.1em;
    z-index: 15;
}
#box {
    position: absolute;
    top: 40px;
    left: 0;
    width: 60px;
    height: 60px;
    background: red;
    opacity: 0.5;
    z-index: 6;
}
#blackb{
    display: none;
    position: absolute;
    top: 0;
    width: 1280px;
    height: 888px;
    background: black;
    opacity: 0.7;
    z-index: 9;
}
  • 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-16T06:08:39+00:00Added an answer on May 16, 2026 at 6:08 am

    We’ll need 2 index levels for this to look right, a hover which is always above and a click in-between, like this:

    #content img:hover {
        z-index: 12;
    }
    #content img.clicked {
        z-index: 11;
    }
    

    Then when clicking you can apply this class and remove it from previous elements using .addClass() and .removeClass() like this:

    $(function() {
      $("#content img").click(function() {
        $(this).addClass('clicked').siblings('img').removeClass('clicked');
      });​​​​
    });
    

    You can give it a try here.

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

Sidebar

Related Questions

I have a problem with a durable client on ActiveMQ. I am using stomp.py
Example: We have a conditional field. This conditional field is a radio button with
First of all, sorry to post a question like this when so many other
I have found several topics with this title, but none of their solutions worked
i have two mysql tables which are linked together and i need to show
I've looked around on SO on this topic like this topic here . Also
I looked online for examples of implementation of the form using DIVs and all
Is it possible to pass the pointer to an object in a drag and
I'm trying to create an Apache Camel route that sends a jms message to
git rebase does not appear to work properly in certain cases where a file

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.