/*** (C)Scripterlative.com !!! READ THIS FIRST !!! -> This code is distributed on condition that all developers using it recognise the effort that -> went into producing it, by making a PayPal gratuity OF THEIR CHOICE to the authors within 14 -> days. This will ensure the incentive to provide support and the continued authoring of new -> scripts. -> If you think people should work for nothing and you cannot agree to abide promptly by this -> condition, we recommend that you decline the script. We'll understand. -> Gratuities cannot be accepted via any source other than PayPal. -> Please use the [Donate] button at www.scripterlative.com, stating the URL that uses the code. Info: http://scripterlative.com?thumbsmart ThumbSmart - Display full size images from a set of text links or thumbnail images. These instructions may be removed but not the above text. Please notify any suspected errors in this text or code, however minor. * Multiple independent displays in the same document. * Optional Image Captioning. * Two combinable selection methods: Clicking/Hovering & Back/Forward/Start/End controls. * Back & Forward functions have optional end-wrapping. * Image Preloading Options * Optional restoration of the default image on mouseout. * Large images can be set to work as links * Dimensions and aspect ratios preserved between images. * Foolproof unobtrusive setup - no need to add code to HTML tags. * Can call an external function to provide extended synchronous functionality. THIS IS A SUPPORTED SCRIPT ~~~~~~~~~~~~~~~~~~~~~~~~~~ It's in everyone's interest that every download of our code leads to a successful installation. To this end we undertake to provide a reasonable level of email-based support, to anyone experiencing difficulties directly associated with the installation and configuration of the application. Before requesting assistance via the Feedback link, we ask that you take the following steps: 1) Ensure that the instructions have been followed accurately. 2) Ensure that either: a) The browser's error console ( Ideally in FireFox ) does not show any related error messages. b) You notify us of any error messages that you cannot interpret. 3) Validate your document's markup at: http://validator.w3.org or any equivalent site. 4) Provide a URL to a test document that demonstrates the problem. Installation ~~~~~~~~~~~~ Save this file/text as 'thumbsmart.js', then place it into a folder related to your web pages: In the
section, insert these tags: Note: If thumbsmart.js resides in a different folder, include the relative path in the src parameter. Insert the code below within the body of your HTML document, anywhere below the last HTML element associated with the script (rollover images/links, stepping buttons). Configuration ~~~~~~~~~~~~~ DO NOT BE INTIMIDATED BY THE NUMBER OF OPTIONS THAT THIS SCRIPT OFFERS. Configuration is no more complicated than shown above. Once you have the script working, you can experiment with all the options offered. Notes: In these instructions, the term "image placeholder" means
All that remains is to supply the required parameters to the ThumbSmart.setup() function.
Parameter Explanation and Example Usage
---------------------------------------
The FIRST parameter is the name given to the display. This can be anything apart from the name of any other display in the same document.
The SECOND parameter is the NAME or ID of the large image placeholder for the corresponding display.
The THIRD parameter is used to specify one or more operating options for thumbnail images and back/forward links. The options and their effects are as follows:
Click | Operate thumbnail images by clicking.
Hover | Operate thumbnail images by hovering.
Restore | Restore the default image on mouse out. For more details, see 'The Restore Option'.
NoInit | Do not change the default image on startup when not using 'restore' mode. See 'The NoInit Option'.
NoTitle | Do not display title text when hovering a large image.
Wrap | Back/Forward stepping controls wrap at display extremes.
NoPreload| No initial preloading of large images.
Adjacent | See 'Preloading'.
EXAMPLE. Your large image placeholder is called 'bigImage', your activating elements will be
activated by clicking and you want the Back/Forward links (if used) to wrap at their extremes.
Use: ThumbSmart.setup('myShow', 'bigImage', 'click wrap', .....);
Alternatively, to activate by hovering, restore the default image on mouseout and not have
the images wrap.
Use: ThumbSmart.setup('myShow', 'bigImage', 'hover restore', .....);
The remaining parameters are passed in groups of three, each group corresponding to one link
and its associated large image. The meaning of the parameters in each group are
The ID of the activating element, usually a thumbnail image or link - Specify in quotes whichever is applicable.
Large-Image File Name - Include a relative path if required.
Title Text - This is the text that will:
a) Appear as a tooltip when a large image is hovered.
b) Appear as caption text when the captioning option is used.
(Can be specified as "").
Example usage is shown below.
The Restore Option
------------------
-Restore Active-
The display starts with the default image displayed; that is to say the image coded into the
HTML