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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:16:13+00:00 2026-06-09T02:16:13+00:00

This fiddle works as intended, when the last li has a class on, the

  • 0

This fiddle works as intended, when the last li has a class on, the first li gets a class of first.

I am trying to use the same principle with the jQuery Cycle plugin. If you have a look at this fiddle you will see that the cycle plugin adds a class of activeSlide to the active slide. I have put some code in fidle which I thought would handle it but it looks as though maybe I have my logic wrong?

  • 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-09T02:16:14+00:00Added an answer on June 9, 2026 at 2:16 am

    You’re only checking for the activeSlide class once, when the document is loaded. Wrap your logic inside a click handler on the rows and it should work:

    $('#nav li').click(function() {
        if( $('.activeSlide').is('li:last-child') ) {
            $('li:first').addClass('first');
        }
        else {
            $('li:first').removeClass('first');
        }
    });
    

    Click here for live example

    What if I want to check for the active slide on each interval of the cycle?

    You can add a callback to the after option and run the logic there as well. Check out all the available options for more information.

    Click here for a live example

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

Sidebar

Related Questions

In this fiddle I'm just trying to return true : http://jsfiddle.net/WCFtp/ for jQuery key
I'm trying to use jquery validate. Following the example: http://docs.jquery.com/Plugins/Validation works great and I'd
In this fiddle when user drags a div auto scroll works in chrome but
I have this fiddle : http://jsfiddle.net/XjeCf/1/ that works like I want and this one
I have created a fiddle to test this : http://jsfiddle.net/Ninjanoel/X6ShS/ which works fine :(
look at this fiddle: http://jsfiddle.net/ugxNK/ I want that the first list element is in
In this fiddle i have a part of my form: http://jsfiddle.net/ZXSKH/55/ I am trying
I have this fiddle which has an error --> http://jsfiddle.net/Osoascam/AkZZr/6/ (This is the version
On this fiddle: http://jsfiddle.net/cYrqY/64/ I can't figure out why the First item of the
Here is the fiddle this one works http://jsfiddle.net/P72UR/ this one doesn't http://jsfiddle.net/j86TA/1/ Sorry I

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.