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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:44:24+00:00 2026-05-14T03:44:24+00:00

I am trying to make it so when a navigation item is clicked, it

  • 0

I am trying to make it so when a navigation item is clicked, it retracts the news ticker on the right and then doesn’t run any of the extracting/timer functions anymore. I got it to retract but it still extracts.

How I am doing it is I am adding a “noTicker” class with the nav buttons and removing it with colorbox’s close button. The function runs on the page initially and if there isn’t a “noTicker” class it runs the news ticker as planned. When a nav or close button is clicked it runs the function again which checks again to see if it has that class.

So if it has the class it should retract (which it is so that must mean it’s adding the class properly) and then not run any of the timer functions, but it still runs the timer functions for some reason. Here is my jQuery. It is also not removing the class properly when the close button is clicked, according to firebug.

/* Initially hide all news items */

$('#ticker1').hide();
$('#ticker2').hide();
$('#ticker3').hide();

var randomNum = Math.floor(Math.random()*3); /* Pick random number */

newsTicker();

function newsTicker() {

    if (!$("#ticker").hasClass("noTicker")) {

        $("#ticker").oneTime(2000,function(i) { /* Do the first pull out once */

            $('div#ticker div:eq(' + randomNum + ')').show(); /* Select div with random number */

            $("#ticker").animate({right: "0"}, {duration: 800 }); /* Pull out ticker with random div */

        });

        $("#ticker").oneTime(15000,function(i) { /* Do the first retract once */

            $("#ticker").animate({right: "-450"}, {duration: 800}); /* Retract ticker */

            $("#ticker").oneTime(1000,function(i) { /* Afterwards */

                $('div#ticker div:eq(' + (randomNum) + ')').hide(); /* Hide that div */

            });

        });

        $("#ticker").everyTime(16500,function(i) { /* Everytime timer gets to certain point */

            /* Show next div */

            randomNum = (randomNum+1)%3;

            $('div#ticker div:eq(' + (randomNum) + ')').show();

            $("#ticker").animate({right: "0"}, {duration: 800}); /* Pull out right away */


            $("#ticker").oneTime(15000,function(i) { /* Afterwards */

                $("#ticker").animate({right: "-450"}, {duration: 800});/* Retract ticker */

            });

            $("#ticker").oneTime(16000,function(i) { /* Afterwards */

                /* Hide all divs */

                $('#ticker1').hide();
                $('#ticker2').hide();
                $('#ticker3').hide();

            });

        });

    } else {

        $("#ticker").animate({right: "-450"}, {duration: 800}); /* Retract ticker */

        $("#ticker").oneTime(1000,function(i) { /* Afterwards */

            $('div#ticker div:eq(' + (randomNum) + ')').hide(); /* Hide that div */

        });

    }

}

/* when nav item is clicked re-run news ticker function but give it new class to prevent activity */

$("#nav li").click(function() {

    $("#ticker").addClass("noTicker");

    newsTicker();

});

/* when close button is clicked re-run news ticker function but take away new class so activity can start again */

$("#cboxClose").click(function() {

    $("#ticker").removeClass("noTicker");

    newsTicker();

});

Thanks,

Wade

  • 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-14T03:44:25+00:00Added an answer on May 14, 2026 at 3:44 am

    It doesn’t look like your everyTime() timer will get cancelled when you add the noTimer class to your #ticker div. The first call to newsTicker() will presumably set this going, however, I don’t see that subsequent calls will stop it.

    If I am reading the correct documentation, you can give your timer a (string) label, then to stop it you can call stopTime() and supply the label.

    Here is the documentation I am working from:
    http://plugins.jquery.com/project/timers

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

Sidebar

Related Questions

I'm trying to make a navigation for my website and would greatly appreciate any
Got a question for you all! I'm trying to make a navigation system for
I'm trying to make a simple navigation menu with jquery, where you hover over
I'm trying to make a fixed vertical navigation on the left hand side of
I am trying to make some animations with the main navigation of my site.
I'm trying to make a navigation where there are 4 clickable links. Those links
I'm trying to make a basic navigation, all the links are plain text and
Using the following CSS, I'm trying to make a navigation bar at the top
To whom it may concern, I am trying to make a list navigation menu
I'm trying to make my app feel more customized with a shaded navigation bar.

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.