HTML5仿苹果手机的面板合拢折叠效果

这是一个HTML5折叠菜单,但更像是一个折叠面板,仿苹果手机的passbook应用中的代码例子,请在火狐或chrome下浏览。不知道有没有听说过手机琴菜单,觉得这一个从形式上来说,是挺像的。

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  2. <html xmlns="http://www.w3.org/1999/xhtml">

  3. <head>

  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  5. <title>passbook仿苹果手机的面板合拢折叠效果-html5特效</title>

  6. <style>

  7. .pocket{

  8. width:300px;

  9. height:460px;

  10. padding: 10px;

  11. overflow: hidden;

  12. float: left;

  13. border: 1px solid #EDEDED;

  14. margin: 4px;

  15. border-radius: 8px;

  16. box-shadow:0 -5px 30px rgba(0,0,0,0.2) inset;

  17. }

  18. .passcard {

  19. float: left;

  20. width:300px;

  21. height:380px;

  22. color: #878787;

  23. text-align: center;

  24. padding-top: 5px;

  25. margin-bottom: -320px;

  26. cursor: pointer;

  27. }

  28. .starbucks{

  29. background:url(/jscss/demoimg/201307/starbucks.png) no-repeat;

  30. }

  31. .airport{

  32. background:url(/jscss/demoimg/201307/airport.png) no-repeat;

  33. }

  34. .paper{

  35. border: 1px solid #EDEDED;

  36. color: #A8A8A8;

  37. text-align: center;

  38. font:26px 'Segoe UI Light',Helvetica,Arial,'Sans-Serif';

  39. background:-webkit-gradient(linear,left top,left bottom,color-stop(50%,rgba(229, 249, 249, 1)),color-stop(100%,rgba(240, 240, 240, 1)));

  40. background: -webkit-linear-gradient(top,rgba(249, 249, 249, 1) 50%,rgba(240, 240, 240, 1) 100%);

  41. background: -moz-linear-gradient(top,rgba(249, 249, 249, 1) 50%,rgba(240, 240, 240, 1) 100%);

  42. background: -o-linear-gradient(top,rgba(249, 249, 249, 1) 50%,rgba(240, 240, 240, 1) 100%);

  43. background: -ms-linear-gradient(top,rgba(249, 249, 249, 1) 50%,rgba(240, 240, 240, 1) 100%);

  44. background: linear-gradient(top,rgba(249, 249, 249, 1) 50%,rgba(240, 240, 240, 1) 100%);

  45. background: -webkit-linear-gradient(top,rgba(255, 255, 255, 0.05) 0%,rgba(255, 255, 255, 0.05) 20%,rgba(0, 0, 0, 0.05) 100%);

  46. border-radius:14px;

  47. box-shadow:-2px -1px 2px rgba(0,0,0,0.1);

  48. }

  49. .pod {

  50. background: none repeat scroll 0 0 white;

  51. cursor: pointer;

  52. height: 160px;

  53. width: 300px;

  54. border: 1px solid #CDCDCD;

  55. border-radius: 6px;

  56. float: left;

  57. margin: 3px 15px 15px 3px;

  58. box-shadow: 0 0 3px rgba(0, 0, 0, 0.2),0 -4px 0 #E8E8E8 inset;

  59. }

  60. </style>

  61. </head>

  62. <body>

  63. <div class='pocket'>

  64. <div class='passcard starbucks'></div>

  65. <div class='passcard starbucks'></div>

  66. <div class='passcard starbucks'></div>

  67. </div>

  68. <div class='pocket'>

  69. <div class='passcard airport'></div>

  70. <div class='passcard airport'></div>

  71. <div class='passcard airport'></div><div class='passcard airport'></div>

  72. </div>

  73. <div class='pocket'>

  74. <div class='passcard paper'>passcard 1</div>

  75. <div class='passcard paper'>passcard 2</div>

  76. <div class='passcard paper'>passcard 3</div>

  77. </div>

  78. </body>

  79. <script type="text/javascript" src="/ajaxjs/jquery-1.7.2.min.js"></script>

  80. <script type="text/javascript">

  81. $(function(){

  82. $('.passcard').hover(function(){

  83. $(this).stop(false,false).animate({'margin-bottom':'-100px'},400)

  84. },function(){

  85. $(this).stop(false,false).animate({'margin-bottom':'-320px'},400)

  86. })

  87. })

  88. </script>

  89. </script>

  90. </html>

复制代码

文章来源:http://www.youjobit.com/news_114.html

转载于:https://my.oschina.net/u/2000963/blog/305254

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值