Random announcement on the homepage of a website implemented by js

Source: Internet
Author: User

Random announcements on the home page

Search in default.html:
<Div id = "blogfrm"> <! -- Log Forum Framework --> insert code here <div class = "post cate14 auth6">

<Div class = "pop1"> <script Language = "JavaScript">
Tips = new Array (7 );
Tips [0] = "it's a temporary pain. Don't always ask:" Why is it me ?" ---- Happy fall, you have never asked this question ";
Tips [1] = "what is the basis for O rate cutting of the O-rate of the sub-catalogue? Nbsp; ---- Western Philosophy ";
Tips [2] = "is not whether you can find an ideal partner, but whether you can be an ideal partner. ---- The secret of happy marriage ";
Tips [3] = "a magnificent wedding may be a transaction; a simple and unpretentious wedding often has a real love. ---- Poor husband and wife are more emotional ";
Tips [4] = "say what you want most, do what you want most, and love the people you want most. ---- The true way to live ";
Tips [5] = "some people always lament that they cannot find love, but the reason is that their lover's heart is full of moss. ---- People love to learn love first ";
Tips [6] = "Show your technology to more people and bring convenience and pleasure to others! ---- Best practice of technicians ";

Index = Math. floor (Math. random () * tips. length );
Document. write (tips [index]);
</Script> </a>
</Div>
Add it to the CSS file. You can change it to your favorite style.
. Pop1 {background-color: # FFFF00; border: 1px solid # CBDFE9; color: # 247CAB; text-align: left;
Height: 15px; line-height: 15px; position: relative; margin-bottom: 10px ;}
. Pop1. blank {height: 15px; width: 0 ;}
Generally speaking ~ Of course, I didn't use every program to test it ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.