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

  • Home
  • SEARCH
  • 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 7784109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:02:30+00:00 2026-06-01T20:02:30+00:00

i need some tweaking advice since i’m not familiar with javascript and jquery. i

  • 0

i need some tweaking advice since i’m not familiar with javascript and jquery. i want to add a notification on top of my page when it loads. for example when i load my home page (index.html) i want the notification to appear.

the current example only pop up the notification when i click the button. i want it to appear when i load the page. can someone help me out? im kinda interested in this notification bar.

i got it from http://tympanus.net/Development/jbar/

my current code is like this (index.html):

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title>jQuery Plugin jBar</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <link rel="stylesheet" type="text/css" href="css/style.css" media="screen"/>
    </head>
    <body>
        <div class="content">           
                <a id="msgup" class="button">Demo Top</a>
        </div>


    <script src="jquery-1.3.2.js" type="text/javascript"></script>
    <script src="jquery.bar.js" type="text/javascript"></script>
    <script>
        $("#msgup").bar({
            color            : '#1E90FF',
            background_color : '#FFFFFF',
            removebutton     : false,
            message          : 'Your profile customization has been saved!',
            time             : 4000
        });
    </script>   
    </body>
</html>

and the jquery.bar.js file :

    (function($) {

    $.fn.bar = function(options) {
        var opts = $.extend({}, $.fn.bar.defaults, options);
        return this.each(function() {
            $this = $(this);
            var o = $.meta ? $.extend({}, opts, $this.data()) : opts;

            $this.click(function(e){
                if(!$('.jbar').length){
                    timeout = setTimeout('$.fn.bar.removebar()',o.time);
                    var _message_span = $(document.createElement('span')).addClass('jbar-content').html(o.message);
                    _message_span.css({"color" : o.color});
                    var _wrap_bar;
                    (o.position == 'bottom') ? 
                    _wrap_bar     = $(document.createElement('div')).addClass('jbar jbar-bottom'):
                    _wrap_bar     = $(document.createElement('div')).addClass('jbar jbar-top') ;

                    _wrap_bar.css({"background-color"   : o.background_color});
                    if(o.removebutton){
                        var _remove_cross = $(document.createElement('a')).addClass('jbar-cross');
                        _remove_cross.click(function(e){$.fn.bar.removebar();})
                    }
                    else{               
                        _wrap_bar.css({"cursor" : "pointer"});
                        _wrap_bar.click(function(e){$.fn.bar.removebar();})
                    }   
                    _wrap_bar.append(_message_span).append(_remove_cross).hide().insertBefore($('.content')).fadeIn('fast');
                }
            })


        });
    };
    var timeout;
    $.fn.bar.removebar  = function(txt) {
        if($('.jbar').length){
            clearTimeout(timeout);
            $('.jbar').fadeOut('fast',function(){
                $(this).remove();
            });
        }   
    };
    $.fn.bar.defaults = {
        background_color    : '#FFFFFF',
        color               : '#000',
        position            : 'top',
        removebutton        : true,
        time                : 5000  
    };

})(jQuery);

Im certain the index.html is in need of change as to how it loads the notification. but i dont know what to edit. please help as i want to learn this.

  • 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-01T20:02:31+00:00Added an answer on June 1, 2026 at 8:02 pm

    The quick and dirty way would be to call

    $("#msgup").click();
    

    right after you do all of your

    $("#msgup").bar({
      ...
    });
    

    stuff.

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

Sidebar

Related Questions

Need some advice on architecture. I've built a chess site, and want to add
Need some help from javascript gurus. I have one page where http://www.google.com/finance/converter is embedded
Need some advice to use iframe for widget or not. Will some addons/plugin block
Need some help about with Memcache. I have created a class and want to
Need some best practice advice here... Navigation based application. Root view is a UITableView
I'm using this jQuery Validation script to submit my form(s), but I need some
Need some advice on how to optimize my articles table for read operations. I
I need some help tweaking my code to look for another attribute in this
Need some advice, I'm after a decent process/task manager for Ubuntu. Basically I have
Need some advice on creating a floating menu that behaves very similar to what

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.