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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:24:11+00:00 2026-05-11T19:24:11+00:00

I am looking at a jQuery screencast ( jQuery for Absolute Beginners: Day 8

  • 0

I am looking at a jQuery screencast (jQuery for Absolute Beginners: Day 8). It has this code:

$(function() {
  $('.wrap').hover(function() {
    $(this).children('.front').stop().animate({
      "top": '300px'
    }, 900);
  }, function() {
    $(this).children('.front').stop().animate({
      "top": '0'
    }, 700);
  });
});
#container {
  width: 850px;
  text-align: center;
  margin: auto;
}

.wrap {
  width: 250px;
  height: 140px;
  position: relative;
  overflow: hidden;
  padding: 0 1em;
}

img {
  position: absolute;
  top: 0;
  left: 0;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="container">
  <div class="wrap">
    <img src="back.jpg" alt="image" />
    <img src="front.jpg" class="front" alt="image" />
  </div>
</div>

Why is it that front.jpg appears on top of back.jpg? Is it simply because front.jpg is in a tag that comes after back.jpg’s tag?

  • 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-11T19:24:11+00:00Added an answer on May 11, 2026 at 7:24 pm

    When z-index is omitted, following siblings are automatically on a higher layer than previous siblings. This is expected behaviour.

    To quote from the MDC pages below:

    When no element has a z-index, elements are stacked in this order (from bottom to top):

    1. Background and borders of the root element
    2. Descendant blocks in the normal flow, in order of appearance (in HTML)
    3. Descendant positioned elements, in order of appearance (in HTML)

    See: https://developer.mozilla.org/en/understanding_css_z-index and in particular, the first section, https://developer.mozilla.org/en/Understanding_CSS_z-index/Stacking_without_z-index

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

Sidebar

Related Questions

Looking at this jQuery example, how can I modify the code so that it
Im looking for a jQuery pluging (or code/guide) that does this: http://codecanyon.net/item/jquery-css3-sticky-mega-menu-bar/full_screen_preview/239093 This one
I was looking at the jQuery UI code, and I found that every file
I have fancy looking jQuery Multiple checkbox/selectbox list script. Look HERE for demo. This
I found this snippet when i was looking at jQuery plugins and wonder what
I've been looking at jquery drop-down plugins. None of them function the way I'd
Looking through the jQuery source in the function now() I see the following: function
I'm looking at jQuery source code for tracking the domready event and there's one
I'm currently using Prototype, but I'd like to rewrite this function to jQuery: function
I just started looking into jQuery yesterday, before this I programmed in only PHP.

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.