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

  • Home
  • SEARCH
  • 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 465953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:25:47+00:00 2026-05-12T23:25:47+00:00

Basically I have different images for different months in the year, what I’m trying

  • 0

Basically I have different images for different months in the year, what I’m trying to do is to click on a certain month and have a slide show of the images related to that month on top of the page, link text(this is for testing purposes),

but the problem is that when I click on first month (Jan) I get images of the next month in the slide show as well and when I click on the second month I get no pictures, I can’t seem to fix this problem, any help would be appreciated,

if it’s too much trouble troubleshooting the code, how can I do something like that, (i.e. different slide shows for different months of the year).

thanks

<div id="main_content">

    <div id="gallery_page">
        <div class="slide">
            <span id="first"><p>Jan 2008</p></span>
            <span id="second"><p>Feb 2008</p></span>
            <span id="third"><p>March 2008</p></span>
            <span id="forth"><p>April 2008</p></span>
            <span id="fifth"><p>May 2008</p></span>
            <span id="sixth"><p>June 2008</p></span>
            <span id="seventh"><p>July 2008</p></span>
            <span id="eighth"><p>August 2008</p></span>
        </div>
        <div class="slide">
            <span id="ninth"><p>Feb 2007</p></span>
            <span id="tenth"><p>Feb 2007</p></span>
            <span id="eleventh"><p>Feb 2007</p></span>
            <span id="twelvth"><p>Feb 2007</p></span>
            <span id="thirteenth"><p>Feb 2007</p></span>
            <span id="fourteenth"><p>Feb 2007</p></span>
            <span id="fifteenth"><p>Feb 2007</p></span>
            <span id="sixteenth"><p>Feb 2007</p></span>
        </div>
        <div id="main_gallery_pics2">
            <div class="slide2">
                <img src="images/gallery/feb2008/dal.jpg" />
            </div>
            <div class="slide2">
                <img src="images/people/miles.jpg" />
            </div>
        </div>

        <div id="main_gallery_pic3">
            <div class="slide2">
                <img src="images/people/miles.jpg" />
            </div>
            <div class="slide2">
                <img src="images/people/dal.jpg" />
            </div>
        </div>
  </div>

$(document).ready(function(){
  var currentPosition2 = 0; 
  var slideWidth2 = 475;
  var slides2 = $('.slide2');
  var numberOfSlides2 = slides2.length;

  // Remove scrollbar in JS
  $('#main_gallery_pics2,#main_gallery_pics3').css('overflow', 'hidden');

  // Wrap all .slides with #slideInner div
  slides2
  .wrapAll('<div id="slideInner2"></div>')
  // Float left to display horizontally, readjust .slides width
  .css({
    'float' : 'left',
    'width' : slideWidth2
  });

  // Set #slideInner width equal to total width of all slides
  $('#slideInner2').css('width', slideWidth2 * numberOfSlides2);



  // Insert left and right arrow controls in the DOM
  $('#main_content')
    .prepend('<span class="control2" id="left_arrow2">Move left</span>')
    .append('<span class="control2" id="right_arrow2">Move right</span>');

  // Hide left arrow control on first load
  manageControls2(currentPosition2);

  // Create event listeners for .controls clicks
  $('.control2')
    .bind('click', function(){
    // Determine new position

      currentPosition2 = ($(this).attr('id')=='right_arrow2')
    ? currentPosition2+1 : currentPosition2-1;

      // Hide / show controls
      manageControls2(currentPosition2);
      // Move slideInner using margin-left
      $('#slideInner2').animate({
        'marginLeft' : slideWidth2*(-currentPosition2)
      });
    });

  // manageControls: Hides and shows controls depending on currentPosition
  function manageControls2(position){
    // Hide left arrow if position is first slide
    if(position==0){ $('#left_arrow2').hide() }
    else{ $('#left_arrow2').show() }
    // Hide right arrow if position is last slide
    if(position==numberOfSlides2-1){ $('#right_arrow2').hide() }
    else{ $('#right_arrow2').show() }
    }

  });
  • 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-12T23:25:47+00:00Added an answer on May 12, 2026 at 11:25 pm

    You have a typo in gallery_pic_replace.js. When you click Feb, you’re going after:

    $('#main_gallery_pics3')
    

    but in your markup it’s

    <div id="main_gallery_pic3">
    

    Sneaky ‘s’….

    EDIT:
    The next issue is with:

    slides2
      .wrapAll('<div id="slideInner2"></div>')
    

    You’re taking all the slides and wrapping them in one div. This is causing them to become repositioned into the January div.

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

Sidebar

Ask A Question

Stats

  • Questions 258k
  • Answers 258k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I was getting confused by this as well. You want… May 13, 2026 at 10:57 am
  • Editorial Team
    Editorial Team added an answer Html.TextBox uses the previous value of the field, if available… May 13, 2026 at 10:57 am
  • Editorial Team
    Editorial Team added an answer You should set java.library.path property to point to the directory… May 13, 2026 at 10:57 am

Related Questions

Basically I have different images for different months in the year, what I'm trying
I created a pretty fancy winforms app for my company. We had a graphic
I have an HttpModule that I have put together from cobbling a couple of
I have an app that shows a series of UIImageView s on a ScrollView
I am creating an app which will be used to upload images to a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.