您的位置:首页 > 其它

实现Flex中div浮动层效果的操作

2014-03-18 11:16 274 查看
实现FLEX的"DIV浮动层效果"

需求是鼠标移动到相应的DATAGRID的条目时出现该产品的图片,并且图片跟着鼠标的移动而移动

var titleWindow:TitleWindow;

var img:Image;

protected function dataGrid_itemRollOverHandler(event:ListEvent):void

{

// var posmodelVO:PosModelVO=dataProvider.getItemAt(event.rowIndex) as PosModelVO;

var posmodelVO:PosModelVO=event.itemRenderer.data as PosModelVO

if(titleWindow==null){

titleWindow=new TitleWindow();

img=new Image

img.width=100;

img.height=133;

img.maintainAspectRatio=false;

titleWindow.addElement(img);

titleWindow.width=110;

titleWindow.height=145;

titleWindow.setStyle("headerHeight","0");

titleWindow.setStyle('borderSides','solid');

titleWindow.setStyle('borderThickness','3');

PopUpManager.addPopUp(titleWindow,this,false);

}

if(posmodelVO.image!=null){

titleWindow.visible=true;

img.source=posmodelVO.image;

titleWindow.x=mouseX;

titleWindow.y=mouseY;

}else {

titleWindow.visible=false;

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: