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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:27:41+00:00 2026-05-14T03:27:41+00:00

Here is my working page . I attached buttons to white bishop and you

  • 0

Here is my working page. I attached buttons to white bishop and you can move around but left images are overlapped by right images. I think the problem is with CSS. The brief structure is here.

<script>
        $(document).ready(function(){
            $('#top').click(function(){
                $('#p81').animate({top: "-=64px"}, 100);
            });
</script>
<style>
        div.chess_board{
            height: 512px;
            position: relative;
            width: 512px;
        }
        div.chess_square{
            height:64px;
            position: absolute;
            width:64px;
        }
        div.chess_square.white {
            background: none repeat scroll 0 0 #ffffff;
        }
            .
            .
            .
        div.chess_piece{
                background-image: url("sprite.png");
                height: 64px;
                width: 64px;
                position: absolute;
            }
        div.chess_piece.bishot.white{
            background-position: -64px 0;           
        }
</style>

<div class="chess_board">
  <div id="b81" class="chess_square white" style="top: 448px; left: 64px;">
    <div class="chess_square_inner"></div>
    <div id="p81" class="chess_piece bishot white"></div>
  </div>
</div>
<input type="button" id="top" value="top" />
  • 1 1 Answer
  • 2 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-14T03:27:42+00:00Added an answer on May 14, 2026 at 3:27 am

    You get the overlap effect because you are using a transparent PNG. When you move the position of the bishop over, it simple moves on top of the rook. You can do one of the following:

    1. Double up your sprite to have the white and gray backgrounds. Then switch to the appropriate space. The PNG will not be transparent so you will cover it up.
    2. You can update your jQuery to hide the background of the destination, in this case the rook.

    Example for item 2: (You will have to get crafty with your selectors)

    $('#left').click(function(){
        $(piece).animate({left: "-=64px"}, 100);
        $("#p80").css("background-image", "none");
    });
    

    UPDATE

    After looking at your page a bit more you can also resolve it by setting the background color of the div with class ‘chess_piece’.

    .chess_piece
    {
        background-color: #ffffff/#cfcfcf;
    }
    

    You could do it with jQuery and your event:

    $('#left').click(function(){
        $(piece).animate({left: "-=64px"}, 100);
        $(piece).css("background-color", "#cfcfcf");
    });
    

    UPDATE 2

    After seeing your comment, the issue has changed slightly. To overcome that issue you need to add a z-index to your piece. The generated markup would be something like:

    <div class="chess_piece bishot white" id="p81" style="top: -64px; left: 64px; z-index: 10000;"></div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the basic layout of a page I'm working on: alt text http://www.mfrl.org/images/pagelayout.png What
What I have here is a PHP page working with the Facebook API. What
Here is the web page I'm working on: http://sebastianbiermanlytle.com/games.htm . The flashplayer is at
Here's the code for a simple page I have that is not working: <head>
Here is a sample code I'm working on: <%@ Page Language=C# AutoEventWireup=true CodeFile=Default.aspx.cs Inherits=_Default
Problem: to get the command working here. My domain is http://cs.edu.com/user/share_dir , but I
hi i have the following page: [here][link removed] the script i wrote is working
I've modified a page where I can drag and drop images onto a canvas.
Here is the working page: game on glove dot com The non-working page is
Okay i'm stuck on something here. This is the page i'm working on: https://www.passovermeal.org/

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.