伸缩变形滤镜标签代码Stretch

伸缩变形滤镜标签代码Stretch

伸缩变形滤镜(Stretch)用来定义一种拉伸变形的转换效果。

【标签说明】

filter:progid:DXImageTransform.Microsoft.Stretch(enabled= true—false, duration=转换的时间,stretchStyle=spin—push—hide)

说明:Stretch滤镜得出参数和方法如下。

█ enabled:可选项,用于定义滤镜是否激活,可取值为true或false,默认值为true。

█ duration:设置或检索转换耗时,其值为秒,毫秒(0.0000)格式。

█ stretchStyle:可选项,用于定义内容伸缩变形的方式。取值为spin时,表示在原内容的基础上向左右两边拉伸新内容;取值为push时,表示从左向右拉入新内容的同时推出旧内容;取值为hide时,表示在原内容的基础上从左向右拉伸新内容。

Stretch滤镜也有3种方法:apply()方法、play(iDuration)方法和stop()方法,方法的使用说明与Barn滤镜一样。

【实例】

<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional. dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>滤镜效果</title> <script language="javascript"> function show() { myweb.filters.item(0).apply(); myweb.src="5-41.jpg"; myweb.filters.item(0).play(); } </script> <style type="text/css"> .tranimage { width:300px; height:240px; filter:progid:DXImageTransform.Microsoft.Stretch(duration =5, stretchStyle=push); } </style> </head> <body onLoad="show()"> <img src="6-36.jpg" name="myweb" class= "tranimage"> </body> </html>

【运行结果】

运行代码,如

Stretch滤镜效果

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

微信扫一扫

微信扫一扫

微信扫一扫,分享到朋友圈

伸缩变形滤镜标签代码Stretch