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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:58:00+00:00 2026-06-15T19:58:00+00:00

I am attempting to add a simple indicator to my carousel. For the time

  • 0

I am attempting to add a simple indicator to my carousel. For the time being, the number of indicators doesn’t have to be dynamically generated. I am trying to replicated the carousel on the BBC homepage.

The indicator on BBC site are those orange dots on the top right.
I dont care to make the dots a link to the corresponding slide, I just want the dots to cycle according to if you click ‘prev’ or ‘next’

For example: ( o = indicator )

<prev      [IMGS]      next>
           o o o

My jsFiddle: http://jsfiddle.net/yTKyU/

  • 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-15T19:58:01+00:00Added an answer on June 15, 2026 at 7:58 pm

    See the updated fiddle: http://jsfiddle.net/yTKyU/1/

    $(document).ready(function() {
    
    //rotation speed and timer
    var speed = 5000;
    var run = setInterval('rotate()', speed);
    
    //calculate width dynamically for responsive design
    var starting_width = $('#slides ul li').width($('#slides').outerWidth());
    
    //grab the width and calculate left value
    var item_width = $('#slides ul li').outerWidth();
    var left_value = item_width * (-1);
    
    //move the last item before first item, just in case user click prev button
    $('#slides ul li:first').before($('#slides ul li:last'));
    
    //set the default item to the correct position 
    $('#slides ul').css({
        'left': left_value
    });
    
    //if user clicked on prev button
    $('#prev').click(function() {
    
        //get the right position            
        var left_indent = parseInt($('#slides ul').css('left')) + item_width;
    
        //slide the item            
        $('#slides ul:not(:animated)').animate({
            'left': left_indent
        }, 200, function() {
    
            //move the last item and put it as first item                
            $('#slides ul li:first').before($('#slides ul li:last'));
    
            //set the default item to correct position
            $('#slides ul').css({
                'left': left_value
            });
    
        });
        if ($('#pagination li span.current').parent().is(':first-child')) {
            $('#pagination li span.current').removeClass('current');
          $('#pagination li:last-child').children().addClass('current');
        } else {
        $('#pagination li span.current').parent().prev().children().addClass('current').addClass('new');
        $('#pagination li span.current').removeClass('current');
        $('#pagination li span.new').addClass('current').removeClass('new');
    }
        //cancel the link behavior            
        return false;
    
    });
    
    
    //if user clicked on next button
    $('#next').click(function() {
    
        //get the right position
        var left_indent = parseInt($('#slides ul').css('left')) - item_width;
    
        //slide the item
        $('#slides ul:not(:animated)').animate({
            'left': left_indent
        }, 200, function() {
    
            //move the first item and put it as last item
            $('#slides ul li:last').after($('#slides ul li:first'));
    
            //set the default item to correct position
            $('#slides ul').css({
                'left': left_value
            });
    
        });
    
        //change the itemlist class
        if ($('#pagination li span.current').parent().is(':last-child')) {
            $('#pagination li span.current').removeClass('current');
          $('#pagination li:first-child').children().addClass('current');
        } else {
            $('#pagination li span.current').parent().next().children().addClass('current').addClass('new');
            $('#pagination li span.current').removeClass('current');
            $('#pagination li span.new').addClass('current').removeClass('new');
        }
        //cancel the link behavior
        return false;
    
    });
    
    //if mouse hover, pause the auto rotation, otherwise rotate it
    $('#slides').hover(
    
    function() {
        clearInterval(run);
    }, function() {
        run = setInterval('rotate()', speed);
    });
    
    });
    
    //function to click next link
    //a timer will call this function, and the rotation will begin :)  
    
    
    function rotate() {
    $('#next').click();
    }​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to add a simple toolstrip however I can't get it to
I'm trying to add a simple 301 rule to the .htaccess file of a
I recently began attempting to develop a simple Wordpress theme for myself, and have
I'm attempting to develop a simple online editor that allows for real-time collaboration (written
So, i'm attempting simple card game. I have player class with draw function, and
I am attempting to add BASIC authentication to my RESTful web-service. Currently I have
I am attempting to code a very simple way for a user to add
I am attempting to build a simple application using wicket and have been impressed
I am attempting to add an item to the application menu-bar of a simple
I am attempting to add some multi-threading to a WPF application I have created

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.