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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:39:25+00:00 2026-06-14T03:39:25+00:00

function loader_bar(msg,msgtype) { switch (msgtype) { case ‘error’: $class = ‘bar_error topbar’ break; case

  • 0
function loader_bar(msg,msgtype) {


      switch (msgtype) {
        case 'error':
            $class = 'bar_error topbar'
            break;
        case 'success':
            $class = 'bar_success topbar'
            break;
        case 'working':
            $class = 'topbar'
            msg = 'Spinner ' + msg
            break;
        default:
            $class = 'topbar'
            msg = msg
            break;
      }

     if ($("#loader_bar").is(":visible")) {
         $("#loader_bar").removeClass()
         clearInterval(int);
         $("#loader_bar").html(msg).addClass($class);
    } else {
      $('<div />', { "class": $class, html: msg, "id" : "loader_bar" }).prependTo("body").slideDown('fast');    
    }

      myTimer = setInterval($("#loader_bar").slideUp('fast'), 10000);
}

Right now, it appears for a split second then goes?

Basically I want a bar to appear with a certain class when I call it, after 10 seconds I want it to slideUp however if it is called again from another function before the timeout. I want to reset the timer and change the message / class and keep it up another 10 seconds…

  • 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-14T03:39:26+00:00Added an answer on June 14, 2026 at 3:39 am
    myTimer = setInterval($("#loader_bar").slideUp('fast'), 10000);
    

    should be

    myTimer = setInterval(function() { $("#loader_bar").slideUp('fast'); }, 10000);
    

    The statement to run must be in a function, otherwise it would be called instantly.

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

Sidebar

Related Questions

Guys, what is function called after my class loaded, where i can call self
$('#post_form').submit(function() { $(#ajax_bar_loader).show(); $.ajax({ url: 'add.html', data: $('#post_form').serialize(), dataType: 'json', type: 'post', success: function(
Check out this piece of JavaScript code: (function (w, d) { var loader =
I'm having a problem with the loaded() function of the Kohana ORM. I'm loading
I have this script loaded on a page: (function() { window.alert('bookmarklet started'); function AjaxSuccess(data,
My problem is to execute a function when a new page is loaded. I
I have a variable () loaded with a html code: $.get(url, function (res, data)
As is evident when the document gets loaded in the client browser, $(function(){ some
Tried this: $('.link').click(function(e) { $.getScript('http://www.google.com/uds/api?file=uds.js&amp;v=1.0', function() { $('body').append('<p>GOOGLE API (UDS) is loaded</p>'); }); return
i have this function that starts a slideshow automatically and i need to delay

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.