imageviewer.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <html>
  2. <head>
  3. <meta charset="utf-8">
  4. <title>Hello MUI</title>
  5. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
  6. <meta name="apple-mobile-web-app-capable" content="yes">
  7. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  8. <!--标准mui.css-->
  9. <link rel="stylesheet" href="../css/mui.min.css">
  10. <!--App自定义的css-->
  11. <style type="text/css">
  12. .mui-preview-image.mui-fullscreen {
  13. position: fixed;
  14. z-index: 20;
  15. background-color: #000;
  16. }
  17. .mui-preview-header,
  18. .mui-preview-footer {
  19. position: absolute;
  20. width: 100%;
  21. left: 0;
  22. z-index: 10;
  23. }
  24. .mui-preview-header {
  25. height: 44px;
  26. top: 0;
  27. }
  28. .mui-preview-footer {
  29. height: 50px;
  30. bottom: 0px;
  31. }
  32. .mui-preview-header .mui-preview-indicator {
  33. display: block;
  34. line-height: 25px;
  35. color: #fff;
  36. text-align: center;
  37. margin: 15px auto 4;
  38. width: 70px;
  39. background-color: rgba(0, 0, 0, 0.4);
  40. border-radius: 12px;
  41. font-size: 16px;
  42. }
  43. .mui-preview-image {
  44. display: none;
  45. -webkit-animation-duration: 0.5s;
  46. animation-duration: 0.5s;
  47. -webkit-animation-fill-mode: both;
  48. animation-fill-mode: both;
  49. }
  50. .mui-preview-image.mui-preview-in {
  51. -webkit-animation-name: fadeIn;
  52. animation-name: fadeIn;
  53. }
  54. .mui-preview-image.mui-preview-out {
  55. background: none;
  56. -webkit-animation-name: fadeOut;
  57. animation-name: fadeOut;
  58. }
  59. .mui-preview-image.mui-preview-out .mui-preview-header,
  60. .mui-preview-image.mui-preview-out .mui-preview-footer {
  61. display: none;
  62. }
  63. .mui-zoom-scroller {
  64. position: absolute;
  65. display: -webkit-box;
  66. display: -webkit-flex;
  67. display: flex;
  68. -webkit-box-align: center;
  69. -webkit-align-items: center;
  70. align-items: center;
  71. -webkit-box-pack: center;
  72. -webkit-justify-content: center;
  73. justify-content: center;
  74. left: 0;
  75. right: 0;
  76. bottom: 0;
  77. top: 0;
  78. width: 100%;
  79. height: 100%;
  80. margin: 0;
  81. -webkit-backface-visibility: hidden;
  82. }
  83. .mui-zoom {
  84. -webkit-transform-style: preserve-3d;
  85. transform-style: preserve-3d;
  86. }
  87. .mui-slider .mui-slider-group .mui-slider-item img {
  88. width: auto;
  89. height: auto;
  90. max-width: 100%;
  91. max-height: 100%;
  92. }
  93. .mui-android-4-1 .mui-slider .mui-slider-group .mui-slider-item img {
  94. width: 100%;
  95. }
  96. .mui-android-4-1 .mui-slider.mui-preview-image .mui-slider-group .mui-slider-item {
  97. display: inline-table;
  98. }
  99. .mui-android-4-1 .mui-slider.mui-preview-image .mui-zoom-scroller img {
  100. display: table-cell;
  101. vertical-align: middle;
  102. }
  103. .mui-preview-loading {
  104. position: absolute;
  105. width: 100%;
  106. height: 100%;
  107. top: 0;
  108. left: 0;
  109. display: none;
  110. }
  111. .mui-preview-loading.mui-active {
  112. display: block;
  113. }
  114. .mui-preview-loading .mui-spinner-white {
  115. position: absolute;
  116. top: 50%;
  117. left: 50%;
  118. margin-left: -25px;
  119. margin-top: -25px;
  120. height: 50px;
  121. width: 50px;
  122. }
  123. .mui-preview-image img.mui-transitioning {
  124. -webkit-transition: -webkit-transform 0.5s ease, opacity 0.5s ease;
  125. transition: transform 0.5s ease, opacity 0.5s ease;
  126. }
  127. @-webkit-keyframes fadeIn {
  128. 0% {
  129. opacity: 0;
  130. }
  131. 100% {
  132. opacity: 1;
  133. }
  134. }
  135. @keyframes fadeIn {
  136. 0% {
  137. opacity: 0;
  138. }
  139. 100% {
  140. opacity: 1;
  141. }
  142. }
  143. @-webkit-keyframes fadeOut {
  144. 0% {
  145. opacity: 1;
  146. }
  147. 100% {
  148. opacity: 0;
  149. }
  150. }
  151. @keyframes fadeOut {
  152. 0% {
  153. opacity: 1;
  154. }
  155. 100% {
  156. opacity: 0;
  157. }
  158. }
  159. p img {
  160. max-width: 100%;
  161. height: auto;
  162. }
  163. </style>
  164. </head>
  165. <body>
  166. <header class="mui-bar mui-bar-nav">
  167. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
  168. <h1 class="mui-title">image viewer(图片预览)</h1>
  169. </header>
  170. <div class="mui-content">
  171. <div class="mui-content-padded">
  172. <p>这是图片放大预览示例,点击如下图片体验全屏预览功能</p>
  173. <p>
  174. <img src="../images/yuantiao.jpg" data-preview-src="" data-preview-group="1" />
  175. </p>
  176. <p>图片全屏后,双击或双指缩放均可对图片进行放大、缩小操作,左右滑动可查看同组(data-preview-group相同的图片为一组)其它图片,点击会关闭预览</p>
  177. <p>
  178. <img src="../images/muwu.jpg" data-preview-src="" data-preview-group="1" />
  179. </p>
  180. <p>第三张图片,纯粹为了占位: </p>
  181. <p>
  182. <img src="../images/shuijiao.jpg" data-preview-src="" data-preview-group="1" />
  183. </p>
  184. </div>
  185. </div>
  186. </body>
  187. <script src="../js/mui.min.js"></script>
  188. <script src="../js/mui.zoom.js"></script>
  189. <script src="../js/mui.previewimage.js"></script>
  190. <script>
  191. mui.previewImage();
  192. </script>
  193. </html>