EasyUI Forum
March 29, 2024, 08:11:53 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: $.messager slide origin position  (Read 17500 times)
angers
Newbie
*
Posts: 11


View Profile Email
« on: August 04, 2012, 04:10:15 PM »

I really like your messager, but I've been struggling to figure out a way to change the origin point of the 'showType' option.

Code:
$.messager.show({
title:'My Title',
msg:'Message will be closed after 5 seconds.',
timeout:5000,
showType:'slide'
});

If I want a $.messager instance to slide in from the top of the page, instead of the bottom...how do I do this?


NOTE:

I see that I can hardcode the change in jquery.messager.js, obviously:

Code:
win.window("window").css({
left: "",
top: "",
right: 0,
zIndex: $.fn.window.defaults.zIndex++,
bottom: -document.body.scrollTop - document.documentElement.scrollTop
});


But this is highly undesirable because as a matter of practice I'll have to convert all of these hacks manually on the next release. I'm trying to figure out a way to prototype the function while retaining scope for all the private variables you reference...



Wish you would have just added a position option.
« Last Edit: August 04, 2012, 04:36:51 PM by angers » Logged
angers
Newbie
*
Posts: 11


View Profile Email
« Reply #1 on: August 04, 2012, 05:01:21 PM »


This is the best thing I could come up with. I wish you would have made the private methods accessible with getters instead of making everything impossible to access if it's not in the defaults.

Code:
win.window("window").css({left:"",top:0,right:0,zIndex:$.fn.window.defaults.zIndex++});
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #2 on: August 07, 2012, 12:07:50 AM »

This feature will be supported in next version. Please download the preview messager plugin from http://www.jeasyui.com/easyui/plugins/jquery.messager.js.

Some usage examples:
Code:
// show message window on top left
$.messager.show({
title:'My Title',
msg:'Message will be closed after 4 seconds.',
showType:'show',
style:{
left:0,
right:'',
top:document.body.scrollTop+document.documentElement.scrollTop,
bottom:''
}
});
// show message window on bottom left
$.messager.show({
title:'My Title',
msg:'Message will be closed after 4 seconds.',
showType:'show',
style:{
left:0,
right:'',
top:'',
bottom:-document.body.scrollTop-document.documentElement.scrollTop
}
});
// show message window on top right
$.messager.show({
title:'My Title',
msg:'Message will be closed after 4 seconds.',
showType:'show',
style:{
left:'',
right:0,
top:document.body.scrollTop+document.documentElement.scrollTop,
bottom:''
}
});
// show message window on center
$.messager.show({
title:'My Title',
msg:'Message will be closed after 4 seconds.',
showType:'show',
style:{
right:'',
bottom:''
}
});
// show message window on top center
$.messager.show({
title:'My Title',
msg:'Message will be closed after 4 seconds.',
showType:'show',
style:{
right:'',
top:document.body.scrollTop+document.documentElement.scrollTop,
bottom:''
}
});
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!