java notification running lamp effect (text scrolling)

Keywords: JSP JSON


It's not hard for me to be ashamed to do this function, but I still encounter various problems. Here's a note:
This is my home page. A notice appears on the top of the home page to let users see the latest information

Find "marquee" plug-in Online

Refer to:

Of course, you can also refer to me to obtain the complete columns of dynamic data:
First: you can refer to the first link:
Load css js
jsp code

        <ul id="marquee" class="marquee" style="margin-top: 10px;margin-left: 14.5px;" >

css can be changed to what you need: the official style is "write dead", which can be changed. This is my project's change:

ul.marquee {
    /* required styles */
    padding: 0;
    margin: 0;
    list-style: none;
    line-height: 1;
    position: relative;
    overflow: hidden;
    /* optional styles for appearance */
    width: 97.5%;
    height: 40px; /* height should be included to reserve visual space for the marquee */
    /*border: 1px solid #08084d;*/
    background-color: #3a99d9;

ul.marquee li {
    /* required styles */
    position: absolute;
    top: -999em;
    left: 0;
    display: block;
    white-space: nowrap; /* keep all text on a single line */

    /* optional styles for appearance */
    font: 20px Arial, Helvetica, sans-serif;
    padding: 3px 5px;

Then js:

function getinform(){
     url: 'messageShow/',     
      type: 'post',                 //Get data by: post/get           
      dataType:'json',            //data format
        var obj =;
        var len = obj.length;

        var marqueeHtml = "";
        for(var i=0;i<len;i++){
            var title= obj[i].title;
            var content= obj[i].content;
            var create_time = obj[i].create_time;

            if(create_time != null)
                create_time = parseTime_x(create_time);
                create_time = "";
            marqueeHtml+="<li onclick='show_li_message($(this));'>"
        //Splicing li
        //Call method  

Finally, initialize the method. The background method is getall to query all of them. Although it's not difficult, there is a problem during the process. At the beginning, the official demo is used directly, Then, we use the splicing method to generate no data, only the simulation data can be generated, which may be the same reason that I call the method directly as the demo. Then we need to click the scrolling text to display the details. Solution:
Add an onclick event to li, get the value of each li, and then display the data.

function show_li_message(obj){
        var obj =; 
        $("#content_show").val(obj.title+"      "+obj.content+"     "+obj.create_time);

Posted by seangamer on Sun, 03 May 2020 18:30:56 -0700