Title: Inserting Javascript Notification jBar after StickyHeader/Header
Last modified: September 19, 2016

---

# Inserting Javascript Notification jBar after StickyHeader/Header

 *  [theweedwizard](https://wordpress.org/support/users/theweedwizard/)
 * (@theweedwizard)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/inserting-javascript-notification-jbar-after-stickyheaderheader/)
 * I would like to insert the following code right after the sticky-header/header:
 *     ```
       <script>
       $('#notify').click(function() {
         $(this).slideUp().empty();
       });
   
       $(function() {
         $('#notify').html('Welcome to the test page!').slideDown();
       });
       </script>
       <div id="notify"></div>
       ```
   
 * Any help? A similar example can be seen here: [http://jsfiddle.net/AlienWebguy/Azh4b/](http://jsfiddle.net/AlienWebguy/Azh4b/)
 * Thanks in advance.
    -  This topic was modified 9 years, 8 months ago by [theweedwizard](https://wordpress.org/support/users/theweedwizard/).
    -  This topic was modified 9 years, 8 months ago by [theweedwizard](https://wordpress.org/support/users/theweedwizard/).

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [Menaka S.](https://wordpress.org/support/users/menakas/)
 * (@menakas)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/inserting-javascript-notification-jbar-after-stickyheaderheader/#post-8200559)
 * Hi,
    Add this to your child theme’s functions.php
 *     ```
       add_action('__after_header' , 'add_my_javascript');
       function add_my_javascript() {
           ?>
           <script type="text/javascript">
                   YOUR SCRIPT HERE
           </script>
           <?php
       }
       ```
   
 *  Thread Starter [theweedwizard](https://wordpress.org/support/users/theweedwizard/)
 * (@theweedwizard)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/inserting-javascript-notification-jbar-after-stickyheaderheader/#post-8201334)
 * Hey Menaka,
 * Thanks for the help. Unfortunately, the snippet doesn’t work.
 * [https://moneroapparel.com](https://moneroapparel.com) if you woudl liek to see
 *  [Menaka S.](https://wordpress.org/support/users/menakas/)
 * (@menakas)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/inserting-javascript-notification-jbar-after-stickyheaderheader/#post-8201472)
 * Hi,
    I can see two opening script tags. One in the code I have given and one 
   from yours… Try to make changes to make it single
 *  Thread Starter [theweedwizard](https://wordpress.org/support/users/theweedwizard/)
 * (@theweedwizard)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/inserting-javascript-notification-jbar-after-stickyheaderheader/#post-8202114)
 * I tried that first. It doesn’t make a difference.
 *  [Menaka S.](https://wordpress.org/support/users/menakas/)
 * (@menakas)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/inserting-javascript-notification-jbar-after-stickyheaderheader/#post-8204719)
 * Hi,
    The snippet works in that it has added the code after header. This is what
   is there on your site. Do remove the extra <script> in the second line.
 *     ```
       <script type="text/javascript">
           <script>
       $('#notify').click(function() {
         $(this).slideUp().empty();
       });
   
       $(function() {
         $('#notify').html('Welcome to the test page!').slideDown();
       });
       </script>
       ```
   
 * If you mean that the script does not do what you intend it to do, it is a different
   question.
    -  This reply was modified 9 years, 8 months ago by [Menaka S.](https://wordpress.org/support/users/menakas/).
 *  Thread Starter [theweedwizard](https://wordpress.org/support/users/theweedwizard/)
 * (@theweedwizard)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/inserting-javascript-notification-jbar-after-stickyheaderheader/#post-8205910)
 * I have it how you requested currently. Still does to seem to hold.
 *  [Menaka S.](https://wordpress.org/support/users/menakas/)
 * (@menakas)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/inserting-javascript-notification-jbar-after-stickyheaderheader/#post-8208743)
 * Hi,
    I can see the script added after the header. If your question is how to 
   make the script work/do what you intend it to do, then please tell what you hope
   to achieve with this script.
    -  This reply was modified 9 years, 8 months ago by [Menaka S.](https://wordpress.org/support/users/menakas/).
 *  Thread Starter [theweedwizard](https://wordpress.org/support/users/theweedwizard/)
 * (@theweedwizard)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/inserting-javascript-notification-jbar-after-stickyheaderheader/#post-8208834)
 * I would liek to add a collapsible div, in this case a javascript notification
   bar, that says a coupon code, ie, “Enter Coupon Code MENAKA2016 for 1000% off
   all items”.
 * My CSS:
 *     ```
       #notify {
           position:relative;
           width:100%;
           background-color:orange;
           height:50px;
           color:white;
           display:none;
       }
       ```
   
    -  This reply was modified 9 years, 8 months ago by [theweedwizard](https://wordpress.org/support/users/theweedwizard/).

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Inserting Javascript Notification jBar after StickyHeader/Header’ is 
closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/customizr/4.4.24/screenshot.png)
 * Customizr
 * [Support Threads](https://wordpress.org/support/theme/customizr/)
 * [Active Topics](https://wordpress.org/support/theme/customizr/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/customizr/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/customizr/reviews/)

## Tags

 * [header](https://wordpress.org/support/topic-tag/header/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * 8 replies
 * 2 participants
 * Last reply from: [theweedwizard](https://wordpress.org/support/users/theweedwizard/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/inserting-javascript-notification-jbar-after-stickyheaderheader/#post-8208834)
 * Status: not resolved