点击小图显示大图JS效果插件

jQuery plugin : Fancy Zoom

Author : DFC Engineering
License : GPL
Release version : 1.5
Released on : 2009 September
- Lot of improvements
- Now image really zoom !!

下载地址:Fancy Zoom

Context

This plugin is the jQuery version on the fancy zoom effect. As describe on the fancy zoom web site, this effect is providing a smooth, clean, truly Mac-like effect, almost like it's a function of Safari itself (see the demo below).

As the well famous light box plugin you must encapsulate your thumb images with a link that point to the zoomed image:

Tree 1Tree 2

 

 

Usage

1- Add javascript inclusion in the header of your page

//required
<script type="text/javascript" src="js/jquery.js"></script>

//optional
<script type="text/javascript" src="js/jquery.shadow.js"></script>
<script type="text/javascript" src="js/jquery.ifixpng.js"></script>
//the plugin it self
<script type="text/javascript" src="js/jquery.fancyzoom.js"></script>

2- Add your images

Add your images in the html page, but wrap it with a link to the zoomed version:

<a href="image1.jpg"><img src="image1-small.jpg" alt=""   /></a>

3- Finally use the plugin

After it, select the links and call the jQuery Fancy Zoom plugin. See some examples:

<script type="text/javascript">
$(function() {
	
//Set the default directory to find the images needed
//by the plugin (closebtn.png, blank.gif, loading images ....)
$.fn.fancyzoom.defaultsOptions.imgDir='../images/';//very important must finish
with a /

// Select all links in object with gallery ID using the defaults options
$('#gallery a').fancyzoom(); 

// Select all links with tozoom class, set the open animation time to 1000
$('a.tozoom').fancyzoom({Speed:1000});

// Select all links set the overlay opacity to 80%
$('a').fancyzoom({overlay:0.8});

//New, you can now apply the fancy zoom effect on an image
//apply the fancyzoom effect on all images that have the fancyzoom class
$("img.fancyzoom").fancyzoom();

});
</script>

Additional information

Options available

  • imgDir: The directory to find the images for the plugins (blank.gif, closebox.png ....)
  • Speed: The Speed in miliseconds of the animation, if 0 no animation is displayed
  • showoverlay: if false, do not show the overlay (true by default)
  • overlayColor: The color to use for the overlay (default #OOO)
  • overlay: the opacity value for the overlay (default 0.6)
  • For msie, use the ifixpng plugin to allow the transparency of the close image, fancy zoom only use ifixpng if it found it.
  • The shadow plugin works only for non ie browser, add it in the header of your html page and fancy zoom will display a shadow on the zoomed image.

Compatibility

If you add the ifixpng, ie 6 and ie 7 are full compatible.
But also safari 3 and firefox 2.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
three.js 是一款使用 JavaScript 编写的 3D 动画库,它能够帮助我们在 web 浏览器上创建交互式的 3D 场景。但是,three.js 并没有默认的地图插件。如果我们想在 three.js 中创建地图,我们需要借助其他库或插件来实现。 有许多第三方库与 three.js 结合使用以创建地图效果,其中最流行的就是 Mapbox.js、Leaflet.js 和 Cesium.js。这些库对地图数据的加载和渲染进行了封装,使得我们可以轻松地在 three.js 中添加地图效果。 Mapbox.js 是一个强大的地图库,它提供了丰富的地图样式和数据,可以通过 Mapbox API 进行加载和渲染。我们可以使用 Mapbox.js 将地图数据转换为 three.js 可以处理的格式,并在 three.js 场景中显示出来。 Leaflet.js 是另一个常用的地图库,它提供了基础的地图功能和用户交互。我们可以使用 Leaflet.js 来加载和渲染地图数据,并将其转换为 three.js 场景中的对象。 Cesium.js 则是一款专注于地理空间数据可视化的库,它提供了丰富的地理空间数据处理和展示功能。我们可以使用 Cesium.js 将地图数据转换为 three.js 场景中的对象,并在 three.js 中进行可视化展示。 总结来说,虽然 three.js 并没有默认的地图插件,但我们可以使用一些第三方库如 Mapbox.js、Leaflet.js 或 Cesium.js 来实现在 three.js 中创建地图的效果。这些库提供了丰富的地图数据和渲染功能,有助于我们在 three.js 中实现出色的地图展示效果

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值