欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

JQuery浮動DIV提示信息并自動隱藏的代碼

 更新時間:2010年08月29日 23:01:52   作者:  
浮動DIV定時顯示提示信息,如操作成功, 失敗等,使用jquery的朋友可以參考下。
復(fù)制代碼 代碼如下:

/**
* 浮動DIV定時顯示提示信息,如操作成功, 失敗等
* @param string tips (提示的內(nèi)容)
* @param int height 顯示的信息距離瀏覽器頂部的高度
* @param int time 顯示的時間(按秒算), time > 0
* @sample <a href="javascript:void(0);" onclick="showTips( '操作成功', 100, 3 );">點(diǎn)擊</a>
* @sample 上面代碼表示點(diǎn)擊后顯示操作成功3秒鐘, 距離頂部100px
* @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' : 12 + 'px',
'margin' : '0 auto',
'text-align': 'center',
'width' : 'auto',
'color' : '#fff',
'opacity' : '0.8'
}).show();
setTimeout( function(){$( 'div.tipsClass' ).fadeOut();}, ( time * 1000 ) );
}

相關(guān)文章

最新評論