Getting Started with JQuery Flyout
Download the Libraries
Download JQuery version 1.5, 1.4.4, 1.3.2 or 1.2.6 or use the GoogleAPI links
Download the JQuery Easing library version 1.3
Download JQuery Flyout version 1.2
Example 1: fullSizeImage with full Opacity animation
and finally the div that wraps the image linked thumbnails; you will need to insert your own links and thumbnail images.
Gallery #1 Example Explained:
- Since the default setting does not specify a loading image (
loadingSrc), the CSS opacity of the default loader element (
#loader) is set to 0.5 (50% opacity) which has a background color of #000 (black) and 'Loading...' text is added as a default notification that the image is loading up.
- Notice what happens if you click another thumbnail before closing the open image: the previous image closes before the new one is opened.
- Try resizing the screen between clicks and notice what happens with new flyout size and placement.
- Fullsize Images that are out of the bounds of the document do not resize the document vertically; this is a browser limitation. Make sure your image gallery is in a good place on the page to scroll vertically to view a fullsize image.
Example 2: Easing, Loading Animation Example and Partial Opacity
For this example we have some additional CSS to add to the last example:
Gallery #2 Example Explained:
- Notice what happens if you scroll the thumbnail window, before closing the open image: the image returns to the current location of the thumbnail, even if it is scrolled out of view; a good reason to use Opacity settings.
- loaderOpacity is overridden to match inOpacity of 0.3 so animation appears smoother.
- outOpacity is set to 0.9, so the final image is stil semi-transparent.
- Loading animations are courtesy of AjaxLoad.info.
- The easing plugin and demos can be found here.
Example 3: External event Fly Back & Custom Margins
Slightly different CSS:
Flyback link code:
Gallery #3 Example Explained:
- different custom loader: as in the Example 2, if a loader element ID is provided, its CSS rules are used to the loader element created when the Flyout plugin is applied.
- larger margins: limits the full extended size of the flyout image, even if the source image is larger. Margins are split between left and right or top and bottom, e.g. a 50px heightMargin translates to 25px top and 25px bottom.
- loader positioning: adjustments are made internally compensate for additional border and padding size of both the
loader and the link-wrapped thumbnail
img elements. Flyout will always attempt to wrap the loader element border directly around the image, minus image margin, padding and borders. Padding of the loader element is respected.
- custom flyback link: see code above; using JQuery we can target any currently 'shown' images and activate the
click() event which causes the image to return to its thumbnail link.
Example 4: Flyout Gallery Viewer
This is an advanced mashup example, demonstrating the
destElement and callback options and features:
- a modified version of Ben Sterling's jqAlbumParser plugin to grab public, online picture galleries via RSS feed - both Google Picasa and Yahoo Flickr supported and demonstrated
- custom graphics and cross-browser tested CSS
- JQuery UI animations for gallery pic title display, and long descriptions in Flickr
Click here to see the JQuery Flyout Photo Album Examples
special thanks to National Geographic Photography, Fred Gambino, Chris Foss and Chris Moore
JQuery Flyout Tips
- JQuery Flyout only works with image links: Preferably links containing thumbnail image tags. This is a simple plugin right now, and works best on a set of linked thumbnail images. You can somewhat override this behavior using the
startWidth options on just links.
- You can use CSS to style the loader: Using CSS and CSS3 styling you can adjust the appearance of the loader container; see example 3.
- Loader element positioning: Flyout compensates for the Loader element border and padding as well as the sub img tag border and padding to try and wrap the loader tightly around the thumbnail image. If you want some padding, adjust padding of the loader element; img padding, margins and borders are ignored.
- Offset location can be tricky: If you are using padding or border on the parent
body element, or are inside a container with globally redefined margin, padding or border set (like a
div when divs are globally defined to have margins), the Flyout offset will be off respectively. Unfortunately there is no easy way for Flyout to figure this out for all browsers, so if you are powerless to fix the CSS of your page, you can use the
startOffsetY to compensate.
- Experiment First: Don't try to roll this out on your production website the first time. Try it out first with your existing CSS stylesheet and make small changes using the examples until you get the hang of the various options and CSS adjustments.
Sounds great! Where do I get it? Download JQuery Flyout plugin.
copyright © 2008-2012 Nixbox Designs - all source and demo code licensed under MIT and GPL