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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:12:53+00:00 2026-05-29T15:12:53+00:00

Im creating a simple image gallery. And I mean simple: <div id=outerdiv style=width:600px;height:400px; background:#ccc;padding:50px;>

  • 0

Im creating a simple image gallery. And I mean simple:

 <div id="outerdiv" style="width:600px;height:400px; background:#ccc;padding:50px;">
  <div id="theGallery">
    <div class="thumbnailDiv" id="tn1">
      <div style="position: absolute;">
        <img id="1" src="pic1.jpg"/>
      </div>
    </div>
    <div class="galleryButtonLeft"></div>
  </div>
 </div>

I want to slide the image left so other images can appear when galleryButtonLeft is clicked. Heres my jQuery:

    $(function () {
    $(".galleryButtonLeft").mousedown(function (event) {
      event.preventDefault();
      $("#theGallery").animate({
      marginLeft: "-=300px"
       }, 1000);
      }).click(function (event) {
      event.preventDefault();
     });});

And the CSS:

       .galleryButtonLeft
         {
        height:130px;
           width:40px;
         border:#996663 solid 1px;
         background:#e9cbad;
        z-index:30;
      }

The gallery slides to the left but its only hidden behind the galleryButtonleft div and not behind the outerdiv div portion to the left of my button. The z-index for the gallery is lower than all other z-indexes. So how do i hide theGallery so it doesnt show on the outerdiv div except for the current images to the right of the galleryButtonLeft?

  • 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-29T15:12:54+00:00Added an answer on May 29, 2026 at 3:12 pm

    You can set overflow: hidden on the parent container. Then when the element leaves the bounds of the parent it will be hidden.

    In addition, don’t animate the entire gallery, just the img or it’s wrapper.

    EDIT:

    Based on comments, here is an updated fiddle:

    http://jsfiddle.net/6rHC2/3/

    A wrapper was added with fixed size and overflow:hidden.

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

Sidebar

Related Questions

Can anyone guide me with the simple javascript code for creating an image gallery
I'm creating a simple game using HTML and CSS. I have a background image
I am creating a simple gradient background by drawing a quad as follows: glMatrixMode
We're currently creating a simple application for image manipulation in Silverlight, and we've hit
I'm creating simple image viewer, but I want to make a sorting of pictures
I trying to make a simple image gallery, where I have several radio button
When creating a simple photo gallery with a crossfade effect I’m encountering weird behavior.
I'm creating a simple php sprite image generator, I was able to calculate the
I'm creating what should be a simple image slider/flipper. I have a set of
I'm creating a simple HTML page that has an image upload. That image then

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.