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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:40:39+00:00 2026-05-25T16:40:39+00:00

As an exercise to learn more about about how jQuery plugins work, I’d like

  • 0

As an exercise to learn more about about how jQuery plugins work, I’d like to stop auto scrolling in a jQuery carousel plugin from the javascript console (using Firebug with Firefox).

In a demo of the plugin here, it’s trivially easy to stop the autoscrolling. I just use the following code in the console.

$('#mycarousel').jcarousel('stopAuto')

However, on this site which uses an older version of the above plugin (and an older version of jQuery) the equivalent code:

$('#showcaseHolder').jcarousel('stopAuto')

Does not work.

One difference I noticed is that in the first (working) case the call to jcarosel returns ‘undefined’ and in the second (not working) case it returns the element itself.

What’s the difference between these two cases? How can I call ‘stopAuto’ on that second site? Why does it return the element in the second case?

Thanks for your help!!

  • 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-25T16:40:39+00:00Added an answer on May 25, 2026 at 4:40 pm

    You say you are doing this for learning how plugins work.. if you were to call $('#mycaousel').jcarousel('stopAuto') in the new version, it returns undefined because it is not intended to be chained. In the old version, it returns the element itself because the plugin developer intended on this being chainable, meaning that you could maybe do something like, $('#mycaousel').jcarousel('stopAuto').jcarousel('startAuto')

    in the oldskool version:

    jCarousel function accepts an ‘options’ object, which allows you to specify optional params in an object like: {scroll: 1}

    Without reading any documentation on this older version and from looking at the code, I would assume that you could supply ‘0’ to an ‘auto’ optional param and this would turn off autoscroll. Right now you have auto set to 15, meaning it should autoscroll after 1.5 seconds

    Try this:

    jQuery(document).ready(function() {
        jQuery('#showcaseHolder').jcarousel({
            scroll:1,
            itemLoadCallback: function (carousel, state) {
                JQUERY_CARA_LEFT = carousel;            
            },
            auto: 0, /* was auto: 15 */
            wrap:'both' 
        });
        jQuery('#showcaseHolderRight').jcarousel({
            scroll:1,
            itemLoadCallback: function (carousel, state) {
                JQUERY_CARA_RIGHT = carousel;           
            },
            auto: 0, /* was auto: 15 */
            wrap:'both' 
        }); 
    });
    

    Note: you can also remove auto: 0 because if you do not supply the optional ‘auto’ param it defaults to ‘0’

    UPDATE (based off of comments):

    I could just tell you the answer but I want to explain how I got to this:

    In the jcarousel.js source, this is the key part:

    // Create shortcut for internal use
    var $jc = $.jcarousel;
     ...
    
    $jc.fn.extend({
     ...
    startAuto: function(s) { ... },  /* s = number of seconds to autoscroll by */
    stopAuto: function() { ... }
     ...
    

    This means that ‘startAuto(s)’ and ‘stopAuto()’ are parameters of the jcarousel object.

    Since in your code, when you instantiate your jcarousel objects you place one in var JQUERY_CARA_LEFT and another in JQUERY_CARA_RIGHT, this is the format you would need to use:

    To start at any time:

    JQUERY_CARA_LEFT.jcarousel.startAuto(15);
    // or
    JQUERY_CARA_RIGHT.jcarousel.startAuto(15);
    

    And to stop at any time:

    JQUERY_CARA_LEFT.jcarousel.stopAuto();
    // or
    JQUERY_CARA_RIGHT.jcarousel.stopAuto();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In an effort to learn more about networking I'd like to do an exercise:
I searched the site but it seems like this exercise from the book Learn
I'm in the process of trying to 'learn more of' and 'learn lessons from'
I'm following this tutorial to learn something more about OpenGL and in particular point
I have been trying to learn more about lambda expressions lately, and thought of
I am trying to learn rails from http://ruby.railstutorial.org/ Exercise 3 explains to install rspec,
I'm starting to learn C++ and as an exercise decide to implement a simple
I'm trying to learn scheme via SICP. Exercise 1.3 reads as follow: Define a
I am new to functional programming, and now learn Haskell. As an exercise I
So i'm green as grass and learning programming from How to think like a

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.