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

本文介绍了一款基于jQuery的图片放大预览插件cloud-zoom,并提供了详细的部署步骤及参数说明,帮助开发者轻松实现图片放大的交互效果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

分享一个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 Value
zoomWidthThe 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.0
adjustYAllows you to fine tune the y-position of the zoom window in pixels.0
tintSpecifies a tint colour which will cover the small image. Colours should be specified in hex format, e.g. ‘#aa00aa’. Does not work with softFocus.false
tintOpacityOpacity of the tint, where 0 is fully transparent, and 1 is fully opaque.0.5
lensOpacityOpacity 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.5
softFocusApplies a subtle blur effect to the small image. Set to true or false. Does not work with tint.false
smoothMoveAmount 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.3
showTitleShows the title tag of the image. True or false.true
titleOpacitySpecifies the opacity of the title if displayed, where 0 is fully transparent, and 1 is fully opaque.0.5
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值