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

The Archive Base Latest Questions

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

I am trying to create a carousel that contains 7 days with items under

  • 0

I am trying to create a carousel that contains 7 days with items under each day. When the next button is pressed jquery looks for the last span element of the form <span class="date">DATE</span>, grabs the value and passes it to the server to grab the next 3 entries. Those entries are then appended to the <ul class="week"> element and the whole 7 days slides to the right by 3 increments. My first problem is after the first click jquery doesnt seem to see the dynamically generated content and just sends the initial date value to the server, making it repeat those 3 dates over and over. Second problem is after clicking for long enough it just stops generating new content and fails to add content to the end, even though the server will still spit out html for those days.. I am a beginner at this and may not have the best practice figured out. Here is my relavant code:

        $('.next').click( function() {
    var date = $(".date").filter(':last').text()  //grab the last date class and parse into url to send to server 
    $.get('/log_entries/ajaxdate/'+date, function(data) {
      $('.week').append(data);
    });
    $('.test').animate({left: '-=272px'}, 500);

});

Okay first problem solved, the data sent back from the server did not contain the span element around the date, the dates now increase correctly thanks @RoccoC5

I still end up running out of entries randomly once I get high enough, in this case 2011-10-26 when starting at 2011-08-15.

Here is the code sent back from server when log_entries/ajaxdate/2011-09-12 is loaded:

<li class = "entry"><span class="date">2011-09-13</span> 
</li> 
<li class = "entry"><span class="date">2011-09-14</span> 
</li> 
<li class = "entry"><span class="date">2011-09-15</span> 
</li>
  • 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-24T19:51:57+00:00Added an answer on May 24, 2026 at 7:51 pm

    If the response is pure HTML, you should convert it to DOM elements, using $(data):

    $.get('/log_entries/ajaxdate/'+date, function(data) {
        $('.week').append($(data));
    });
    

    or work with innerHTML, just an example:

    var jweek = $('.week');
    jweek.html(jweek.html() + data);
    

    You should also use .closest() and .find() to make sure you work with one carousel and do not select the other .data or .next elements from the page:

    <div class="carousel">
        <ul class="week">
            <li class="entry"><span class="date">2011-08-16</span></li>
        </ul>
        <a href="..." class="next">Next</a>
    </div>
    
    $('.carousel .next').click( function() {
        // find the parent .week and then .date inside of it
        var date = $(this).closest('.week').find('.date:last').text();
        ...
     });
    

    Note that .filter(':last') can be compressed into the previous selector.

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

Sidebar

Related Questions

I'm trying to create a carousel effect that automatically cycles through each pictures every
I am trying to create a carousel, using floated list items. When Next is
I'm trying to create a carousel similar to http://www.aprica.jp/ , using jQuery and HTML.
I trying to create an animation with JQuery that scrolls 1 word in a
I am trying create a WCF service that leverages the WPF MediaPlayer on the
Trying to create my first iPhone app that would play back audio. When I
Trying to create a small monitor application that displays current internet usage as percentage
I'm trying create a box in my Django app that displays text (and possibly
I'm trying create a ASMX webservice that can perform a HTTP GET request. I
I am trying create a small web application that allows a user to login

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.