您现在的位置:龙卷风首页 ›› 网络编程 ›› 阅读文章

jquery插件lightbox,图片缩放特效

lightbox是很优秀的图片缩放工具

lightbox是很优秀的图片缩放工具,做成jquery插件之后,代码更少,使用更方便了。最新版本0.5版。

为了使用方便,建议做以下小改动。下面是使用步骤,更改配合使用步骤说明。

1、下载压缩文件,把整个jquery-lightbox文件夹放在网站根目录。

2、修改js/jquery.lightbox-05.js文件

在$.fn.lightBox = function(settings)前一行加一个变量 

var baseImagePath = '/jquery-lightbox-0.5/';

再把下面四个图片地址进行响应的修改:

imageLoading: baseImagePath + 'images/lightbox-ico-loading.gif', // (string) Path and the name of the loading icon
imageBtnPrev: baseImagePath + 'images/lightbox-btn-prev.gif', // (string) Path and the name of the prev button image
imageBtnNext: baseImagePath + 'images/lightbox-btn-next.gif', // (string) Path and the name of the next button image
imageBtnClose: baseImagePath + 'images/lightbox-btn-close.gif', // (string) Path and the name of the close btn
imageBlank: baseImagePath + 'images/lightbox-blank.gif', // (string) Path and the name of a blank image (one pixel)

这样无论你在那一层的目录使用jquery-lightbox,按钮和背景的图片路径都不会出错了。

3、为了使图片的中文描述显示更清晰,修改文件 /css/jquery.lightbox-05.css,设置其中的

#lightbox-image-details-caption

这个属性,我设置为:

#lightbox-image-details-caption { color:Green; font-size:14px; line-height:1.7em; }

行距字体调大,去掉加粗,这样就清晰了。

独立存放jquery lightbox插件的目的是:方便管理,方便更新。

作者 不见不散 本文仅代表作者观点,与龙卷风资讯网立场无关。

我来说两句

内容/Content