最新jquery lightbox插件下载

jquery lightbox插件下载,来源:http://leandrovieira.com/projects/jquery/lightbox/

使用方法

<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.lightbox-0.4.js"></script>
Include the CSS file responsible to style the jQuery lightBox plugin.
<link rel="stylesheet" type="text/css" href="css/jquery.lightbox-0.4.css" media="screen" />
Part 2 - Activate
You don´t need to modify your HTML markup to use jQuery lightBox plugin. Just use the power and flexibility of jQuery´s selector and create a set of related images.
The only necessity is to have a HTML markup likes it:
<a href="image1.jpg"><img src="thumb_image1.jpg" width="72" height="72" alt="" /></a>
After it, select the links and call the jQuery lightBox plugin. See some examples:
<script type="text/javascript">
$(function() {
	// Use this example, or...
	$('a[@rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
	// This, or...
	$('#gallery a').lightBox(); // Select all links in object with gallery ID
	// This, or...
	$('a.lightbox').lightBox(); // Select all links with lightbox class
	// This, or...
	$('a').lightBox(); // Select all links in the page
	// ... The possibility are many. Use your creative or choose one in the examples above
});
</script>

可选的配置

jQuery lightBox plugin has some configurations that you can define when call it. With that configurations you can customize your jQuery lightBox plugin.

The configurations available are:

  • overlayBgColor - Used to define the overlay background color. #000 (black) is default.
  • overlayOpacity - Used to define the overlay opacity. 0.8 is default.
  • imageLoading - The loading gif animator. images/lightbox-ico-loading.gif is default.
  • imageBtnClose - The close image button. images/lightbox-btn-close.gif is default.

Configurations added in 0.3 version:

  • imageBtnPrev - The previous image button. images/lightbox-btn-prev.gif is default.
  • imageBtnNext - The next image button. images/lightbox-btn-next.gif is default.
  • containerBorderSize - The padding CSS information used in the container image box. 10 is default.
  • containerResizeSpeed - The duration of resize effect in the container image box. 400 is default.
  • txtImage - Text "Image" used in the image caption.
  • txtOf - Text "of" used in the image caption.

Configurations added in 0.4 version:

  • imageBlank - The image blank for trick Internet Explorer into showing hover. images/lightbox-blank.gif is default.
  • keyToClose - The key to close the lightBox. Letter c (close) is default.
  • keyToPrev - The key to show the previous image. Letter p (previous) is default.
  • keyToNext - The key to show the next image. Letter n (next) is default.

Example.

<script type="text/javascript">
$(function() {
   $('a[@rel*=lightbox]').lightBox({
	overlayBgColor: '#FFF',
	overlayOpacity: 0.6,
	imageLoading: 'http://example.com/images/loading.gif',
	imageBtnClose: 'http://example.com/images/close.gif',
	imageBtnPrev: 'http://example.com/images/prev.gif',
	imageBtnNext: 'http://example.com/images/next.gif',
	containerResizeSpeed: 350,
	txtImage: 'Imagem',
	txtOf: 'de'
   });
});
</script>

 

阅读(53)喜欢(0)不喜欢(0)161.71KB浏览器 点击下载