API

Installation

First make sure the HTML5 doctype is set as the very first line on the page:

<!DOCTYPE html>

Include jQuery 1.4.4 or above in the header. Going with the latest 1.x release is recommended for optimal performance, the jQuery CDN can be used for this.

Download Lightview and upload the files from the package to your server. Include lightview.js and its dependancies1 below jQuery. Also include lightview.css and make sure the include paths point to the locations where the files have been uploaded.

Adding SWFObject 2.2+ is only required when making use of flash. The Google CDN can be used to include this file.

<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<!--[if lt IE 9]>
  <script type="text/javascript" src="/js/excanvas/excanvas.js"></script>
<![endif]-->
<script type="text/javascript" src="/js/spinners/spinners.min.js"></script>
<script type="text/javascript" src="/js/lightview/lightview.js"></script>

<link rel="stylesheet" type="text/css" href="/css/lightview/lightview.css"/>

That's it! Lightview should now be ready for use.

Tip: Gzipping helps reduce the total filesize to just 22kb.

Note: The downloads have an example folder demonstrating the installation. Should any problems arise during installation leave a message on the forum to get support.

1. ExplorerCanvas is included through conditional comments because older versions of Internet Explorer don't have Canvas support, this script adds support for it where needed. Spinners is a small library used to create the configurable loading icons.

Contents

Sign in