jQuery插件:jQueryRotate 图片旋转插件

2009-08-07 09:57:40 来源:查看 | 【

本插件可以对网页内的普通图片进行旋转,有相当丰富的参数可以进行设置,可以设定旋转的方向,旋转的角度,还可以设定鼠标事件,当鼠标滑过时动态旋转,非常棒

查看演示页面 View Demo

在网页<head>区添加以下代码

<script type="text/javascript" src="http://www.sharejs.com/software/jquery/jquery-1.3.1.js"></script>
<script language="javascript" src="jQueryRotate.js"></script>
<!-- Include the VML behavior -->
<style>v\:image { behavior:url(#default#VML); display:inline-block }</style>
<!-- Declare the VML namespace -->
<xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v" />


其中:
<!-- Include the VML behavior -->
<style>v\:image { behavior:url(#default#VML); display:inline-block }</style>
<!-- Declare the VML namespace -->
<xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v" />

必须添加到你的<head>区 否则图片不会显示、
jQueryRotate.js是旋转的jQuery插件,点击这里下载>>>



在网页<body>区添加以下代码

<img id="image" src="1.jpg"><Br><br>
<img id="image2" src="1.jpg"><Br><br>
<img id="image3" src="1.jpg"><Br><br>
<p></p>

<script type="text/javascript">
		$(document).ready(function()
		{
			var rot=$('#image3').rotate({maxAngle:25,minAngle:-55,
			bind:
				[
					{"mouseover":function(){rot[0].rotateAnimation(85);}},
					{"mouseout":function(){rot[0].rotateAnimation(-35);}}
				]
			});

			$('#image2').rotateAnimation({angle:5});
			
			$('#image').rotate(-25);
			
		});
</script>


image,image2,image3分别为三个图片的ID

调用方法如下:
jQuery(imgElement).rotate(angleValue)

jQuery(imgElement).rotate(parameters)

jQuery(imgElement).rotateAnimation(parameters)


jQuery(imgElement).rotateAnimation(parameters)


参数说明:

({angle:angleValue,

[animateAngle:animateAngleValue],

[maxAngle:maxAngleValue],

[minAngle:minAngleValue],

[callback:callbackFunction],

[bind:[{event: function},{event:function} ] })


jQuery(imgElement).rotateAnimation



下载"jQuery插件:jQueryRotate 图片旋转插件"

  • 本地下载
  • 本地下载2

相关资源