position.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Message Box Position - jQuery EasyUI Demo</title>
  6. <link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
  7. <link rel="stylesheet" type="text/css" href="../../themes/icon.css">
  8. <link rel="stylesheet" type="text/css" href="../demo.css">
  9. <script type="text/javascript" src="../../jquery.min.js"></script>
  10. <script type="text/javascript" src="../../jquery.easyui.min.js"></script>
  11. </head>
  12. <body>
  13. <h2>Message Box Position</h2>
  14. <div class="demo-info">
  15. <div class="demo-tip icon-tip"></div>
  16. <div>Click the buttons below to display message box on different position.</div>
  17. </div>
  18. <div style="margin:10px 0;">
  19. <p>
  20. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="topLeft();">TopLeft</a>
  21. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="topCenter()">TopCenter</a>
  22. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="topRight()">TopRight</a>
  23. </p>
  24. <p>
  25. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="centerLeft()">CenterLeft</a>
  26. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="center()">Center</a>
  27. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="centerRight()">CenterRight</a>
  28. </p>
  29. <p>
  30. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="bottomLeft()">BottomLeft</a>
  31. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="bottomCenter()">BottomCenter</a>
  32. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="bottomRight()">BottomRight</a>
  33. </p>
  34. </div>
  35. <script>
  36. function topLeft(){
  37. $.messager.show({
  38. title:'My Title',
  39. msg:'The message content',
  40. showType:'show',
  41. style:{
  42. right:'',
  43. left:0,
  44. top:document.body.scrollTop+document.documentElement.scrollTop,
  45. bottom:''
  46. }
  47. });
  48. }
  49. function topCenter(){
  50. $.messager.show({
  51. title:'My Title',
  52. msg:'The message content',
  53. showType:'slide',
  54. style:{
  55. right:'',
  56. top:document.body.scrollTop+document.documentElement.scrollTop,
  57. bottom:''
  58. }
  59. });
  60. }
  61. function topRight(){
  62. $.messager.show({
  63. title:'My Title',
  64. msg:'The message content',
  65. showType:'show',
  66. style:{
  67. left:'',
  68. right:0,
  69. top:document.body.scrollTop+document.documentElement.scrollTop,
  70. bottom:''
  71. }
  72. });
  73. }
  74. function centerLeft(){
  75. $.messager.show({
  76. title:'My Title',
  77. msg:'The message content',
  78. showType:'fade',
  79. style:{
  80. left:0,
  81. right:'',
  82. bottom:''
  83. }
  84. });
  85. }
  86. function center(){
  87. $.messager.show({
  88. title:'My Title',
  89. msg:'The message content',
  90. showType:'fade',
  91. style:{
  92. right:'',
  93. bottom:''
  94. }
  95. });
  96. }
  97. function centerRight(){
  98. $.messager.show({
  99. title:'My Title',
  100. msg:'The message content',
  101. showType:'fade',
  102. style:{
  103. left:'',
  104. right:0,
  105. bottom:''
  106. }
  107. });
  108. }
  109. function bottomLeft(){
  110. $.messager.show({
  111. title:'My Title',
  112. msg:'The message content',
  113. showType:'show',
  114. style:{
  115. left:0,
  116. right:'',
  117. top:'',
  118. bottom:-document.body.scrollTop-document.documentElement.scrollTop
  119. }
  120. });
  121. }
  122. function bottomCenter(){
  123. $.messager.show({
  124. title:'My Title',
  125. msg:'The message content',
  126. showType:'slide',
  127. style:{
  128. right:'',
  129. top:'',
  130. bottom:-document.body.scrollTop-document.documentElement.scrollTop
  131. }
  132. });
  133. }
  134. function bottomRight(){
  135. $.messager.show({
  136. title:'My Title',
  137. msg:'The message content',
  138. showType:'show'
  139. });
  140. }
  141. </script>
  142. </body>
  143. </html>