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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:12:37+00:00 2026-05-29T15:12:37+00:00

<div id=messages> <div class=message> <!– Visible (5 seconds for hide, show the next, and

  • 0
<div id="messages">
<div class="message"> <!-- Visible (5 seconds for hide, show the next, and hide again) -->
<div class="message" style="display:none;"> <!-- Hidden -->
<div class="message" style="display:none;"> <!-- Hidden -->
</div>

The following (noob) code will hide the <div> tag after five seconds of be created, so I want to hide each notification after five seconds but when it’s visible, It’s something like a slideshow but with notifications, 5 seconds per notification when it’s visible.

function setid() {
    $('.message').each(function() {
        if($(this).attr('id')==uniqID) { 
            uniqID = Math.floor(Math.random()*9999999);
        }
    });
}

console.log = function(message) {
    console.olog(message);
    setid();
    $('#messages').append('<div id="' + uniqID + '" class="message"> + message + '</div>').show();
    $('#' + uniqID).slideDown(200).delay(5000).slideUp(200);
};
  • 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-29T15:12:38+00:00Added an answer on May 29, 2026 at 3:12 pm

    It’s actually very simple:

    $(".message").hide().first().show();
    setTimeout(showNotifications, 5000);
    function showNotifications(){
        $(".message:visible").remove();
        $(".message").first()show();
        if($(".message").length > 0){
            setTimeout(showNotifications, 5000);
        }
    }
    

    How it works:
    It selects all the .message elements and hide them except the first one.
    After 5 seconds, the first message will be removed from the webpage and the following message will be shown for another 5 seconds and this goes until there is no more notification messages in the site.

    Want some animations as well? Check out this:

    $(".message").hide().first().show('slow');
    setTimeout(showNotifications, 5000);
    function showNotifications(){
        $(".message:visible").hide('slow', function(){
            $(this).remove();
            $(".message").first().show('slow');
            if($(".message").length > 0){
               setTimeout(showNotifications, 5000);
            }
        });
    }​
    

    Click here for a working example.

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

Sidebar

Related Questions

<div style=background-color:black> <div style=float:right> Test message </div> <div> This will show 'Test message' with
I need to wrap zend form error messages in custom html. <div class=cerror id=ID-error>
I have a div to show a message, I want the message to appear
I have a basic div element to represent a message that I show for
I'm trying to display the content of my message class using text_area helper but
I have this HTML code: <div id=content> <div class=profile_photo> <img style=float:left;margin-right:7px; src=http://gravatar.com/avatar/53566ac91a169b353a78b329bdd35c95?s=50&d=identicon class=profile_img alt={username}/>
I have a status message box (div box) positioned at the bottom of a
$('div.box').html(hello) puts the word hello inside all my div's of class 'box'. They all
I have a message board, and I have some code that loads new messages
I've build pretty simple validator that will display my custom error message when someone

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.