首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

JUQERY兑现的提示信息页

2012-09-02 
JUQERY实现的提示信息页/** * 浮动DIV定时显示提示信息,如操作成功, 失败等 * @param string tips (提示的

JUQERY实现的提示信息页

/** * 浮动DIV定时显示提示信息,如操作成功, 失败等 * @param string tips (提示的内容) * iWidth;                          //弹出窗口的宽度;* iHeight;                         //弹出窗口的高度;   * @param int time 显示的时间(按秒算), time > 0 */ function showTips( tips, time ,iWidth,iHeight){ var windowWidth = document.documentElement.clientWidth; var tipsDiv = '<div class="tipsClass">' + tips + '</div>'; $( 'body' ).append( tipsDiv ); $( 'div.tipsClass' ).css({ 'top' :(window.screen.availHeight-30-iHeight)/2 + 'px', 'left' :  (window.screen.availWidth-10-iWidth)/2 + 'px', 'position' : 'absolute', 'padding' : '3px 5px', 'background': '#F2F6F9', 'font-size' : 15 + 'px', 'margin' : '0 auto', 'text-align': 'center', 'width' : 'auto', 'color' : '#000','font-weight': 'bolder', 'opacity' : '0.8','border': '2px solid #34A7DB'}).show(); setTimeout( function(){$( 'div.tipsClass' ).fadeOut();}, ( time * 1000 ) ); } 

?调用方法:

showTips( '此功能【'+name+'】已经打开了',2,100,100);

热点排行