jcrop 网页截图工具(插件)开发

今天给大家介绍一下一个web 中经常会用到的截图(如:头像等)工具:

Jcrop演示

jcrop 网页截图工具(插件)开发_第1张图片

项目结构:

jcrop 网页截图工具(插件)开发_第2张图片

效果图:

jcrop 网页截图工具(插件)开发_第3张图片

jcrop 网页截图工具(插件)开发_第4张图片

jcrop 网页截图工具(插件)开发_第5张图片

这个很有用:

jcrop 网页截图工具(插件)开发_第6张图片

jcrop 网页截图工具(插件)开发_第7张图片

jcrop 网页截图工具(插件)开发_第8张图片

看到这些,大家也想自己试试吧

===========================================

代码部分:

===========================================

准备工作:

下载:Jcrop-0.9.10 (zip format)

解压后放入到你的项目里面,就如上面的项目结构一样...

/Jcrop/WebContent/tapmodo-Jcrop/demos/tutorial1.html

复制代码 代码如下:

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">



Jcrop » Tutorials » Hello World












Jcrop - Hello World


Flowers


This example demonstrates the default behavior of Jcrop.
Since no event handlers have been attached it only performs
the cropping behavior.











/Jcrop/WebContent/tapmodo-Jcrop/demos/tutorial2.html
复制代码 代码如下:

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">



Jcrop » Tutorials » Event Handler










Jcrop - Event Handlers



Flowers

class="coords"
onsubmit="return false;"
action="http://example.com/post.php">










An example with a basic event handler. Here we've tied
several form values together with a simple event handler invocation.
The result is that the form values are updated in real-time as
the selection is changed using Jcrop's onChange handler.



That's how easily Jcrop can be integrated into a traditional web form!









/Jcrop/WebContent/tapmodo-Jcrop/demos/tutorial3.html
 
   
   
   
   
复制代码 代码如下:

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">



Jcrop » Tutorials » aspectRatio w/ Preview










Jcrop - Aspect ratio w/ preview pane









Flowers



Preview



An example implementing a preview pane. Obviously the most visual demo, the preview pane is accomplished entirely outside of Jcrop with a simple jQuery-flavored callback. This type of interface could be useful for creating a thumbnail or avatar. The onChange event handler is used to update the view in the preview pane.









/Jcrop/WebContent/tapmodo-Jcrop/demos/tutorial4.html
复制代码 代码如下:

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">



Jcrop » Tutorials » Animations / Transitions












Jcrop - Animations/Transitions


Flowers





Animation/Transitions.
Demonstration of animateTo API method and transitions for bgColor
and bgOpacity options. Color fading requires inclusion of John Resig's
jQuery Color
Animations
plugin. If it is not included, colors will not fade.









/Jcrop/WebContent/tapmodo-Jcrop/demos/tutorial5.html
复制代码 代码如下:

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">



Jcrop » Tutorials » API Demo











Jcrop - API Demo


Jcrop Image












Option Toggles











Change Image












你可能感兴趣的:(jcrop 网页截图工具(插件)开发)