Copy Code code as follows:
/**
* Floating div timed display prompt information, such as Operation success, failure, etc.
* @param string Tips (content of hints)
* @param int height display information from the height of the top of the browser
* @param int time display (in seconds), Times > 0
* @sample <a href= "javascript:void (0);" onclick= "showtips (' operational success ', 100, 3);" > Click </a>
* @sample The above code indicates that the operation was successful 3 seconds after the click, 100px from the top
* @copyright Zhouhr 2010-08-27
*/
function showtips (tips, height, time) {
var windowwidth = document.documentElement.clientWidth;
var tipsdiv = ' <div class= ' tipsclass ' > ' + tips + ' </div> ';
$ (' body '). Append (Tipsdiv);
$ (' Div.tipsclass '). CSS ({
' Top ': Height + ' px ',
' Left ': (WINDOWWIDTH/2)-(Tips.length * 13/2) + ' px ',
' Position ': ' absolute ',
' Padding ': ' 3px 5px ',
' Background ': ' #8FBC8F ',
' font-size ': + ' px ',
' Margin ': ' 0 auto ',
' Text-align ': ' Center ',
' Width ': ' Auto ',
' Color ': ' #fff ',
' Opacity ': ' 0.8 '
). Show ();
settimeout (function () {$ (' Div.tipsclass '). fadeout ();}, (Time * 1000));
}