Js simple and beautiful prompt box, js

Source: Internet
Author: User

Js simple and beautiful prompt box, js

<Span style = "font-size: 14px;"> function showTips (txt, time, status) {var htmlCon = ''; if (txt! = '') {If (status! = 0 & status! = Undefined) {htmlCon = '<div class = "tipsBox" style = "width: 220px; padding: 10px; background-color: #4AAF33; border-radius: 4px; -webkit-border-radius: 4px;-moz-border-radius: 4px; box-shadow: 0 0 3px # ddd inset;-webkit-box-shadow: 0 0 3px # ddd inset; text-align: center; position: fixed; top: 25%; left: 50%; z-index: 999999; margin-left:-120px; ">  '+ txt +' </div> ';} else {htmlCon =' <div class =" tipsBox "style =" width: 220px; padding: 10px; background-color: # F75058; border-radius: 4px;-webkit-border-radius: 4px;-moz-border-radius: 4px; box-shadow: 0 0 3px # ddd inset;-webkit-box-shadow: 0 0 3px # ddd inset; text-align: center; position: fixed; top: 25%; left: 50%; z-index: 999999; margin-left:-120px; ">  '+ txt +' </div> ';} $ ('body '). prepend (htmlCon); if (time = ''| time = undefined) {time = 1500;} setTimeout (function () {$ ('. tipsbox '). remove () ;}, time );} <p >}</span> </p> <p>/* </p> <p> This method can be directly copied and used. parameters: the text string is the prompt message. The text time integer is the time unit of automatic disappearance in milliseconds. For example, if the value of 1000 status integer 1 and 0 are 1, the message is displayed correctly. The background is green, the image is marked as a symbol. If it is 0, the background is red. Note: Due to image uploading problems, you can search for images 16*16 by yourself. </span> welcome to the Java discussion group: 398918539 </p> <p> */</p>

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.