Atlas学习手记(24):使用行为增强用户界面(四):Popup Behavior
2006-09-01 08:32
459 查看
Popup Behavior提供了Popup的功能,可以用来实现高级的Tooltip。
主要内容[/b]
1.Popup Behavior简介
2.完整示例
一.Popup Behavior简介[/b]
Popup Behavior提供了Popup的功能,可以用来实现高级的Tooltip。简单示例代码:
<popupBehavior
dataContext="source for data binding operations"
id="identifier for looking up the component by name"
parentElement="DOM element used as anchor for popup"
positioningMode="Absolute|Center|BottomLeft|BottomRight|TopLeft|TopRight"
x="0"
y="0"
>
<bindings>
<!-- bindings -->
</bindings>
<propertyChanged>
<!-- other actions -->
</propertyChanged>
</popupBehavior>
其中positioningMode指定了Popup元素显示的位置。
二.完整示例[/b]
看一个完整的示例,这里用Popup Behavior和前面说过的Hover Behavior来实现一个Drop-Down Box。在ASPX页面中先加入HTML元素:
<div>
<h3>
Popup Behavior Example</h3>
What is the definition of a <a id="hoverLink" class="hoverlabel">word</a>?
<div id="popup" style="visibility: hidden; display: none; border: solid 1px black;
background-color: Yellow;">
A sound or a combination of sounds.
</div>
</div>
用到的CSS如下:
</style>
编写Atlas脚本,注意popupBehavior加在了Div元素上,而hoverBehavior加在了HyperLink上并使用了Show和Hide方法。
</script>
运行后如下:
当鼠标移动到“word”上后:
完整示例下载:http://files.cnblogs.com/Terrylee/PopupBehaviorDemo.rar
主要内容[/b]
1.Popup Behavior简介
2.完整示例
一.Popup Behavior简介[/b]
Popup Behavior提供了Popup的功能,可以用来实现高级的Tooltip。简单示例代码:
<popupBehavior
dataContext="source for data binding operations"
id="identifier for looking up the component by name"
parentElement="DOM element used as anchor for popup"
positioningMode="Absolute|Center|BottomLeft|BottomRight|TopLeft|TopRight"
x="0"
y="0"
>
<bindings>
<!-- bindings -->
</bindings>
<propertyChanged>
<!-- other actions -->
</propertyChanged>
</popupBehavior>
其中positioningMode指定了Popup元素显示的位置。
二.完整示例[/b]
看一个完整的示例,这里用Popup Behavior和前面说过的Hover Behavior来实现一个Drop-Down Box。在ASPX页面中先加入HTML元素:
<div>
<h3>
Popup Behavior Example</h3>
What is the definition of a <a id="hoverLink" class="hoverlabel">word</a>?
<div id="popup" style="visibility: hidden; display: none; border: solid 1px black;
background-color: Yellow;">
A sound or a combination of sounds.
</div>
</div>
用到的CSS如下:
</style>
编写Atlas脚本,注意popupBehavior加在了Div元素上,而hoverBehavior加在了HyperLink上并使用了Show和Hide方法。
</script>
运行后如下:
当鼠标移动到“word”上后:
完整示例下载:http://files.cnblogs.com/Terrylee/PopupBehaviorDemo.rar
相关文章推荐
- Atlas学习手记(24):使用行为增强用户界面(四):Popup Behavior
- Atlas学习手记(21):使用行为增强用户界面(一):Click Behavior
- Atlas学习手记(22):使用行为增强用户界面(二):Floating Behavior
- Atlas学习手记(23):使用行为增强用户界面(三):Hover Behavior
- Atlas学习手记(21):使用行为增强用户界面(一):Click Behavior
- Atlas学习手记(22):使用行为增强用户界面(二):Floating Behavior
- Atlas学习手记(23):使用行为增强用户界面(三):Hover Behavior
- Atlas学习手记(25):使用行为增强用户界面(五):AutoComplete Behavior
- Atlas学习手记(25):使用行为增强用户界面(五):AutoComplete Behavior
- Atlas学习手记(13):使用TextBoxWatermark为TextBox加上水印效果
- Atlas学习手记(26):使用Validators验证用户输入
- Atlas学习手记(14):使用ToggleButton Extender来装扮CheckBox
- Atlas学习手记(17):使用FilteredTextBox过滤字符
- Atlas学习手记(13):使用TextBoxWatermark为TextBox加上水印效果
- Atlas学习手记(7):使用DragOverlayExtender实现拖放功能
- Atlas学习手记(4):使用AutoComplete Extender实现自动完成功能
- Atlas学习手记(10):使用AlwaysVisibleControl Extender
- Atlas学习手记(15):使用RoundedCorners为控件加上圆角效果
- Atlas学习手记(18):使用DragPanel实现拖放面板
- Atlas学习手记(12):使用CascadingDropDown控件