信息框出现位置的理解

来源:互联网 发布:无创dna数据看性别图 编辑:程序博客网 时间:2024/06/05 19:57
  1. //这是一些对信息提示出现在不同地方的不同代码//
  2. //信息提示出现在左上角//
  3. function topLeft(){
  4. $.messager.show({
  5. title:'My Title',
  6. msg:'The message content',
  7. showType:'show',
  8. style:{
  9. right:'',
  10. left:0,
  11. top:document.body.scrollTop+document.documentElement.scrollTop,
  12. bottom:''
  13. }
  14. });
  15. }

  16. //信息提示出现在中间上方//
  17. function topCenter(){
  18. $.messager.show({
  19. title:'My Title',
  20. msg:'The message content',
  21. showType:'slide',
  22. style:{
  23. right:'',
  24. top:document.body.scrollTop+document.documentElement.scrollTop,
  25. bottom:''
  26. }
  27. });
  28. }

  29. //信息提示出现在右上角//
  30. function topRight(){
  31. $.messager.show({
  32. title:'My Title',
  33. msg:'The message content',
  34. showType:'show',
  35. style:{
  36. left:'',
  37. right:0,
  38. top:document.body.scrollTop+document.documentElement.scrollTop,
  39. bottom:''
  40. }
  41. });
  42. }

  43. //信息提示出现在左靠边//
  44. function centerLeft(){
  45. $.messager.show({
  46. title:'My Title',
  47. msg:'The message content',
  48. showType:'fade',
  49. style:{
  50. left:0,
  51. right:'',
  52. bottom:''
  53. }
  54. });
  55. }

  56. //信息提示出现在中间//
  57. function center(){
  58. $.messager.show({
  59. title:'My Title',
  60. msg:'The message content',
  61. showType:'fade',
  62. style:{
  63. right:'',
  64. bottom:''
  65. }
  66. });
  67. }

  68. //信息提示出现在右靠边//
  69. function centerRight(){
  70. $.messager.show({
  71. title:'My Title',
  72. msg:'The message content',
  73. showType:'fade',
  74. style:{
  75. left:'',
  76. right:0,
  77. bottom:''
  78. }
  79. });
  80. }

  81. //信息提示出现在左下角//
  82. function bottomLeft(){
  83. $.messager.show({
  84. title:'My Title',
  85. msg:'The message content',
  86. showType:'show',
  87. style:{
  88. left:0,
  89. right:'',
  90. top:'',
  91. bottom:-document.body.scrollTop-document.documentElement.scrollTop
  92. }
  93. });
  94. }

  95. //信息提示出现在中间下方//
  96. function bottomCenter(){
  97. $.messager.show({
  98. title:'My Title',
  99. msg:'The message content',
  100. showType:'slide',
  101. style:{
  102. right:'',
  103. top:'',
  104. bottom:-document.body.scrollTop-document.documentElement.scrollTop
  105. }
  106. });
  107. }

  108. //信息提示出现在右下角//
  109. function bottomRight(){
  110. $.messager.show({
  111. title:'My Title',
  112. msg:'The message content',
  113. showType:'show'
  114. });
  115. }
0 0
原创粉丝点击