js操作效果之showTips与createBg
来源:互联网 发布:android 仿淘宝搜索 编辑:程序博客网 时间:2024/06/10 09:13
/** * 创建全屏透明背景层 * @param id */function createBg (id) { $('<div id = "' + id + '"></div>').appendTo('body').css({ 'width' : $(document).width(), 'height' : $(document).height(), 'position' : 'absolute', 'top' : 0, 'left' : 0, 'z-index' : 2, 'opacity' : 0.3, 'filter' : 'Alpha(Opacity = 30)', 'backgroundColor' : '#000' });}/**操作成功效果**/function showTips(tips,time,height){ var windowWidth = $(window).width();height=height?height:$(window).height(); time = time ? time : 1; var tipsDiv = '<div class="tipsClass">' + tips + '</div>'; $( 'body' ).append( tipsDiv ); $( 'div.tipsClass' ).css({ 'top' : height/2 + 'px', 'left' : ( windowWidth / 2 ) - 100 + 'px', 'position' : 'absolute', 'padding' : '3px 5px', 'background': '#670768', 'font-size' : 14 + 'px', 'text-align': 'center', 'width' : '300px', 'height' : '40px', 'line-height' : '40px', 'color' : '#fff', 'font-weight' : 'bold', 'opacity' : '0.8' }).show(); setTimeout( function(){ $( 'div.tipsClass' ).animate({ top: height/2-50+'px' }, "slow").fadeOut(); }, time * 1000);}
阅读全文
0 0
- js操作效果之showTips与createBg
- jquery之效果操作
- JS特效之打字机效果
- js之相册预览效果
- js效果之漂浮广告
- js效果之table切换
- js基础巩固之--数组的声明与操作
- iOS与js交互之如何执行自定义操作
- 操作等待效果,遮盖层js
- js操作静态图片移动效果
- js与iframe操作
- JS hasmap之操作
- JS之字符串操作
- 【js与jquery】jquery中的动画效果
- 【js与jquery】导航下拉菜单效果
- 文字与图片互相切换js效果
- js模拟动画之 商品展示效果
- 很好的JS效果,收藏之
- jxl导入导出Excel
- 51nod 1556 计算(默慈金数)
- IIS启动时的问题
- arcgis for js画扇形并给它填充不同的颜色
- system引发的问题
- js操作效果之showTips与createBg
- MySQL学习笔记(1)
- Codeforces Round #416 (Div. 2)
- setsockopt设置socket状态
- 推荐一款Mybatis分页插件
- DevOps之旅
- 帮助了解业务与筛选表的sql语句(包括查找字段在哪张表中存在)
- 信号与槽连接方式(同步和异步)
- 简述CDN,快速理解CDN