Lightbox for Images

Vendor
MindTouch
Type Script
Categories Images
Requires MindTouch Core 1.8.3 or later
Status Stable
License Free/Open Source
Manifest http://scripts.mindtouch.com/lightbox.xml

 

Install Script
To add  this script to your site, enter the address of your MindTouch installation (ex: http://www.mindtouch.com) and click the Add Script button.  This will open your control panel and prepopulate the necessary values.  You will still need to manually add configuration settings if required.  Note that no changes are made to your site until you confirm the action in your control panel.
Your site address:     


Table of Contents

Description

This extension contains functions for lightbox effects.

See also How to add a script, Using the Extension Dialog, Learn about DekiScript, Extensions Directory.


Functions

lightbox(thumb : uri, image : uri, title : str, alternate : str, width : num, height : num) : xml

Make an embedded image clickable so that it is shown in a lightbox frame.

Parameters:

NameTypeDescription
thumburiURI for clickable thumbnail image.
imageuri(optional) URI for lightbox image. (default: same as thumb)
titlestr(optional) Title for thumbnail and lightbox images. (default: none)
alternatestr(optional) Alternate text for thumbnail image. (default: none)
widthnum(optional) Width for thumbnail image. (default: original width of thumbnail image)
heightnum(optional) Height for thumbnail image. (default: original height of thumbnail image)


Script Source

<extension>
  <title>Lightbox Extension</title>
  <label>Lightbox</label>
  <copyright>Copyright (c) 2006-2009 MindTouch Inc.</copyright>
  <description>This extension contains functions for lightbox effects.</description>
  <uri.help>http://developer.mindtouch.com/App_Catalog/Lightbox</uri.help>
  
  <function>
    <name>lightbox</name>
    <description>Make an embedded image clickable so that it is shown in a lightbox frame.</description>
    <param name="thumb" type="uri">URI for clickable thumbnail image.</param>
    <param name="image" type="uri" optional="true">URI for lightbox image. (default: same as thumb)</param>
    <param name="title" type="str" optional="true">Title for thumbnail and lightbox images. (default: none)</param>
    <param name="alternate" type="str" optional="true">Alternate text for thumbnail image. (default: none)</param>
    <param name="width" type="num" optional="true">Width for thumbnail image. (default: original width of thumbnail image)</param>
    <param name="height" type="num" optional="true">Height for thumbnail image. (default: original height of thumbnail image)</param>
    <return>
      <html xmlns:eval="http://mindtouch.com/2007/dekiscript">
        <body>
          <a eval:href="$image ?? uri.build($thumb, _, { size: 'webview' })" eval:title="$title" class="lightbox" rel="custom">
            <img eval:src="uri.build($thumb, _, { size: 'thumb' })" eval:width="web.size($width)" eval:height="web.size($height)" class="image" eval:title="$title" eval:alt="$alternate" />
          </a>
        </body>
      </html>
    </return>
  </function>
</extension>

 

Tag page (Edit tags)
You must login to post a comment.