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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:36:52+00:00 2026-06-09T19:36:52+00:00

I have web page that has a collection of tiled elements as a background.

  • 0

I have web page that has a collection of tiled elements as a background. Positioned above this, I have another set of tiles (that are twice as large) acting as an overlay. Each of these larger tiles has a ‘margin-right’ equal to the size of one of the smaller background tiles. You can see an example of this @ http://jsfiddle.net/dhx2r/2/ *updated

At first glance this displays correctly. The problem is that due to each larger tile having this right margin, it means if you expand the window, a tile won’t slide up to fill the gap unless it’s larger than 3 small tiles wide. (like this: http://img444.imageshack.us/img444/1412/70953496.png)

Ideally I’d somehow attach to the window.resize event and set the ‘margin-right’ to ‘0’ when a gap of 3 small tiles becomes available. I tried to do this with the code in the js panel of jsfiddle yet it didn’t give the correct results. Since the code I’m using relies on the ‘window.resize’ event, the jsfiddle doesn’t demonstrate what actually happens but it at least shows the code I’m using.

I’ve been struggling with this problem for ~7 hours today so my mind is a little fried! My intention after fixing this initial problem was to then somehow stagger the odd rows so they have a ‘margin-left’ of the width of the small tiles, to give this effect: http://img507.imageshack.us/img507/3600/57663338.png

I managed to calculate even/odd rows using (assuming small tiles were 150px and large 300px):

if ((pos != 0) && (pos % 600 != 0)) {
    // The row is even, stagger the tiles.
}
else {
    // The row is odd, do nothing.
}

.. however I never got past this inital problem to work on the logic.

Anyway if anyone has a solution on how I can get this working I’d greatly appreciate it! I feel like I’ve wasted a whole day banging my head against a wall.

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-06-09T19:36:53+00:00Added an answer on June 9, 2026 at 7:36 pm

    I have a beginning of the solution but sometimes the color is not set correctly. I’m searching to resolve it.

    Fiddle 1

    Finally all problems are solved here.

    Thanks you, it was funny for me to find asolution. I hope this solution is good for you.

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

Sidebar

Related Questions

I have web forms page that has 2 controls. A gridview and an associated
I have created a web page that has two bars across the top of
I have a simple jQuery code that runs on a web page that has
I have a web application that has a page that loads the content from
I have a ASP.NET web page that contains many textboxes. Each textbox has a
I have a web page that has a DIV and an IFRAME. When a
I have a web app that has a Diary. In this Diary, I can
new on rails and using windows for now,, i have web page that user
We have a custom master page that is deployed to the MySite web application
I have a page that has a form backing object that contains a collections

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.