Jquery 生成页面顶端的滑动弹出式提示框效果
2015-04-28 10:36
267 查看
html:
css:
来自这里
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <link rel="stylesheet" href="./test.css"> </head> <body> <div id="container"> <div id="notification"> <span id="msg"><i class="fa fa-info-circle"></i><span>系统错误,请稍后重试</span></span> <span id="close" class="fa fa-times"></span> </div> <button>系统提示</button> </div> </body> <script type="text/javascript" src="http://cdn.gbtags.com/jquery/1.11.1/jquery.min.js"></script> <script> $(function(){ $('button').off('click').on('click',function(){ $('#notification').animate({'top':-7}); }); $('#close').off('click').on('click',function(){ $('#notification').animate({'top':-45}); }); }); </script> </html>
css:
/*CSS源代码*/ @import url('http://cdn.gbtags.com/font-awesome/4.1.0/css/font-awesome.min.css'); button{ width: 80px; height: 40px; left: 50%; top: 50%; margin-left: -40px; margin-top: -20px; position: absolute; } body{ background:#CFCFCF; } #notification{ width:80%; line-height:35px; margin:0 auto; background:#efb73e; color:#fff; font-size:12px; position:relative; top:-45px; } #notification #msg i{margin:0 10px;} #notification #close{position:absolute;right:10px;top:10px;cursor:pointer;}
来自这里
相关文章推荐
- Flexslider图片轮播、文字图片相结合滑动切换效果HTML 首先在页面head部位载入jquery库文件和Flexslider插件,以及Flexslider所需的基本css样式文件。
- jQuery生成全页面的悬浮覆盖层效果(overlay)
- jQuery页面滑动效果实例
- jQuery页面内滑动到锚点导航效果,回到顶部
- js回到页面顶端以及jquery设置淡入淡出效果
- jquery实现表单输入时提示文字滑动向上效果
- jQuery实现页面内锚点平滑跳转 滑动效果
- jquery实现表单输入时提示文字滑动向上效果
- 使用Jquery实现顶部导航栏在页面滑动到自身所在位置之后固定在顶部的效果
- jquery上下页面视差滚动切换效果|强大的视差响应动画滑动图片切换效果
- jQuery实现弹窗下底部页面禁止滑动效果
- 使用Jquery实现顶部导航栏在页面滑动到自身所在位置之后固定在顶部的效果
- jQuery地图热点效果-鼠标经过弹出提示层信息
- JS实现页面加载完毕之前loading提示效果
- 前端页面实现报警器提示音效果
- 鼠标滑动显示不同页面的效果——————获取鼠标相对于整个页面的坐标
- jQuery oLoader实现的加载图片和页面效果
- ViewPage滑动背景渐变效果的Splash主页面
- ViewPager、Fragment、PagerTabStrip实现多页面滑动效果
- jQuery实现鼠标移到元素上动态提示消息框效果