The paramter options define the functionality and layout of the lightbox effect. Paramters are defined as properties of an object or as an object literal. If you need a minimal lightbox with the default functionality and layout, use an empty params object '{}'.
Each template includes a separate .js file which has all the paramter settings. The paramters within the file are returned by a function call. In the example below 'nflbParams_default()' returns the paramters object for the template. To modify the template paramters simply edit the .js file, the settings are sectioned and commented within the file.
If you only require a few paramters for your lightbox, pass the settings as an object literal instead of referencing the templates separate .js file settings.
Some paramter options can be specifically defined by environment (browser type, OS, mobile, etc...). Paramter options customizable by environment are noted with 'environment object' in the data type.
The environment specific settings are defined using an object literal where the property name is the environment and the value is the setting. Valid environment names must match the NF.util.browser class properties. These values include...
The following is an example of how to apply environment specific settings for the 'showTooltips' parameter. The setting below will cause tooltips to display in all environments except Internet Explorer and mobile devices.
When the users environment matches more than one property (except 'all') the first matching property value will be applied.
Custom control buttons are added as properties of your control bar and overlay paramter objects...
Each control can be defined more than once by customizing the property name (e.g. 'close1', 'close2', 'closeX', 'closeY', etc...). In the example below a close button is added to both the bottom and top control bars...
The button value can be a string, boolean (must resolve to true or its not added), or object with additional settings depending on the button type features. A custom property hook (see the 'Button Controls - Text' section below for more details) can be used within any button text.
Each button is CSS accessible by the property name you give it (e.g. 'close1', 'close2', etc...). The example CSS code below illustrates how to custom style a close button named 'close1'...
Buttons are displayed horizontally on the bars in the order they are defined. Combine buttons, text, spacers, and frame link controls in any order with any CSS styling to create any desired layout and look.
Custom control text may be added as properties of your control bar objects... (See the 'Custom Controls - Buttons' section above for additional details.)
Text controls can include plain text or any HTML including links. To add lightbox specific details such as the current frame title or zoom level, insert property hooks within your text values.
The property hook syntax is similar to an opening HTMl tag. The example below hooks into the current frame title and inserts it within the text control...
You can combine any number of hooks and formatting within a single text control. The example below adds a caption and the frames title in bold, plus shows the src (url) property for the frame.
If the frames title was "Crazy Cats" and the src was "images/crazy_cat01.jpg", the resulting control text would look similar to...
Funny Photos: Crazy Cats (images/crazy_cats01.jpg)
Any frame property can be used, including custom property names added through the 'rel' tag or with script. You can easily pull in some very unique data with the hooks. For example the 'rel' tags for your lightbox links can be dynamically generated by your server or applied by hand and include product descriptions, pricing, sizes, etc. These details can be formatted and pulled into your lightbox text controls with the property hooks!
Frame links are an automatically generated series of numeric, text based, or thumbnail images which link to specific frames in your lightbox slide show gallery. The custom frame links are added as properties of your control bar objects... (See the 'Custom Controls - Buttons' section above for additional details.)
The frame links automatically center themselves based on your current frame position. This occurs for single line and multi-column frame links which flow right to left or top to bottom.
Below is a screen capture of numbered single column frame links. Style these in any way including active and hover states.
This next example shows text based descriptions. Like all text controls, parameter hooks can grab frame specific data. The example below uses the actual frame ID as the desciption for each frame link. This is accomplished with a paramter hook...
Thumbnails are automatically generated from the frame images. A host of options scale, crop, and align the thumbs for just the right look. Custom CSS adds extra emphasis with both hover and active (current frame) styling...
Rows and columns for all frame link types are fully customizable. Flow the links from left to right or top to bottom. Specify the width and height of the thumbnails, plus much more. Like all controls, multiple frame links with varied styles can be added to a single lightbox container. Below is an example of thumbnail image links with the rows set to 2 and columns set to 6...
Multiple frame link controls can be added to the top and bottom bars in the same way as button and text controls. The frame link value is an object with various properties that define the layout and type of links to display. The example framelink setting below is a basic numeric series of links with 10 columns visible at a given time...
A more complex example below arranges thumbnail frame links in two rows with the flow set left to right and clipping top center.
A host of CSS classes are available for styling the link container and items as well as hover and active states. Like all controls, the CSS class names are based on the property id of your frame links object. The following shows how the CSS is defined for a frame link object with an id of 'framelinks1'. The CSS styles are taken from the default template within the download which is also shown above in the numbered screen shot...
Overlay buttons appear on top of the frame content in response to mouseover and click events, or click events only. Touch devices will activate the overlay (if defined) by tapping the frame content or frame content holder. The overlay can be customized to include any button type control (see above).
The overlay is an object which contains three row properties (top, middle, bottom). Multiple controls are added to any one of the 3 overlay row properties as an object with 'left', 'center', or 'right' column properties which creates a 3x3 grid of 9 possible overlay control button locations. It sounds confusing, but is actually quite simple, here is what it looks like...
The code for the above layout is below. First create an overlay object with three property objects (top, middle, bottom), these are the rows. Next we can apply buttons to the rows as shown below...
In the example above all three buttons are applied to the overlays 'bottom' row as shown in the screen grab. Each button control object includes properties which define the column (posiiton:string), dimensions (maxWidth:int, maxHeight:int, minWidth:int, minHeight:int), and URL (src:string) of the button image.
The purpose of the grid layout is the ability for the buttons to auto scale on small devices and large screens. The buttons are auto sized to fit the grid location they belong to. You can set maxes and minimums based on the environment. In a mobile device with a high pixel ratio the buttons will naturally size themselves larger than normal and be easily accessible. On a full size computer screen the images will not be to large, these extremes are defined by the max an min dimensions you set for the button images.
To set specific maximum and minimum button sizes use an environment object for maxWidth, maxHeight, minWidth, and minHeight...
The property above adds a play button to the bottom center grid location. The max width for small mobile devices (smart phones) is set larger so the button is accessible.
The following properties can be applied to your overlay button object...
Several overlay CSS classes are available for styling the background container and buttons...
The example CSS above adds a nice semi transparent background with a radius border behind the overlay button image. The entire container receives the click event for the button.
All animation sequences are fully customizable and utilize the NodeFire animation library. The library is a CSS style animator which has the capability to transition any numeric based CSS styles from a start to end value utilizing a timeline. Tons of advanced features such as easing, GPU acceleration, multiple clips, multiple tracks, sychronization, and automated style conversion for old IE are included. For complete details see the animation class in the NodeFire API documentation.
The NodeFire API is a stand alone API which does not rely on any third party FrameWorks such as jQuery or Prototype. The API is OpenCubes pupose written library specifically designed to enhance the widgets.
Numerous animation sequences can be applied to the lightbox to enhance frame transitions, loading, and interaction. Below are the animation sequence paramter properties shown in the order they occur...
LightBox Initially Loaded
Moving to a New Frame
Moving to a New Frame [Loading Image Disabled] - Disabling the loading image requires the frame content to be preloaded and the 'skipLoadingImageIfPreloaded' parameter to be set true.
Closing a Modal LightBox
Unique Sequences for Maximized / Inline LightBoxes - If defined these sequences override the standard animation sequences above.
Hide / Show the Overlay Buttons
Each animation sequence property takes a 3 dimensional array as the value. The array defines a timeline made up of tracks, clips, and style animations. The first level specifies the tracks.
The second level specifies clips...
The third level specifies syle animations, these are the core objects which are animated. The three clips below are colored red, green, and blue below to make it easier to see...
The above example is a complex timeline with multiple tracks, clips, and styleAnims. The API's player class automatically synchronizes the tracks and styleAnims and plays the timeline frame by frame.
Below is a visual representation of the timeline outlined above. The screen shot is taken from the Visual NodeFire software which includes a visual tool for building animation timelines.
The top ruler shows the number of frames in the timeline. The player will synchronize the animation of all three tracks as well as multiple styleAnim objects applied to a single clip.
Typically your timelines will not be this complex with the lightbox, a simple single clip timeline looks like...
Below is an example of a simple styleAnim object...
Each styleAnim object may contain multiple style transitions...
The clip object includes a host of options which define the frames, GPU boost, the DOM node to apply the styleAnim to, etc...
Now lets put it all together. The code below applies an opacity animation transition on the show loading image sequence...
All the properties, methods, and events are fully covered in the API documention, see... NodeFire API Animation Class