lightbox-new and practical display picture effect

Source: Internet
Author: User
Picture Effects | show

lightbox--new and practical display picture effect

"Lightbox" is a chic and easy-to-use picture display that allows a picture to be rendered directly above the current page without having to go to a new window. The text statement is clearly not clear enough, so please take a look at Lightbox 's demo page first.

How to use it?

Lightbox can be very simple to apply to your page. First include lightbox.js to the header portion of your page:

<script src= "Lightbox.js" type= "Text/javascript" ></script>

Add the Rel= "Lightbox" attribute to any linked tag to activate the Lightbox feature, for example:

<a title= "My caption" href= "http://www.webjx.com/htmldata/2006-03-14/images/image-1.jpg" rel= "Lightbox" > Image #1 </a>

You may notice that in the above example, when you open the picture, you will see a descriptive text below the picture. This is controlled by the title attribute. The Title property is an option, which means that you can not write, of course, it is better to briefly explain it.

How to customize?

You can use CSS to decorate the "picture layer", in the example page above, we use the following CSS code:

#lightbox {
Background-color: #eee;
padding:10px;
border-bottom:2px solid #666;
border-right:2px solid #666;
}
#lightboxDetails {
Font-size:0.8em;
Padding-top:0.4em;
}
#lightboxCaption {float:left;}
#keyboardMsg {float:right;}
#lightbox img{Border:none;}
#overlay img{Border:none;}

To create a shadow effect, you need to prepare a translucent PNG picture and a little CSS. Because of IE's poor support for PNG graphics (it does not support PNG transparency) we have to write more code for it:

#overlay {background-image:url (http://www.webjx.com/htmldata/2006-03-14/overlay.png);}
* HTML #overlay {
Background-color: #000;
Back\ground-color:transparent;
Background-image:url (blank.gif);
Filter:progid:DXImageTransform.Microsoft.AlphaImageLoader (src= "http://www.webjx.com/htmldata/2006-03-14/ Overlay.png ", sizingmethod=" scale ");
}

Lightbox.js has a var loadingimage = ' Loading.gif ', which is used to control the "loading ..." effect before the picture is fully loaded, and you can use any image to replace it.
Similarly, var CloseButton = ' Close.gif ', the source of the picture used to control the "close" button.

Download

Lightbox.rar Download instance



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.