Web上IMG淡入淡出的HTC封装
2004-07-27 14:00
351 查看
<style>
IMG
{
behavior:url('Img.htc');
}
</style>
Img.htc
<PUBLIC:COMPONENT>
<PUBLIC:attach event="ondocumentready" onevent="Init()"/>
<PUBLIC:attach event="onmouseover" onevent="DefineOn()"/>
<PUBLIC:attach event="onmouseout" onevent="DefineOff()"/>
<PUBLIC:method name="DefineInit"/>
<script>
style.filter="alpha(opacity=20)";
var timer;
var initOffset;
var onOffset=5;
var offOffset=10;//偏移量
function Init()
{
initOffset=element.filters.alpha.opacity;
}
function DefineOn()
{
clearInterval(timer)
timer=window.setInterval("document.all['"+element.uniqueID+"'].DefineInit(0)",10);
}
function DefineOff()
{
clearInterval(timer)
timer=window.setInterval("document.all['"+element.uniqueID+"'].DefineInit(1)",10);
}
function DefineInit(bStatus)
{
opacty=element.filters.alpha.opacity;
if(bStatus)
{
if(opacty>initOffset)
{
element.filters.alpha.opacity-=offOffset;
}
else
{
clearInterval(timer);
}
}
else
{
if(opacty<100)
{
element.filters.alpha.opacity+=offOffset;
}
else
{
clearInterval(timer);
}
}
}
</script>
</PUBLIC:COMPONENT>
IMG
{
behavior:url('Img.htc');
}
</style>
Img.htc
<PUBLIC:COMPONENT>
<PUBLIC:attach event="ondocumentready" onevent="Init()"/>
<PUBLIC:attach event="onmouseover" onevent="DefineOn()"/>
<PUBLIC:attach event="onmouseout" onevent="DefineOff()"/>
<PUBLIC:method name="DefineInit"/>
<script>
style.filter="alpha(opacity=20)";
var timer;
var initOffset;
var onOffset=5;
var offOffset=10;//偏移量
function Init()
{
initOffset=element.filters.alpha.opacity;
}
function DefineOn()
{
clearInterval(timer)
timer=window.setInterval("document.all['"+element.uniqueID+"'].DefineInit(0)",10);
}
function DefineOff()
{
clearInterval(timer)
timer=window.setInterval("document.all['"+element.uniqueID+"'].DefineInit(1)",10);
}
function DefineInit(bStatus)
{
opacty=element.filters.alpha.opacity;
if(bStatus)
{
if(opacty>initOffset)
{
element.filters.alpha.opacity-=offOffset;
}
else
{
clearInterval(timer);
}
}
else
{
if(opacty<100)
{
element.filters.alpha.opacity+=offOffset;
}
else
{
clearInterval(timer);
}
}
}
</script>
</PUBLIC:COMPONENT>
相关文章推荐
- Web上日历选择的HTC封装组件
- Web上更改样式就可以使Select标签变为可编辑[HTC封装]
- 使用 HTC 封装的强大 DateEditor\DatePicker WebControl 。
- Web上日历选择的HTC封装组件
- webpack处理Img标签路径的几种情况
- 把asp程序封装成可执行文件(无需IIS web服务器)直接运行的管理系统
- 玩转web之JQuery(二)---改变表单和input的可编辑状态(封装的js)
- Java封装JDBC数据库增、删、改、查操作成JAR文件,以供Web工程调用,适用于多种数据库
- 基于jquery封装的一个简单web右键菜单
- 一个封装的QQ面板控件(HTC)
- WebView Jsoup的使用封装
- 封装Web Uploader 上传插件、My97DatePicker、百度 编辑器 的使用 (ASP.NET MVC)
- 封装maxdos为img
- android利用WebView实现浏览器的封装
- JSQL , 一个 web DB 的封装
- JSQL 一个 web DB 的封装
- 【C#】对异步请求处理程序IHttpAsyncHandler的理解和分享一个易用性封装 【手记】走近科学之为什么明明实现了IEnumerable<T>的类型却不能调用LINQ扩展方法 【手记】手机网页弹出层后屏蔽底层的滑动响应 【手记】ASP.NET提示“未能创建类型”处理 【Web】一个非常简单的移动web消息框 【手记】解决EXCEL跑SQL遇“查询无法运行或数据库表无法打开...”
- Java Selenium封装--RemoteWebElement
- 为 Koa 框架封装 webpack-dev-middleware 中间件
- Webdriver控制翻页控件,并实现向前向后翻页功能,附上代码,仅供参考,其他类似日期控件的功能可以自己封装