#div1{width:800px;heigh"> #div1{width:800px;heigh" />
ID:37852935
大小:29.00 KB
页数:9页
时间:2019-06-01
3、avascript"src="jQueryRotate.js">
4、image对象,可根据class获取。如果图像旋转后,不进行其它操作,则可用此方法。若进行其它操作,如放大、缩小图像,则此方法实现较复杂。复制代码代码如下: 5、t/css">#div1{width:800px;height:600px;background-color:#ff0;position:absolute;}.imgRotate{width:100px;height:100px;position:absolute;top:50%;left:50%;margin:-50px00-50px;}#imgRotate{width:100px;height:100px;position:absolute;top:50%;left:50%;margin:-50px0 6、0-50px;}
7、t/javascript">functionrotate(id,angle,whence){varp=document.getElementById(id);//westoretheangleinsidetheimagetagforpersistenceif(!whence){p.angle=((p.angle==undefined?0:p.angle)+angle)%360;}else{p.angle=angle;}if(p.angle>=0){varrotation=Math.PI*p.angle/1
8、80;}else{varrotation=Math.PI*(360+p.angle)/180;}varcostheta=Math.cos(rotation);varsintheta=Math.sin(rotation);if(document.all&&!window.opera){varcanvas=document.createElement('img');canvas.src=p.src;canvas.height=p.
此文档下载收益归作者所有