0ac15759892af5dc4bf5cb88a5f2c9de8a386d65.svn-base 3.4 KB

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