<!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=gb2312" />
<title>图片变换效果</title>
<script src="CJL.0.1.min.js"></script>
<script src="ImageTrans.js"></script>
</head>
<body>
<style>
#idContainer{border:1px solid #000;width:600px; height:500px; background:#FFF center no-repeat;}
</style>
<div id="idContainer"> </div>
<input id="idLeft" type="button" value="向左旋转" />
<input id="idRight" type="button" value="向右旋转" />
<input id="idVertical" type="button" value="垂直翻转" />
<input id="idHorizontal" type="button" value="水平翻转" />
<input id="idReset" type="button" value="重置" />
<input id="idCanvas" type="button" value="使用Canvas" />
<br>
<input id="idSrc" type="text" value="http://demo.jb51.net/js/ImageTrans/r_xx2.jpg" />
<input id="idLoad" type="button" value="换图" />
<script>
(function(){
var container = $$("idContainer"), src = "http://demo.jb51.net/js/ImageTrans/r_mm14.jpg",
options = {
onPreLoad: function(){ container.style.backgroundImage = "url('http://demo.jb51.net/js/ImageTrans/o_loading.gif')"; },
onLoad: function(){ container.style.backgroundImage = ""; },
onError: function(err){ container.style.backgroundImage = ""; alert(err); }
},
it = new ImageTrans( container, options );
it.load(src);
//垂直翻转
$$("idVertical").onclick = function(){ it.vertical(); }
//水平翻转
$$("idHorizontal").onclick = function(){ it.horizontal(); }
//左旋转
$$("idLeft").onclick = function(){ it.left(); }
//右旋转
$$("idRight").onclick = function(){ it.right(); }
//重置
$$("idReset").onclick = function(){ it.reset(); }
//换图
$$("idLoad").onclick = function(){ it.load( $$("idSrc").value ); }
//Canvas
$$("idCanvas").onclick = function(){
if(this.value == "默认模式"){
this.value = "使用Canvas"; delete options.mode;
}else{
this.value = "默认模式"; options.mode = "canvas";
}
it.dispose();
it = new ImageTrans( container, options );
it.load(src);
}
})()
</script>
</body>
</html>
图片旋转缩放翻转变换效果(css3滤镜canvas).zip
版权申诉
187 浏览量
2022-11-10
04:31:48
上传
评论
收藏 56KB ZIP 举报
毕业_设计
- 粉丝: 1924
- 资源: 1万+
最新资源
- 基于python编写的Keras深度学习框架开发,利用卷积神经网络CNN,快速识别图片并进行分类
- 最全空间计量实证方法(空间杜宾模型和检验以及结果解释文档).txt
- 5uonly.apk
- 蓝桥杯Python组的历年真题
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 前端开发技术实验报告:内含4四实验&实验报告
- Highlight Plus v20.0.1
- 林周瑜-论文.docx
- 基于MIC+NE555光敏电阻的声光控电路Multisim仿真原理图
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈