【转载】extaspnet 实现右下角小贴士
本文转自:http://blog.csdn.net/vazumi/article/details/6462181
说是extaspnet实现右下角弹消息框,其实就是纯extjs,baidu搜索一大堆代码
咱只是搬过来直接用,谈不上原创
废话少说,上代码,在页面前端加入这段JS代码
<script type="text/javascript">
Ext.ns('MyLib');
;(function($) {
//新建window组,避免被其它window影响显示在最前的效果
var tipsGroupMgr = new Ext.WindowGroup();
tipsGroupMgr.zseed=99999; //将小贴士窗口前置
$.TipsWindow = Ext.extend(Ext.Window, {
width:200,
height:150,
layout:'fit',
modal : false,
plain: true,
shadow:false, //去除阴影
draggable:false, //默认不可拖拽
resizable:false,
closable: true,
closeAction:'hide', //默认关闭为隐藏
autoHide:3, //n秒后自动隐藏,为false时,不自动隐藏
manager: tipsGroupMgr, //设置window所属的组
constructor: function(conf){
$.TipsWindow.superclass.constructor.call(this, conf);
this.initPosition(true);
},
initEvents: function() {
$.TipsWindow.superclass.initEvents.call(this);
//自动隐藏
if(false !== this.autoHide){
var task = new Ext.util.DelayedTask(this.hide, this), second = (parseInt(this.autoHide) || 3) * 1000;
this.on('beforeshow', function(self) {
task.delay(second);
});
}
this.on('beforeshow', this.showTips);
this.on('beforehide', this.hideTips);
Ext.EventManager.onWindowResize(this.initPosition, this); //window大小改变时,重新设置坐标
Ext.EventManager.on(window, 'scroll', this.initPosition, this); //window移动滚动条时,重新设置坐标
},
//参数: flag - true时强制更新位置
initPosition: function(flag) {
if(true !== flag && this.hidden){ //不可见时,不调整坐标
return false;
&n