js提示小插件
2014-09-19 18:07
85 查看
/* *提示插件 *使用方法:showTip('提示内容',3) */ var tip = null; //显示提示文本,text为要显示的文本,second表示自动消失的秒数 function showTip(text,second){ if(!tip){ tip = document.createElement('div'); tip.style.backgroundColor = '#000'; tip.style.color = '#fff'; tip.style.fontSize = '18px'; tip.style.fontWeight = 'bold'; tip.style.fontFamily = '微软雅黑'; tip.style.width = 'auto'; tip.style.height = 'auto'; tip.style.padding = '10px 30px 10px 30px'; tip.style.borderRadius = '6px'; tip.style.opacity = '0.7'; tip.style.position = 'fixed'; tip.style.zIndex = '99999'; document.body.appendChild(tip); } tip.innerHTML = text; tip.style.display = 'inline-block'; tip.style.top = (document.documentElement.clientHeight/2 - tip.offsetHeight/2) + 'px'; tip.style.left = (document.documentElement.clientWidth/2 - tip.offsetWidth/2) + 'px'; setTimeout(function disappear(){ tip.style.display = 'none'; },second*1000); }
相关文章推荐
- jQuery 中插件的使用与开发---附全部源码(含 jQuery1.3.2 for VS 的智能提示js文件)
- jQuery 中插件的使用与开发---附全部源码(含 jQuery1.3.2 for VS 的智能提示js文件)
- Toolbar.Js - 帮助你创建提示风格的工具条jQuery插件
- 关于jquery.autocomplete.js自动提示插件中文乱码问题
- 创建提示风格的工具条jQuery插件_Toolbar.Js
- 在NebBean中配置常用插件-调试/预览页面/打开项目文件夹/JS代码提示
- jQuery 中插件的使用与开发---附全部源码(含 jQuery1.3.2 for VS 的智能提示js文件)
- Toolbar.Js - 帮助你创建提示风格的工具条jQuery插件
- 页面中使用已经引入的jquery插件,结果却提示JS报错找不到函数【问题解决】
- 实现输入内容提示的功能(仿google_百度输入框提示)jquery.ui.autocomplete.js插件
- jQuery 中插件的使用与开发-启用Visual Studio 对jQuery的智能感知(含 jQuery1.3.2 for VS 的智能提示js文件)
- myeclipse 8.5 安装aptana插件 提示jQuery、js、css、html
- 仿百度搜索输入框提示JS代码(PHP+MySql数据库版)(基于jquery.autocomplete.js插件)
- Toolbar.Js - 帮助你创建提示风格的工具条jQuery插件
- inputSuggest邮箱提示自动补全js插件
- Ext智能提示 - JSEclipse(Eclipse插件)
- MyEclipse的JavaScript提示插件(JSEclipse)
- Ext开发插件Spket(js代码自动提示)
- Zend Studio 上 安装使用Aptana插件(html,css,js代码提示功能)
- spket--eclipse插件,支持js框架提示