jQuery图片放大预览插件 cloud-zoom

来源:互联网 发布:网络平台的盈利模式 编辑:程序博客网 时间:2024/05/28 15:08

分享一个jquery的图片放大预览插件:cloud-zoom.

cloud-zoom DEMO

部署步骤:

1.加载jquery-1.4.js 和 cloud-zoom.1.0.2.min.js

2.加入样式表(DEMO中<style>部分)

3.为需要放大预览效果的缩略图添加超链接<a>并将类命名为”cloud-zoom” class=”cloud-zoom”

4.在超链接<a>的rel属性中加入需要的参数实现不同的效果

实例:

<a href=”images/大图.jpg” class=”cloud-zoom” rel=”position:’inside’ ,showTitle:false, adjustX:-2, adjustY:-2″><img src=”images/缩略图.jpg” title=”iinterest” /></a>

cloud-zoom参数说明:

ParameterDescription (from V1.0.0)Default ValuezoomWidthThe width of the zoom window in pixels. If ‘auto’ is specified, the width will be the same as the small image.‘auto’zoomHeightThe height of the zoom window in pixels. If ‘auto’ is specified, the height will be the same as the small image.‘auto’positionSpecifies the position of the zoom window relative to the small image. Allowable values are ‘left’, ‘right’, ‘top’, ‘bottom’, ‘inside’ or you can specifiy the id of an html element to place the zoom window in e.g. position: ‘element1′‘right’adjustXAllows you to fine tune the x-position of the zoom window in pixels.0adjustYAllows you to fine tune the y-position of the zoom window in pixels.0tintSpecifies a tint colour which will cover the small image. Colours should be specified in hex format, e.g. ‘#aa00aa’. Does not work with softFocus.falsetintOpacityOpacity of the tint, where 0 is fully transparent, and 1 is fully opaque.0.5lensOpacityOpacity of the lens mouse pointer, where 0 is fully transparent, and 1 is fully opaque. In tint and soft-focus modes, it will always be transparent.0.5softFocusApplies a subtle blur effect to the small image. Set to true or false. Does not work with tint.falsesmoothMoveAmount of smoothness/drift of the zoom image as it moves. The higher the number, the smoother/more drifty the movement will be. 1 = no smoothing.3showTitleShows the title tag of the image. True or false.truetitleOpacitySpecifies the opacity of the title if displayed, where 0 is fully transparent, and 1 is fully opaque.0.5
原创粉丝点击