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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:14:54+00:00 2026-05-25T00:14:54+00:00

I wrote small ‘News Ticker’. I should make a loop through the spans ,

  • 0

I wrote small ‘News Ticker’. I should make a loop through the spans, making fadeIn/fadeOut every 5s.

While untouched it is working fine, but when you try do play with the arrows(play forward arrow 5 times for example), script goes mad making fadeIn/fadeOut constatly.

Live example here.

Script:

        (function($) {

        $.fn.NoticeBoard = function() {


            // Set a timeout
            var timeOut = setTimeout(nextNotice, 5000);

            // pause on hover
            $('.noticeboard').hover(

            function() {
                clearTimeout(timeOut);
            }, function() {
                timeOut = setTimeout(nextNotice, 5000);
            });

            // Next notice function called on timeout or click

            function nextNotice(event) {
                clearTimeout(timeOut);
                timeOut = setTimeout(nextNotice, 5000);

                if ($('.noticeboard span:visible').is('.noticeboard span:last-child')) {
                    $('.noticeboard span:visible').fadeOut(300);
                    $('.noticeboard span:first-child').fadeIn();
                }
                else {
                    $('.noticeboard span:visible').fadeOut(300).next().fadeIn();
                }
                return false;
            }

            $('#notice-next').click(nextNotice);
            $('#notice-prev').click(function(event) {


                if ($('.noticeboard span:visible').is('.noticeboard span:first-child')) {
                    $('.noticeboard span:visible').fadeOut(300);
                    $('.noticeboard span:last-child').fadeIn();
                }
                else {
                    $('.noticeboard span:visible').fadeOut(300).prev().fadeIn();
                }
                return false;

            });

        };

    /*!  
    ---------------------------------------------*/

    })(jQuery);

    /*!  OnLoad
    ---------------------------------------------*/
    $(document).ready(function() {

        $('.noticeboard span').hide();
        $('.noticeboard span:first').show();
        $('.noticeboard').NoticeBoard();

    });

Any help with fixing the issue much appreciated.

  • 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-25T00:14:55+00:00Added an answer on May 25, 2026 at 12:14 am

    I tried it here
    I declare a flag to carry the fadeIn is already done or not,so that we can never fire the event too much times…

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

Sidebar

Related Questions

I wrote a small PHP application several months ago that uses the WordPress XMLRPC
I wrote a small PHP application that I'd like to distribute. I'm looking for
We wrote a small Windows class library that implements extension methods for some standard
I wrote a small sample of code in C# to capture selected text from
I recently wrote a small tool to generate a class for each tier I
Right now I'm developing mostly in C/C++, but I wrote some small utilities in
I have several small open-source projects that I wrote. All my attempts to find
I want to write a small program that should print something like testing CPU...
I wanted to write a small Rapid Serial Visual Presentation (RSVP) program for my
At work we write a small to moderate amount of scripts to aid us

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.