• 弹窗位置


    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009" 
                   xmlns:s="library://ns.adobe.com/flex/spark" 
                   xmlns:mx="library://ns.adobe.com/flex/mx" 
                   width="300" layout="vertical" showCloseButton="true" close="closeMe()"
                   >
        <fx:Script>
            <![CDATA[
                import mx.managers.PopUpManager;
                protected function closeMe():void{
                PopUpManager.removePopUp(this);
                }
                
                protected function moveWindow(location:String):void{
                var newX:Number = 0;
                var newY:Number = 0;
                var padding:Number = 10;
                if(location== "center"){
                    PopUpManager.centerPopUp(this);
                    return;
                }
                if(location.indexOf("bottom") >-1)
                {newY=(parent.height - this.height )- padding;}
                if(location.indexOf("top") >-1)
                {newY= padding;}
                if(location.indexOf("left") >-1)
                {newX= padding;}
                if(location.indexOf("right") >-1)
                {newX=(parent.width - this.width )- padding;}
                
                move(newX,newY);//移动弹窗位置
                
                }
            ]]>
        </fx:Script>
        <s:HGroup width="100%">
            <s:Button label="Top left" width="100%" click="moveWindow('topleft');"/>
            <s:Button label="Top right" width="100%" click="moveWindow('topright');"/>        
        </s:HGroup>
        <s:VGroup width="100%">
            <s:Button label="Bottom left" width="100%" click="moveWindow('bottomleft');"/>
                <s:Button label="Bottom right" width="100%" click="moveWindow('bottomright');"/>
        </s:VGroup>
    </mx:TitleWindow>
    View Code
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                   xmlns:s="library://ns.adobe.com/flex/spark" 
                   xmlns:mx="library://ns.adobe.com/flex/mx" 
                  width="900" height="1000" backgroundColor="#ff00ed"
                 >
        
    
        <mx:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009" 
                        xmlns:s="library://ns.adobe.com/flex/spark" 
                        xmlns:mx="library://ns.adobe.com/flex/mx" 
                        width="300" layout="vertical" showCloseButton="true" close="closeMe()"
                        >
            <fx:Script>
                <![CDATA[
                    import mx.managers.PopUpManager;
                    protected function closeMe():void{
                        PopUpManager.removePopUp(this);
                    }
                    
                    protected function moveWindow(location:String):void{
                        var newX:Number = 0;
                        var newY:Number = 0;
                        var padding:Number = 10;
                        if(location== "center"){
                            PopUpManager.centerPopUp(this);
                            return;
                        }
                        if(location.indexOf("bottom") >-1)
                        {newY=padding;}
                        if(location.indexOf("top") >-1)
                        {newY= (parent.height - this.height )- padding;}
                        if(location.indexOf("left") >-1)
                        {newX= (parent.width - this.width )- padding;}
                        if(location.indexOf("right") >-1)
                        {newX=padding;}
                        
                        move(newX,newY);//移动弹窗位置
                        
                    }
                ]]>
            </fx:Script>
            <s:HGroup width="100%">
                <s:Button label="Top left" width="100%" click="moveWindow('topleft');"/>
                <s:Button label="Top right" width="100%" click="moveWindow('topright');"/>        
            </s:HGroup>
            <s:VGroup width="100%">
                <s:Button label="Bottom left" width="100%" click="moveWindow('bottomleft');"/>
                <s:Button label="Bottom right" width="100%" click="moveWindow('bottomright');"/>
            </s:VGroup>
        </mx:TitleWindow>
    </s:Application>
    View Code

  • 相关阅读:
    各国货币M2增长对比
    Centos6 服务器病毒查杀命令历史
    常见的贷款实际年化利率
    Nginx Rewrite规则
    使用HTML5新特性Mutation Observer实现编辑器的撤销和撤销回退操作
    通过javascript在网页端解压zip文件并查看压缩包内容
    通过javascript在网页端生成zip压缩包并下载
    Plupload上传组件 + javaweb实现上传源码以及DEMO
    chrome 26.0.XXX版本下media query流媒体查询有问题的bug
    epub电子书--目录结构介绍
  • 原文地址:https://www.cnblogs.com/zhugexiaobei/p/3231849.html
Copyright © 2020-2023  润新知