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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:10:03+00:00 2026-05-25T15:10:03+00:00

I have been writing a jQuery cycle plugin. Firstly, the animation never happens. Each

  • 0

I have been writing a jQuery cycle plugin.

Firstly, the animation never happens. Each “slide” sits there for eight seconds by default and never then “pops” to the next image with no transition. Below is my code. I ran it through JSLint and the only thing that came up was that options is never used on line 103. I’m guessing that block of code has something to do with why my plugin is not working as expected. A live example can be seen at http://corolla.tylercrompton.com/.

Secondly, this is a follow question to Making a slider without recursion in which my script is not a plugin. It did work, though, I am still seeking an answer toward that. Thanks.

jQuery(document).ready(function () {
    'use strict';
    (function ($) {

        var methods = {
            init:   function (options) {

                return this.each(function () {

                    var settings = {
                        'delay':        5000,
                        'direction':    'left',
                        'easing':       'swing',
                        'selector':     '*',
                        'transition':   3000
                    };

                    if (options) {
                        $.extend(settings, options);
                    }

                    $(this).css({
                        'overflow': 'hidden',
                        'position': 'relative'
                    });

                    if ($(this).children(settings.selector).length > 1) {
                        $(this).cycle('slide', settings);
                    }

                });
            },

            slide:  function (options) {
                return this.each(function () {

                    var settings = {
                        'delay':        5000,
                        'direction':    'left',
                        'easing':       'swing',
                        'selector':     '*',
                        'transition':   3000
                    }, animation, property, value;

                    if (options) {
                        $.extend(settings, options);
                    }

                    switch (settings.direction) {
                    case 'left':
                        animation = {left: '-=' + $(this).width()};
                        property = 'left';
                        value = $(this).width();
                        break;
                    case 'right':
                        animation = {left: '+=' + $(this).width()};
                        property = 'right';
                        value = 0;
                        break;
                    case 'up':
                        animation = {top: '-=' + $(this).height()};
                        property = 'top';
                        value = $(this).height();
                        break;
                    case 'down':
                        animation = {top: '+=' + $(this).height()};
                        property = 'top';
                        value = 0;
                        break;
                    default:
                        jQuery.error('Direction ' + settings.direction + ' is not valid for jQuery.fn.cycle');
                        break;
                    }

                    $(this).children(settings.selector + ':first-child').each(function () {
                        $(this).delay(settings.delay);
                        $(this).animate(
                            animation,
                            settings.transition,
                            settings.easing,
                            function () {
                                $(this).css(property, value);
                            }
                        );
                    });

                    $(this).append($(this).children(settings.selector + ':first-child').detach());
                    $(this).children(settings.selector + ':first-child').each(function () {
                        $(this).delay(settings.delay);
                        $(this).animate(
                            animation,
                            settings.transition,
                            settings.easing,
                            function () {
                                $(this).parent().cycle('slide', settings);
                            }
                        );
                    });
                });
            }
        };

        jQuery.fn.cycle = function (method, options) {
            if (methods[method]) {
                return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
            } else if (typeof method === 'object' || !method) {
                return methods.init.apply(this, arguments);
            } else {
                $.error('Method ' + method + ' does not exist on jQuery.fn.cycle');
            }
        };
    }(jQuery));

    jQuery('.slider').cycle();

});
  • 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-25T15:10:03+00:00Added an answer on May 25, 2026 at 3:10 pm

    It was actually a CSS error rather than a JavaScript/JQuery error. I was never setting the positions to absolute. I updated my JavaScript in the question that I linked to reflect the most up to date version for those that are interested.

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

Sidebar

Related Questions

I have been writing my first jQuery plugin and struggling to find a means
I've been writing some jQuery functions that have JavaScript variables and looping, etc inside
I have been writing my own Lightbox script (to learn more about jQuery). My
I have been writing C++ Console/CMD-line applications for about a year now and would
I have been writing unit tests using NUnit and Moq with my Silverlight code
I have been writing Python code for only a couple of weeks, so I'm
I have been writing DLL on C++, that will be use in C#. DLL
I have been writing web applications for quite sometime in PHP with MySQL. I
I have been writing Common Lisp macros, so Scheme's R5Rs macros are a bit
I have been writing articles on the wordpress.com blog , now I am looking

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.