- //这是一些对信息提示出现在不同地方的不同代码//
- //信息提示出现在左上角//
- function topLeft(){
- $.messager.show({
- title:'My Title',
- msg:'The message content',
- showType:'show',
- style:{
- right:'',
- left:0,
- top:document.body.scrollTop+document.documentElement.scrollTop,
- bottom:''
- }
- });
- }
-
- //信息提示出现在中间上方//
- function topCenter(){
- $.messager.show({
- title:'My Title',
- msg:'The message content',
- showType:'slide',
- style:{
- right:'',
- top:document.body.scrollTop+document.documentElement.scrollTop,
- bottom:''
- }
- });
- }
-
- //信息提示出现在右上角//
- function topRight(){
- $.messager.show({
- title:'My Title',
- msg:'The message content',
- showType:'show',
- style:{
- left:'',
- right:0,
- top:document.body.scrollTop+document.documentElement.scrollTop,
- bottom:''
- }
- });
- }
-
- //信息提示出现在左靠边//
- function centerLeft(){
- $.messager.show({
- title:'My Title',
- msg:'The message content',
- showType:'fade',
- style:{
- left:0,
- right:'',
- bottom:''
- }
- });
- }
-
- //信息提示出现在中间//
- function center(){
- $.messager.show({
- title:'My Title',
- msg:'The message content',
- showType:'fade',
- style:{
- right:'',
- bottom:''
- }
- });
- }
-
- //信息提示出现在右靠边//
- function centerRight(){
- $.messager.show({
- title:'My Title',
- msg:'The message content',
- showType:'fade',
- style:{
- left:'',
- right:0,
- bottom:''
- }
- });
- }
-
- //信息提示出现在左下角//
- function bottomLeft(){
- $.messager.show({
- title:'My Title',
- msg:'The message content',
- showType:'show',
- style:{
- left:0,
- right:'',
- top:'',
- bottom:-document.body.scrollTop-document.documentElement.scrollTop
- }
- });
- }
-
- //信息提示出现在中间下方//
- function bottomCenter(){
- $.messager.show({
- title:'My Title',
- msg:'The message content',
- showType:'slide',
- style:{
- right:'',
- top:'',
- bottom:-document.body.scrollTop-document.documentElement.scrollTop
- }
- });
- }
-
- //信息提示出现在右下角//
- function bottomRight(){
- $.messager.show({
- title:'My Title',
- msg:'The message content',
- showType:'show'
- });
- }
信息框出现位置的理解
最新推荐文章于 2018-09-19 16:04:59 发布