JSFiddle - React, Tailwind, and code Playground

by Kamlesh Gupta

HTML

<div id='notice'>
</div>
<pre>
    sxjasxahschsdichsdchidshciusdc
</pre>

CSS

#notice{
    display:block;
    z-index:1000;
    background:black;
    text:white;
    text-decoration:sans-sherif;
    top:50%;
    left:50%;
    width:auto;
    position: fixed;
    margin-top:-50px;
    margin-left:-50px;
}

JavaScript

$('#notice').html("Hello world").show().fadeOut(2000)
      $(document).ready(function(){
       
       var globalMsgSet=<?php echo json_encode($_GLOBALS['message']); ?>;
       if(globalMsgSet.trim()!=""||globalMsgSet.trim()!=null){
       $('#notice').html(globalMsgSet).show().fadeOut(3000);
       }
      
    });