Codebase list jquery-colorbox / upstream/1.3.20
Imported Upstream version 1.3.20 Agustin Henze 11 years ago
53 changed file(s) with 2025 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ## About ColorBox:
1 A customizable lightbox plugin for jQuery. See the [project page](http://jacklmoore.com/colorbox/) for documentation and a demonstration, and the [FAQ](http://jacklmoore.com/colorbox/faq/) for solutions and examples to common issues. Released under the [MIT license](http://www.opensource.org/licenses/mit-license.php).
2
3 ## Changelog:
4
5 ### Version 1.3.20 - August 15 2012
6 Files Changed:jquery.colorbox.js
7
8 * Added temporary workaround for jQuery-UI 1.8 bug (http://bugs.jquery.com/ticket/12273)
9 * Added *.jpe extension to the list of image types.
10
11 ### Version 1.3.19 - December 08 2011
12 Files Changed:jquery.colorbox.js, colorbox.css (all)
13
14 * Fixed bug related to using the 'fixed' property.
15 * Optimized the setup procedure to be more efficient.
16 * Removed $.colorbox.init() as it will no longer be needed (will self-init when called).
17 * Removed use of $.browser.
18
19 ### Version 1.3.18 - October 07 2011
20 Files Changed:jquery.colorbox.js/jquery.colorbox-min.js, colorbox.css (all) and example 1's controls.png
21
22 * Fixed a regression where Flash content displayed in ColorBox would be reloaded if the browser window was resized.
23 * Added safety check to make sure that ColorBox's markup is only added to the DOM a single time, even if $.colorbox.init() is called multiple times. This will allow site owners to manually initialize ColorBox if they need it before the DOM has finished loading.
24 * Updated the example index.html files to be HTML5 compliant.
25 * Changed the slideshow behavior so that it immediately moves to the next slide when the slideshow is started.
26 * Minor regex bugfix to allow automatic detection of image URLs that include fragments.
27
28 ### Version 1.3.17 - May 11 2011
29 Files Changed:jquery.colorbox.js/jquery.colorbox-min.js
30
31 * Added properties "top", "bottom", "left" and "right" to specify a position relative to the viewport, rather than using the default centering.
32 * Added property "data" to specify GET or POST data when using Ajax. ColorBox's ajax functionality is handled by jQuery's .load() method, so the data property works the same way as it does with .load().
33 * Added property "fixed" which can provide fixed positioning for ColorBox, rather than absolute positioning. This will allow ColorBox to remain in a fixed position within the visitors viewport, despite scrolling. IE6 support for this was not added, it will continue to use the default absolute positioning.
34 * Fixed ClearType problem with IE7.
35 * Minor fixes.
36
37 ### Version 1.3.16 - March 01 2011
38 Files Changed:jquery.colorbox.js/jquery.colorbox-min.js, colorbox.css (all) and example 4 background png files
39
40 * Better IE related transparency workarounds. IE7 and up now uses the same background image sprite as other browsers.
41 * Added error handling for broken image links. A message will be displayed telling the user that the image could not be loaded.
42 * Added new property: 'fastIframe' and set it to true by default. Setting to fastIframe:false will delay the loading graphic removal and onComplete event until iframe has completely loaded.
43 * Ability to redefine $.colorbox.close (or prev, or next) at any time.
44
45 ### Version 1.3.15 - October 27 2010
46 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
47
48 * Minor fixes for specific cases.
49
50 ### Version 1.3.14 - October 27 2010
51 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
52
53 * In IE6, closing an iframe when using HTTPS no longer generates a security warning.
54
55 ### Version 1.3.13 - October 22 2010
56 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
57
58 * Changed the index.html example files to use YouTube's new embedded link format.
59 * By default, ColorBox returns focus to the element it was launched from once it closes. This can now be disabled by setting the 'returnFocus' property to false. Focus was causing problems for some users who had their anchor elements inside animated containers.
60 * Minor bug fix involved in using a combination of slideshow and non-slideshow content.
61
62 ### Version 1.3.12 - October 20 2010
63 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
64
65 * Minor bug fix involved in preloading images when using a function as a value for the href property.
66
67 ### Version 1.3.11 - October 19 2010
68 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
69
70 * Fixed the slideshow functionality that broke with 1.3.10
71 * The slideshow now respects the loop property.
72
73 ### Version 1.3.10 - October 16 2010
74 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
75
76 * Fixed compatibility with jQuery 1.4.3
77 * The 'open' property now accepts a function as a value, like all of the other properties.
78 * Preloading now loads the correct href for images when using a dynamic (function) value for the href property.
79 * Fixed bug in Safari 3 for Win where ColorBox centered on the document, rather than the visitor's viewport.
80 * May have fixed an issue in Opera 10.6+ where ColorBox would rarely/randomly freeze up while switching between photos in a group.
81 * Some functionality better encapsulated & minor performance improvements.
82
83 ### Version 1.3.9 - July 7 2010
84 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js/ all colorbox.css (the core styles)
85
86 * Fixed a problem where iframed youtube videos would cause a security alert in IE.
87 * More code is event driven now, making the source easier to grasp.
88 * Removed some unnecessary style from the core CSS.
89
90 ### Version 1.3.8 - June 21 2010
91 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
92
93 * Fixed a bug in Chrome where it would sometimes render photos at 0 by 0 width and height (behavior introduced in recent update to Chrome).
94 * Fixed a bug where the onClosed callback would fire twice (only affected 1.3.7).
95 * Fixed a bug in IE7 that existed with some iframed websites that use JS to reposition the viewport caused ColorBox to move out of position.
96 * Abstracted the identifiers (HTML ids & classes, and JS plugin name, method, and events) so that the plugin can be easily rebranded.
97 * Small changes to improve either code readability or compression.
98
99 ### Version 1.3.7 - June 13 2010
100 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js/index.html
101
102 * $.colorbox can now be used for direct calls and accessing public methods. Example: $.colorbox.close();
103 * Resize now accepts 'width', 'innerWidth', 'height' and 'innerHeight'. Example: $.colorbox.resize({width:"100%"})
104 * Added option (loop:false) to disable looping in a group.
105 * Added options (escKey:false, arrowKey:false) to disable esc-key and arrow-key bindings.
106 * Added method for removing ColorBox from a document: $.colorbox.remove();
107 * Fixed a bug where iframed URLs would be truncated if they contained an unencoded apostrophe.
108 * Now uses the exact href specified on an anchor, rather than the version returned by 'this.href'. This was causing "#example" to be normalized to "http://domain/#example" which interfered with how some users were setting up links to inline content.
109 * Changed example documents over to HTML5.
110
111 ### Version 1.3.6 - Jan 13 2010
112 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
113
114 * Small change to make ColorBox compatible with jQuery 1.4
115
116 ### Version 1.3.5 - December 15 2009
117 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
118
119 * Fixed a bug introduced in 1.3.4 with IE7's display of example 2 and 3, and auto-width in Opera.
120 * Fixed a bug introduced in 1.3.4 where colorbox could not be launched by triggering an element's click event through JavaScript.
121 * Minor refinements.
122
123 ### Version 1.3.4 - December 5 2009
124 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
125
126 * Event delegation is now used for elements that ColorBox is assigned to, rather than individual click events.
127 * Additional callbacks have been added to represent other stages of ColorBox's lifecycle. Available callbacks, in order of their execution: onOpen, onLoad, onComplete, onCleanup, onClosed These take place at the same time as the event hooks, but will be better suited than the hooks for targeting specific instances of ColorBox.
128 * Ajax content is now immediately added to the DOM to be more compatible if that content contains script tags.
129 * Focus is now returned to the calling element on closing.
130 * Fixed a bug where maxHeight and maxWidth did not work for non-photo content.
131 * Direct calls no longer need 'open:true', it is assumed. Example: `$.fn.colorbox({html:'<p>Hi</p>'});`
132
133 ### Version 1.3.3 - November 7 2009
134 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
135
136 * Changed $.fn.colorbox.element() to return a jQuery object rather the DOM element.
137 * jQuery.colorbox-min.js is compressed with Google's Closure Compiler rather than YUI Compressor.
138
139 ### Version 1.3.2 - October 27 2009
140 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
141
142 * Added 'innerWidth' and 'innerHeight' options to allow people to easily set the size dimensions for ColorBox, without having to anticipate the size of the borders and buttons.
143 * Renamed 'scrollbars' option to 'scrolling' to be in keeping with the existing HTML attribute. The option now also applies to iframes.
144 * Bug fix: In Safari, positioning occassionally incorrect when using '100%' dimensions.
145 * Bug fix: In IE6, the background overlay is briefly not full size when first viewing.
146 * Bug fix: In Firefox, opening ColorBox causes a split second shift with a small minority of webpage layouts.
147 * Simplified code in a few areas.
148
149 ### Version 1.3.1 - September 16 2009
150 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js/colorbox.css/colorbox-ie.css(removed)
151
152 * Removed the IE-only stylesheets and conditional comments for example styles 1 & 4. All CSS is handled by a single CSS file for all examples.
153 * Removed user-agent sniffing from the js and replaced it with feature detection. This will allow correct rendering for visitors masking their agent type.
154
155 ### Version 1.3.0 - September 15 2009
156 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js/colorbox.css
157
158 * Added $.fn.colorbox.resize() method to allow ColorBox to resize it's height if it's contents change.
159 * Added 'scrollbars' option to allow users to turn off scrollbars when using the resize() method.
160 * Renamed the 'resize' option to be less ambiguous. It's now 'scalePhotos'.
161 * Renamed the 'cbox_close' event to be less ambiguous. It's now 'cbox_cleanup'. It is the first thing to happen in the close method while the 'cbox_closed' event is the last to happen.
162 * Fixed a bug with the slideshow mouseover graphics that appeared after ColorBox is opened a 2nd time.
163 * Fixed a bug where ClearType may not work in IE6&7 if using the fade transition.
164 * Minor code optimizations to increase compression.
165
166 ### Version 1.2.9 - August 7 2009
167 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
168
169 * Minor change to enable use with $.getScript();
170 * Minor change to the timing of the 'cbox_load' event so that it is more useful.
171 * Added a direct link to a YouTube video to the examples.
172
173 ### Version 1.2.8 - August 5 2009
174 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
175
176 * Fixed a bug with the overlay in IE6
177 * Fixed a bug where left & right keypress events might be prematurely unbound.
178
179 ### Version 1.2.7 - July 31 2009
180 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js, example stylesheets and background images (core styles have not changed and the updates will not affect existing user themes / old example themes)
181
182 * Code cleanup and reduction, better organization and documentation in the full source.
183 * Added ability to use functions in place of static values for ColorBox's options (thanks Ken!).
184 * Added an option for straight HTML. Example: `$.fn.colorbox({html:'<p>Howdy</p>', open:true})`
185 * Added an event for the beginning of the closing process. This is in addition to the event that already existed for when ColorBox had completely closed. 'cbox_close' and 'cbox_closed' respectively.
186 * Fixed a minor bug in IE6 that would cause a brief content shift in the parent document when opening ColorBox.
187 * Fixed a minor bug in IE6 that would reveal select elements that had a hidden visibility after closing ColorBox.
188 * The 'esc' key is unbound now when ColorBox is not open, to avoid any potential conflicts.
189 * Used background sprites for examples 1 & 4. Put IE-only (non-sprite) background images in a separate folder.
190 * Example themes 1, 3, & 4 received slight visual tweaks.
191 * Optimized pngs for smaller file size.
192 * Added slices, grid, and correct sizing to the Adobe Illustrator file, all theme files are now export ready!
193
194 ### Version 1.2.6 - July 15 2009
195 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
196
197 * Fixed a bug with fixed width/height images in Opera 9.64.
198 * Fixed a bug with trying to set a value for rel during a direct call to ColorBox. Example: `$.fn.colorbox({rel:'foo', open:true});`
199 * Changed how href/rel/title settings are determined to avoid users having to manually update ColorBox settings if they use JavaScript to update any of those attributes, after ColorBox has been defined.
200 * Fixed a FF3 bug where the back button was disabled after closing an iframe.
201
202 ### Version 1.2.5 - June 23 2009
203 Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
204
205 * Changed the point at which iframe srcs are set (to eliminate the need to refresh the iframe once it has been added to the DOM).
206 * Removed unnecessary return values for a very slight code reduction.
207
208 ### Version 1.2.4 - June 9 2009
209 Files Changed: jquery.colorbox.js, jquery.colorbox-min.js
210
211 * Fixed an issue where ColorBox may not close completely if it is closed during a transition animation.
212 * Minor code reduction.
213
214 ### Version 1.2.3 - June 4 2009
215 * Fixed a png transparency stacking issue in IE.
216 * More accurate Ajax auto-sizing if the user was depending on the #cboxLoadedContent ID for CSS styling.
217 * Added a public function for returning the current html element that ColorBox is associated with. Example use: var that = $.fn.colorbox.element();
218 * Added bicubic scaling for resized images in the original IE7.
219 * Removed the IE6 stylesheet and png files from Example 3. It now uses the same png file for the controls that the rest of the browsers use (an alpha transparency PNG8). This example now only has 2 graphics files and 1 stylesheet.
220
221 ### Version 1.2.2 - May 28 2009
222 * Fixed an issue with the 'resize' option.
223
224 ### Version 1.2.1 - May 28 2009
225 * Note: If you are upgrading, update your jquery.colorbox.js and colorbox.css files.
226 * Added photo resizing.
227 * Added a maximum width and maximum height. Example: {height:800, maxHeight:'100%'}, would allow the box to be a maximum potential height of 800px, instead of a fixed height of 800px. With maxHeight of 100% the height of ColorBox cannot exceed the height of the browser window.
228 * Added 'rel' setting to add the ability to set an alternative rel for any ColorBox call. This allows the user to group any combination of elements together for a gallery, or to override an existing rel. attribute so those element are not grouped together, without having to alter their rel in the HTML.
229 * Added a 'photo' setting to force ColorBox to display a link as a photo. Use this when automatic photo detection fails (such as using a url like 'photo.php' instead of 'photo.jpg', 'photo.jpg#1', or 'photo.jpg?pic=1')
230 * Removed the need to ever create disposable elements to call colorbox on. ColorBox can now be called directly, without being associated with any existing element, by using the following format:
231 `$.fn.colorbox({open:true, href:'yourLink.xxx'});`
232 * ColorBox settings are now persistent and unique for each element. This allows for extremely flexible options for individual elements. You could use this to create a gallery in which each page in the gallery has different settings. One could be a photo with a fade transition, next could be an inline element with an elastic transition with a set width and height, etc.
233 * For user callbacks, 'this' now refers to the element colorbox was opened from.
234 * Fixed a minor grouping issue with IE6, when transition type is set to 'none'.
235 * Added an Adobe Illustrator file that contains the borders and buttons used in the various examples.
236
237 ### Version 1.2 - May 13 2009
238 * Added a slideshow feature.
239 * Added re-positioning on browser resize. If the browser is resized, ColorBox will recenter itself onscreen.
240 * Added hooks for key events: cbox_open, cbox_load, cbox_complete, cbox_closed.
241 * Fixed an IE transparency-stacking problem, where transparent PNGs would show through to the background overlay.
242 * Fixed an IE iframe issue where the ifame might shift up and to the left under certain circumstances.
243 * Fixed an IE6 bug where the loading overlay was not at full height.
244 * Removed the delay in switching between same-sized gallery content when using transitions.
245 * Changed how iframes are loaded to make it more compatible with iframed pages that use DOM dependent JavaScript.
246 * Changed how the JS is structured to be better organized and increase compression. Increased documentation.
247 * Changed CSS :hover states to a .hover class. This sidesteps a minor IE8 bug with css hover states and allows easier access to hover state user styles from the JavaScript.
248 * Changed: elements added to the DOM have new ID's. The naming is more consistent and less likely to cause conflicts with existing website stylesheets. All stylesheets have been updated.
249 * Changed the behavior for prev/next links so that ColorBox does not get hung up on broken links. A visitor can now skip through broken or long-loading links by clicking prev/next buttons.
250 * Changed the naming of variables in the parameter map to be more concise and intuitive.
251 * Removed colorbox.css. Combined the colorbox.css styles with jquery.colorbox.js: the css file was not large enough to warrant being a separate file.
252
253 ### Version 1.1.6 - April 28 2009
254 * Prevented the default action of the next & previous anchors and the left and right keys for gallery mode.
255 * Fixed a bug where the title element was being added back to the DOM when closing ColorBox while using inline content.
256 * Fixed a bug where IE7 would crash for example 2.
257 * Smaller filesize: removed a small amount of unused code and rewrote the HTML injection with less syntax.
258 * Added a public method for closing ColorBox: $.fn.colorbox.close(). This will allow iframe users to add an event to close ColorBox without having to create an additional function.
259
260 ### Version 1.1.5 - April 11 2009
261 * Fixed minor issues with exiting ColorBox.
262
263 ### Version 1.1.4 - April 08 2009
264 * Fixed a bug in the fade transition where ColorBox not close completely if instructed to close during the fade-in portion of the transition.
265
266 ### Version 1.1.3 - April 06 2009
267 * Fixed an IE6&7 issue with using ColorBox to display animated GIFs.
268
269 ### Version 1.1.2 - April 05 2009
270 * Added ability to change content when ColorBox is already open.
271 * Added vertical photo centering now works for all browsers (this feature previously excluded IE6&7).
272 * Added namespacing to the esc-key keydown event for people who want to disable it: "keydown.colorClose"
273 * Added 'title' setting to add the ability to set an alternative title for any ColorBox call.
274 * Fixed rollover navigation issue with IE8. (Added JS-based rollover state due to a browser-bug.)
275 * Fixed an overflow issue for when the fixed width/height is smaller than the size of a photo.
276 * Fixed a bug in the fade transition where the border would still come up if ColorBox was closed mid-transition.
277 * Switch from JSMin to Yui Compressor for minification. Minified code now under 7KB.
278
279 ### Version 1.1.1 - March 31 2009
280 * More robust image detection regex. Now detects image file types with url fragments and/or query strings.
281 * Added 'nofollow' exception to rel grouping.
282 * Changed how images are loaded into the DOM to prevent premature size calculation by ColorBox.
283 * Added timestamp to iframe name to prevent caching - this was a problem in some browsers if the user had multiple iframes and the visitor left the page and came back, or if they refreshed the page.
284
285 ### Version 1.1.0 - March 21 2009
286 * Animation is now much smoother and less resource intensive.
287 * Added support for % sizing.
288 * Callback option added.
289 * Inline content now preserves JavaScript events, and changes made while ColorBox is open are also preserved.
290 * Added 'href' setting to add the ability to set an alternative href for any anchor, or to assign the ColorBox event to non-anchors.
291 Example: $('button').colorbox({'href':'process.php'})
292 Example: $('a[href='http://msn.com']).colorbox({'href':'http://google.com', iframe:true});
293 * Photos are now horizontally centered if they are smaller than the lightbox size. Also vertically centered for browsers newer than IE7.
294 * Buttons in the examples are now included in the 'protected zone'. The lightbox will never expand it's borders or buttons beyond an accessible area of the screen.
295 * Keypress events don't queue up by holding down the arrow keys.
296 * Added option to close ColorBox by clicking on the background overlay.
297 * Added 'none' transition setting.
298 * Changed 'contentIframe' and 'contentInline' to 'inline' and 'iframe'. Removed 'contentAjax' because it is automatically assumed for non-image file types.
299 * Changed 'contentWidth' and 'contentHeight' to 'fixedWidth' and 'fixedHeight'. These sizes now reflect the total size of the lightbox, not just the inner content. This is so users can accurately anticipate % sizes without fear of creating scrollbars.
300 * Clicking on a photo will now switch to the next photo in a set.
301 * Loading.gif is more stable in it's position.
302 * Added a minified version.
303 * Code passes JSLint.
304
305 ### Version 1.0.5 - March 11 2009
306 * Redo: Fixed a bug where IE would cut off the bottom portion of a photo, if the photo was larger than the document dimensions.
307
308 ### Version 1.0.4 - March 10 2009
309 * Added an option to allow users to automatically open the lightbox. Example usage: $(".colorbox").colorbox({open:true});
310 * Fixed a bug where IE would cut off the bottom portion of a photo, if the photo was larger than the document dimensions.
311
312 ### Version 1.0.3 - March 09 2009
313 * Fixed vertical centering for Safari 3.0.x.
314
315 ### Version 1.0.2 - March 06 2009
316 * Corrected a typo.
317 * Changed the content-type check so that it does not assume all links to photos should actually display photos. This allows for Ajax/inline/and iframe calls on anchors linking to picture file types.
318
319 ### Version 1.0.1 - March 05 2009
320 * Fixed keydown events (esc, left arrow, right arrow) for Webkit browsers.
321
322 ### Version 1.0 - March 03 2009
323 * First release
0 // ColorBox v1.3.20.1 - jQuery lightbox plugin
1 // (c) 2012 Jack Moore - jacklmoore.com
2 // License: http://www.opensource.org/licenses/mit-license.php
3 (function(e,t,n){function G(n,r,i){var o=t.createElement(n);return r&&(o.id=s+r),i&&(o.style.cssText=i),e(o)}function Y(e){var t=T.length,n=(U+e)%t;return n<0?t+n:n}function Z(e,t){return Math.round((/%/.test(e)?(t==="x"?tt():nt())/100:1)*parseInt(e,10))}function et(e){return B.photo||/\.(gif|png|jp(e|g|eg)|bmp|ico)((#|\?).*)?$/i.test(e)}function tt(){return n.innerWidth||N.width()}function nt(){return n.innerHeight||N.height()}function rt(){var t,n=e.data(R,i);n==null?(B=e.extend({},r),console&&console.log&&console.log("Error: cboxElement missing settings object")):B=e.extend({},n);for(t in B)e.isFunction(B[t])&&t.slice(0,2)!=="on"&&(B[t]=B[t].call(R));B.rel=B.rel||R.rel||"nofollow",B.href=B.href||e(R).attr("href"),B.title=B.title||R.title,typeof B.href=="string"&&(B.href=e.trim(B.href))}function it(t,n){e.event.trigger(t),n&&n.call(R)}function st(){var e,t=s+"Slideshow_",n="click."+s,r,i,o;B.slideshow&&T[1]?(r=function(){M.text(B.slideshowStop).unbind(n).bind(f,function(){if(B.loop||T[U+1])e=setTimeout(J.next,B.slideshowSpeed)}).bind(a,function(){clearTimeout(e)}).one(n+" "+l,i),g.removeClass(t+"off").addClass(t+"on"),e=setTimeout(J.next,B.slideshowSpeed)},i=function(){clearTimeout(e),M.text(B.slideshowStart).unbind([f,a,l,n].join(" ")).one(n,function(){J.next(),r()}),g.removeClass(t+"on").addClass(t+"off")},B.slideshowAuto?r():i()):g.removeClass(t+"off "+t+"on")}function ot(t){V||(R=t,rt(),T=e(R),U=0,B.rel!=="nofollow"&&(T=e("."+o).filter(function(){var t=e.data(this,i),n;return t&&(n=t.rel||this.rel),n===B.rel}),U=T.index(R),U===-1&&(T=T.add(R),U=T.length-1)),W||(W=X=!0,g.show(),B.returnFocus&&e(R).blur().one(c,function(){e(this).focus()}),m.css({opacity:+B.opacity,cursor:B.overlayClose?"pointer":"auto"}).show(),B.w=Z(B.initialWidth,"x"),B.h=Z(B.initialHeight,"y"),J.position(),d&&N.bind("resize."+v+" scroll."+v,function(){m.css({width:tt(),height:nt(),top:N.scrollTop(),left:N.scrollLeft()})}).trigger("resize."+v),it(u,B.onOpen),H.add(A).hide(),P.html(B.close).show()),J.load(!0))}function ut(){!g&&t.body&&(Q=!1,N=e(n),g=G(K).attr({id:i,"class":p?s+(d?"IE6":"IE"):""}).hide(),m=G(K,"Overlay",d?"position:absolute":"").hide(),L=G(K,"LoadingOverlay").add(G(K,"LoadingGraphic")),y=G(K,"Wrapper"),b=G(K,"Content").append(C=G(K,"LoadedContent","width:0; height:0; overflow:hidden"),A=G(K,"Title"),O=G(K,"Current"),_=G(K,"Next"),D=G(K,"Previous"),M=G(K,"Slideshow").bind(u,st),P=G(K,"Close")),y.append(G(K).append(G(K,"TopLeft"),w=G(K,"TopCenter"),G(K,"TopRight")),G(K,!1,"clear:left").append(E=G(K,"MiddleLeft"),b,S=G(K,"MiddleRight")),G(K,!1,"clear:left").append(G(K,"BottomLeft"),x=G(K,"BottomCenter"),G(K,"BottomRight"))).find("div div").css({"float":"left"}),k=G(K,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),H=_.add(D).add(O).add(M),e(t.body).append(m,g.append(y,k)))}function at(){return g?(Q||(Q=!0,j=w.height()+x.height()+b.outerHeight(!0)-b.height(),F=E.width()+S.width()+b.outerWidth(!0)-b.width(),I=C.outerHeight(!0),q=C.outerWidth(!0),g.css({"padding-bottom":j,"padding-right":F}),_.click(function(){J.next()}),D.click(function(){J.prev()}),P.click(function(){J.close()}),m.click(function(){B.overlayClose&&J.close()}),e(t).bind("keydown."+s,function(e){var t=e.keyCode;W&&B.escKey&&t===27&&(e.preventDefault(),J.close()),W&&B.arrowKey&&T[1]&&(t===37?(e.preventDefault(),D.click()):t===39&&(e.preventDefault(),_.click()))}),e("."+o,t).live("click",function(e){e.which>1||e.shiftKey||e.altKey||e.metaKey||(e.preventDefault(),ot(this))})),!0):!1}var r={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",open:!1,returnFocus:!0,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:undefined},i="colorbox",s="cbox",o=s+"Element",u=s+"_open",a=s+"_load",f=s+"_complete",l=s+"_cleanup",c=s+"_closed",h=s+"_purge",p=!e.support.opacity&&!e.support.style,d=p&&!n.XMLHttpRequest,v=s+"_IE6",m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,P,H,B,j,F,I,q,R,U,z,W,X,V,$,J,K="div",Q;if(e.colorbox)return;e(ut),J=e.fn[i]=e[i]=function(t,n){var s=this;t=t||{},ut();if(at()){if(!s[0]){if(s.selector)return s;s=e("<a/>"),t.open=!0}n&&(t.onComplete=n),s.each(function(){e.data(this,i,e.extend({},e.data(this,i)||r,t))}).addClass(o),(e.isFunction(t.open)&&t.open.call(s)||t.open)&&ot(s[0])}return s},J.position=function(e,t){function f(e){w[0].style.width=x[0].style.width=b[0].style.width=e.style.width,b[0].style.height=E[0].style.height=S[0].style.height=e.style.height}var n,r=0,i=0,o=g.offset(),u,a;N.unbind("resize."+s),g.css({top:-9e4,left:-9e4}),u=N.scrollTop(),a=N.scrollLeft(),B.fixed&&!d?(o.top-=u,o.left-=a,g.css({position:"fixed"})):(r=u,i=a,g.css({position:"absolute"})),B.right!==!1?i+=Math.max(tt()-B.w-q-F-Z(B.right,"x"),0):B.left!==!1?i+=Z(B.left,"x"):i+=Math.round(Math.max(tt()-B.w-q-F,0)/2),B.bottom!==!1?r+=Math.max(nt()-B.h-I-j-Z(B.bottom,"y"),0):B.top!==!1?r+=Z(B.top,"y"):r+=Math.round(Math.max(nt()-B.h-I-j,0)/2),g.css({top:o.top,left:o.left}),e=g.width()===B.w+q&&g.height()===B.h+I?0:e||0,y[0].style.width=y[0].style.height="9999px",n={width:B.w+q,height:B.h+I,top:r,left:i},e===0&&g.css(n),g.dequeue().animate(n,{duration:e,complete:function(){f(this),X=!1,y[0].style.width=B.w+q+F+"px",y[0].style.height=B.h+I+j+"px",B.reposition&&setTimeout(function(){N.bind("resize."+s,J.position)},1),t&&t()},step:function(){f(this)}})},J.resize=function(e){W&&(e=e||{},e.width&&(B.w=Z(e.width,"x")-q-F),e.innerWidth&&(B.w=Z(e.innerWidth,"x")),C.css({width:B.w}),e.height&&(B.h=Z(e.height,"y")-I-j),e.innerHeight&&(B.h=Z(e.innerHeight,"y")),!e.innerHeight&&!e.height&&(C.css({height:"auto"}),B.h=C.height()),C.css({height:B.h}),J.position(B.transition==="none"?0:B.speed))},J.prep=function(t){function o(){return B.w=B.w||C.width(),B.w=B.mw&&B.mw<B.w?B.mw:B.w,B.w}function u(){return B.h=B.h||C.height(),B.h=B.mh&&B.mh<B.h?B.mh:B.h,B.h}if(!W)return;var n,r=B.transition==="none"?0:B.speed;C.remove(),C=G(K,"LoadedContent").append(t),C.hide().appendTo(k.show()).css({width:o(),overflow:B.scrolling?"auto":"hidden"}).css({height:u()}).prependTo(b),k.hide(),e(z).css({"float":"none"}),d&&e("select").not(g.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(l,function(){this.style.visibility="inherit"}),n=function(){function y(){p&&g[0].style.removeAttribute("filter")}var t,n,o=T.length,u,a="frameBorder",l="allowTransparency",c,d,v,m;if(!W)return;c=function(){clearTimeout($),L.detach().hide(),it(f,B.onComplete)},p&&z&&C.fadeIn(100),A.html(B.title).add(C).show();if(o>1){typeof B.current=="string"&&O.html(B.current.replace("{current}",U+1).replace("{total}",o)).show(),_[B.loop||U<o-1?"show":"hide"]().html(B.next),D[B.loop||U?"show":"hide"]().html(B.previous),B.slideshow&&M.show();if(B.preloading){t=[Y(-1),Y(1)];while(n=T[t.pop()])m=e.data(n,i),m&&m.href?(d=m.href,e.isFunction(d)&&(d=d.call(n))):d=n.href,et(d)&&(v=new Image,v.src=d)}}else H.hide();B.iframe?(u=G("iframe")[0],a in u&&(u[a]=0),l in u&&(u[l]="true"),u.name=s+ +(new Date),B.fastIframe?c():e(u).one("load",c),u.src=B.href,B.scrolling||(u.scrolling="no"),e(u).addClass(s+"Iframe").appendTo(C).one(h,function(){u.src="//about:blank"})):c(),B.transition==="fade"?g.fadeTo(r,1,y):y()},B.transition==="fade"?g.fadeTo(r,0,function(){J.position(0,n)}):J.position(r,n)},J.load=function(t){var n,r,i=J.prep;X=!0,z=!1,R=T[U],t||rt(),it(h),it(a,B.onLoad),B.h=B.height?Z(B.height,"y")-I-j:B.innerHeight&&Z(B.innerHeight,"y"),B.w=B.width?Z(B.width,"x")-q-F:B.innerWidth&&Z(B.innerWidth,"x"),B.mw=B.w,B.mh=B.h,B.maxWidth&&(B.mw=Z(B.maxWidth,"x")-q-F,B.mw=B.w&&B.w<B.mw?B.w:B.mw),B.maxHeight&&(B.mh=Z(B.maxHeight,"y")-I-j,B.mh=B.h&&B.h<B.mh?B.h:B.mh),n=B.href,$=setTimeout(function(){L.show().appendTo(b)},100),B.inline?(G(K).hide().insertBefore(e(n)[0]).one(h,function(){e(this).replaceWith(C.children())}),i(e(n))):B.iframe?i(" "):B.html?i(B.html):et(n)?(e(z=new Image).addClass(s+"Photo").error(function(){B.title=!1,i(G(K,"Error").html(B.imgError))}).load(function(){var e;z.onload=null,B.scalePhotos&&(r=function(){z.height-=z.height*e,z.width-=z.width*e},B.mw&&z.width>B.mw&&(e=(z.width-B.mw)/z.width,r()),B.mh&&z.height>B.mh&&(e=(z.height-B.mh)/z.height,r())),B.h&&(z.style.marginTop=Math.max(B.h-z.height,0)/2+"px"),T[1]&&(B.loop||T[U+1])&&(z.style.cursor="pointer",z.onclick=function(){J.next()}),p&&(z.style.msInterpolationMode="bicubic"),setTimeout(function(){i(z)},1)}),setTimeout(function(){z.src=n},1)):n&&k.load(n,B.data,function(t,n,r){i(n==="error"?G(K,"Error").html(B.xhrError):e(this).contents())})},J.next=function(){!X&&T[1]&&(B.loop||T[U+1])&&(U=Y(1),J.load())},J.prev=function(){!X&&T[1]&&(B.loop||U)&&(U=Y(-1),J.load())},J.close=function(){W&&!V&&(V=!0,W=!1,it(l,B.onCleanup),N.unbind("."+s+" ."+v),m.fadeTo(200,0),g.stop().fadeTo(300,0,function(){g.add(m).css({opacity:1,cursor:"auto"}).hide(),it(h),C.remove(),setTimeout(function(){V=!1,it(c,B.onClosed)},1)}))},J.remove=function(){e([]).add(g).add(m).remove(),g=null,e("."+o).removeData(i).removeClass(o).die()},J.element=function(){return e(R)},J.settings=r})(jQuery,document,this);
0 // ColorBox v1.3.20.1 - jQuery lightbox plugin
1 // (c) 2012 Jack Moore - jacklmoore.com
2 // License: http://www.opensource.org/licenses/mit-license.php
3 (function ($, document, window) {
4 var
5 // Default settings object.
6 // See http://jacklmoore.com/colorbox for details.
7 defaults = {
8 transition: "elastic",
9 speed: 300,
10 width: false,
11 initialWidth: "600",
12 innerWidth: false,
13 maxWidth: false,
14 height: false,
15 initialHeight: "450",
16 innerHeight: false,
17 maxHeight: false,
18 scalePhotos: true,
19 scrolling: true,
20 inline: false,
21 html: false,
22 iframe: false,
23 fastIframe: true,
24 photo: false,
25 href: false,
26 title: false,
27 rel: false,
28 opacity: 0.9,
29 preloading: true,
30
31 current: "image {current} of {total}",
32 previous: "previous",
33 next: "next",
34 close: "close",
35 xhrError: "This content failed to load.",
36 imgError: "This image failed to load.",
37
38 open: false,
39 returnFocus: true,
40 reposition: true,
41 loop: true,
42 slideshow: false,
43 slideshowAuto: true,
44 slideshowSpeed: 2500,
45 slideshowStart: "start slideshow",
46 slideshowStop: "stop slideshow",
47 onOpen: false,
48 onLoad: false,
49 onComplete: false,
50 onCleanup: false,
51 onClosed: false,
52 overlayClose: true,
53 escKey: true,
54 arrowKey: true,
55 top: false,
56 bottom: false,
57 left: false,
58 right: false,
59 fixed: false,
60 data: undefined
61 },
62
63 // Abstracting the HTML and event identifiers for easy rebranding
64 colorbox = 'colorbox',
65 prefix = 'cbox',
66 boxElement = prefix + 'Element',
67
68 // Events
69 event_open = prefix + '_open',
70 event_load = prefix + '_load',
71 event_complete = prefix + '_complete',
72 event_cleanup = prefix + '_cleanup',
73 event_closed = prefix + '_closed',
74 event_purge = prefix + '_purge',
75
76 // Special Handling for IE
77 isIE = !$.support.opacity && !$.support.style, // IE7 & IE8
78 isIE6 = isIE && !window.XMLHttpRequest, // IE6
79 event_ie6 = prefix + '_IE6',
80
81 // Cached jQuery Object Variables
82 $overlay,
83 $box,
84 $wrap,
85 $content,
86 $topBorder,
87 $leftBorder,
88 $rightBorder,
89 $bottomBorder,
90 $related,
91 $window,
92 $loaded,
93 $loadingBay,
94 $loadingOverlay,
95 $title,
96 $current,
97 $slideshow,
98 $next,
99 $prev,
100 $close,
101 $groupControls,
102
103 // Variables for cached values or use across multiple functions
104 settings,
105 interfaceHeight,
106 interfaceWidth,
107 loadedHeight,
108 loadedWidth,
109 element,
110 index,
111 photo,
112 open,
113 active,
114 closing,
115 loadingTimer,
116 publicMethod,
117 div = "div",
118 init;
119
120 // ****************
121 // HELPER FUNCTIONS
122 // ****************
123
124 // Convience function for creating new jQuery objects
125 function $tag(tag, id, css) {
126 var element = document.createElement(tag);
127
128 if (id) {
129 element.id = prefix + id;
130 }
131
132 if (css) {
133 element.style.cssText = css;
134 }
135
136 return $(element);
137 }
138
139 // Determine the next and previous members in a group.
140 function getIndex(increment) {
141 var
142 max = $related.length,
143 newIndex = (index + increment) % max;
144
145 return (newIndex < 0) ? max + newIndex : newIndex;
146 }
147
148 // Convert '%' and 'px' values to integers
149 function setSize(size, dimension) {
150 return Math.round((/%/.test(size) ? ((dimension === 'x' ? winWidth() : winHeight()) / 100) : 1) * parseInt(size, 10));
151 }
152
153 // Checks an href to see if it is a photo.
154 // There is a force photo option (photo: true) for hrefs that cannot be matched by this regex.
155 function isImage(url) {
156 return settings.photo || /\.(gif|png|jp(e|g|eg)|bmp|ico)((#|\?).*)?$/i.test(url);
157 }
158
159 function winWidth() {
160 // $(window).width() is incorrect for some mobile browsers, but
161 // window.innerWidth is unsupported in IE8 and lower.
162 return window.innerWidth || $window.width();
163 }
164
165 function winHeight() {
166 return window.innerHeight || $window.height();
167 }
168
169 // Assigns function results to their respective properties
170 function makeSettings() {
171 var i,
172 data = $.data(element, colorbox);
173
174 if (data == null) {
175 settings = $.extend({}, defaults);
176 if (console && console.log) {
177 console.log('Error: cboxElement missing settings object');
178 }
179 } else {
180 settings = $.extend({}, data);
181 }
182
183 for (i in settings) {
184 if ($.isFunction(settings[i]) && i.slice(0, 2) !== 'on') { // checks to make sure the function isn't one of the callbacks, they will be handled at the appropriate time.
185 settings[i] = settings[i].call(element);
186 }
187 }
188
189 settings.rel = settings.rel || element.rel || 'nofollow';
190 settings.href = settings.href || $(element).attr('href');
191 settings.title = settings.title || element.title;
192
193 if (typeof settings.href === "string") {
194 settings.href = $.trim(settings.href);
195 }
196 }
197
198 function trigger(event, callback) {
199 $.event.trigger(event);
200 if (callback) {
201 callback.call(element);
202 }
203 }
204
205 // Slideshow functionality
206 function slideshow() {
207 var
208 timeOut,
209 className = prefix + "Slideshow_",
210 click = "click." + prefix,
211 start,
212 stop,
213 clear;
214
215 if (settings.slideshow && $related[1]) {
216 start = function () {
217 $slideshow
218 .text(settings.slideshowStop)
219 .unbind(click)
220 .bind(event_complete, function () {
221 if (settings.loop || $related[index + 1]) {
222 timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);
223 }
224 })
225 .bind(event_load, function () {
226 clearTimeout(timeOut);
227 })
228 .one(click + ' ' + event_cleanup, stop);
229 $box.removeClass(className + "off").addClass(className + "on");
230 timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);
231 };
232
233 stop = function () {
234 clearTimeout(timeOut);
235 $slideshow
236 .text(settings.slideshowStart)
237 .unbind([event_complete, event_load, event_cleanup, click].join(' '))
238 .one(click, function () {
239 publicMethod.next();
240 start();
241 });
242 $box.removeClass(className + "on").addClass(className + "off");
243 };
244
245 if (settings.slideshowAuto) {
246 start();
247 } else {
248 stop();
249 }
250 } else {
251 $box.removeClass(className + "off " + className + "on");
252 }
253 }
254
255 function launch(target) {
256 if (!closing) {
257
258 element = target;
259
260 makeSettings();
261
262 $related = $(element);
263
264 index = 0;
265
266 if (settings.rel !== 'nofollow') {
267 $related = $('.' + boxElement).filter(function () {
268 var data = $.data(this, colorbox),
269 relRelated;
270
271 if (data) {
272 relRelated = data.rel || this.rel;
273 }
274
275 return (relRelated === settings.rel);
276 });
277 index = $related.index(element);
278
279 // Check direct calls to ColorBox.
280 if (index === -1) {
281 $related = $related.add(element);
282 index = $related.length - 1;
283 }
284 }
285
286 if (!open) {
287 open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.
288
289 $box.show();
290
291 if (settings.returnFocus) {
292 $(element).blur().one(event_closed, function () {
293 $(this).focus();
294 });
295 }
296
297 // +settings.opacity avoids a problem in IE when using non-zero-prefixed-string-values, like '.5'
298 $overlay.css({"opacity": +settings.opacity, "cursor": settings.overlayClose ? "pointer" : "auto"}).show();
299
300 // Opens inital empty ColorBox prior to content being loaded.
301 settings.w = setSize(settings.initialWidth, 'x');
302 settings.h = setSize(settings.initialHeight, 'y');
303 publicMethod.position();
304
305 if (isIE6) {
306 $window.bind('resize.' + event_ie6 + ' scroll.' + event_ie6, function () {
307 $overlay.css({width: winWidth(), height: winHeight(), top: $window.scrollTop(), left: $window.scrollLeft()});
308 }).trigger('resize.' + event_ie6);
309 }
310
311 trigger(event_open, settings.onOpen);
312
313 $groupControls.add($title).hide();
314
315 $close.html(settings.close).show();
316 }
317
318 publicMethod.load(true);
319 }
320 }
321
322 // ColorBox's markup needs to be added to the DOM prior to being called
323 // so that the browser will go ahead and load the CSS background images.
324 function appendHTML() {
325 if (!$box && document.body) {
326 init = false;
327
328 $window = $(window);
329 $box = $tag(div).attr({id: colorbox, 'class': isIE ? prefix + (isIE6 ? 'IE6' : 'IE') : ''}).hide();
330 $overlay = $tag(div, "Overlay", isIE6 ? 'position:absolute' : '').hide();
331 $loadingOverlay = $tag(div, "LoadingOverlay").add($tag(div, "LoadingGraphic"));
332 $wrap = $tag(div, "Wrapper");
333 $content = $tag(div, "Content").append(
334 $loaded = $tag(div, "LoadedContent", 'width:0; height:0; overflow:hidden'),
335 $title = $tag(div, "Title"),
336 $current = $tag(div, "Current"),
337 $next = $tag(div, "Next"),
338 $prev = $tag(div, "Previous"),
339 $slideshow = $tag(div, "Slideshow").bind(event_open, slideshow),
340 $close = $tag(div, "Close")
341 );
342
343 $wrap.append( // The 3x3 Grid that makes up ColorBox
344 $tag(div).append(
345 $tag(div, "TopLeft"),
346 $topBorder = $tag(div, "TopCenter"),
347 $tag(div, "TopRight")
348 ),
349 $tag(div, false, 'clear:left').append(
350 $leftBorder = $tag(div, "MiddleLeft"),
351 $content,
352 $rightBorder = $tag(div, "MiddleRight")
353 ),
354 $tag(div, false, 'clear:left').append(
355 $tag(div, "BottomLeft"),
356 $bottomBorder = $tag(div, "BottomCenter"),
357 $tag(div, "BottomRight")
358 )
359 ).find('div div').css({'float': 'left'});
360
361 $loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none');
362
363 $groupControls = $next.add($prev).add($current).add($slideshow);
364
365 $(document.body).append($overlay, $box.append($wrap, $loadingBay));
366 }
367 }
368
369 // Add ColorBox's event bindings
370 function addBindings() {
371 if ($box) {
372 if (!init) {
373 init = true;
374
375 // Cache values needed for size calculations
376 interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();//Subtraction needed for IE6
377 interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
378 loadedHeight = $loaded.outerHeight(true);
379 loadedWidth = $loaded.outerWidth(true);
380
381 // Setting padding to remove the need to do size conversions during the animation step.
382 $box.css({"padding-bottom": interfaceHeight, "padding-right": interfaceWidth});
383
384 // Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
385 $next.click(function () {
386 publicMethod.next();
387 });
388 $prev.click(function () {
389 publicMethod.prev();
390 });
391 $close.click(function () {
392 publicMethod.close();
393 });
394 $overlay.click(function () {
395 if (settings.overlayClose) {
396 publicMethod.close();
397 }
398 });
399
400 // Key Bindings
401 $(document).bind('keydown.' + prefix, function (e) {
402 var key = e.keyCode;
403 if (open && settings.escKey && key === 27) {
404 e.preventDefault();
405 publicMethod.close();
406 }
407 if (open && settings.arrowKey && $related[1]) {
408 if (key === 37) {
409 e.preventDefault();
410 $prev.click();
411 } else if (key === 39) {
412 e.preventDefault();
413 $next.click();
414 }
415 }
416 });
417
418 $('.' + boxElement, document).live('click', function (e) {
419 // ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
420 // See: http://jacklmoore.com/notes/click-events/
421 if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey)) {
422 e.preventDefault();
423 launch(this);
424 }
425 });
426 }
427 return true;
428 }
429 return false;
430 }
431
432 // Don't do anything if ColorBox already exists.
433 if ($.colorbox) {
434 return;
435 }
436
437 // Append the HTML when the DOM loads
438 $(appendHTML);
439
440
441 // ****************
442 // PUBLIC FUNCTIONS
443 // Usage format: $.fn.colorbox.close();
444 // Usage from within an iframe: parent.$.fn.colorbox.close();
445 // ****************
446
447 publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) {
448 var $this = this;
449
450 options = options || {};
451
452 appendHTML();
453
454 if (addBindings()) {
455 if (!$this[0]) {
456 if ($this.selector) { // if a selector was given and it didn't match any elements, go ahead and exit.
457 return $this;
458 }
459 // if no selector was given (ie. $.colorbox()), create a temporary element to work with
460 $this = $('<a/>');
461 options.open = true; // assume an immediate open
462 }
463
464 if (callback) {
465 options.onComplete = callback;
466 }
467
468 $this.each(function () {
469 $.data(this, colorbox, $.extend({}, $.data(this, colorbox) || defaults, options));
470 }).addClass(boxElement);
471
472 if (($.isFunction(options.open) && options.open.call($this)) || options.open) {
473 launch($this[0]);
474 }
475 }
476
477 return $this;
478 };
479
480 publicMethod.position = function (speed, loadedCallback) {
481 var
482 css,
483 top = 0,
484 left = 0,
485 offset = $box.offset(),
486 scrollTop,
487 scrollLeft;
488
489 $window.unbind('resize.' + prefix);
490
491 // remove the modal so that it doesn't influence the document width/height
492 $box.css({top: -9e4, left: -9e4});
493
494 scrollTop = $window.scrollTop();
495 scrollLeft = $window.scrollLeft();
496
497 if (settings.fixed && !isIE6) {
498 offset.top -= scrollTop;
499 offset.left -= scrollLeft;
500 $box.css({position: 'fixed'});
501 } else {
502 top = scrollTop;
503 left = scrollLeft;
504 $box.css({position: 'absolute'});
505 }
506
507 // keeps the top and left positions within the browser's viewport.
508 if (settings.right !== false) {
509 left += Math.max(winWidth() - settings.w - loadedWidth - interfaceWidth - setSize(settings.right, 'x'), 0);
510 } else if (settings.left !== false) {
511 left += setSize(settings.left, 'x');
512 } else {
513 left += Math.round(Math.max(winWidth() - settings.w - loadedWidth - interfaceWidth, 0) / 2);
514 }
515
516 if (settings.bottom !== false) {
517 top += Math.max(winHeight() - settings.h - loadedHeight - interfaceHeight - setSize(settings.bottom, 'y'), 0);
518 } else if (settings.top !== false) {
519 top += setSize(settings.top, 'y');
520 } else {
521 top += Math.round(Math.max(winHeight() - settings.h - loadedHeight - interfaceHeight, 0) / 2);
522 }
523
524 $box.css({top: offset.top, left: offset.left});
525
526 // setting the speed to 0 to reduce the delay between same-sized content.
527 speed = ($box.width() === settings.w + loadedWidth && $box.height() === settings.h + loadedHeight) ? 0 : speed || 0;
528
529 // this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly,
530 // but it has to be shrank down around the size of div#colorbox when it's done. If not,
531 // it can invoke an obscure IE bug when using iframes.
532 $wrap[0].style.width = $wrap[0].style.height = "9999px";
533
534 function modalDimensions(that) {
535 $topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = that.style.width;
536 $content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = that.style.height;
537 }
538
539 css = {width: settings.w + loadedWidth, height: settings.h + loadedHeight, top: top, left: left};
540 if(speed===0){ // temporary workaround to side-step jQuery-UI 1.8 bug (http://bugs.jquery.com/ticket/12273)
541 $box.css(css);
542 }
543 $box.dequeue().animate(css, {
544 duration: speed,
545 complete: function () {
546 modalDimensions(this);
547
548 active = false;
549
550 // shrink the wrapper down to exactly the size of colorbox to avoid a bug in IE's iframe implementation.
551 $wrap[0].style.width = (settings.w + loadedWidth + interfaceWidth) + "px";
552 $wrap[0].style.height = (settings.h + loadedHeight + interfaceHeight) + "px";
553
554 if (settings.reposition) {
555 setTimeout(function () { // small delay before binding onresize due to an IE8 bug.
556 $window.bind('resize.' + prefix, publicMethod.position);
557 }, 1);
558 }
559
560 if (loadedCallback) {
561 loadedCallback();
562 }
563 },
564 step: function () {
565 modalDimensions(this);
566 }
567 });
568 };
569
570 publicMethod.resize = function (options) {
571 if (open) {
572 options = options || {};
573
574 if (options.width) {
575 settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth;
576 }
577 if (options.innerWidth) {
578 settings.w = setSize(options.innerWidth, 'x');
579 }
580 $loaded.css({width: settings.w});
581
582 if (options.height) {
583 settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight;
584 }
585 if (options.innerHeight) {
586 settings.h = setSize(options.innerHeight, 'y');
587 }
588 if (!options.innerHeight && !options.height) {
589 $loaded.css({height: "auto"});
590 settings.h = $loaded.height();
591 }
592 $loaded.css({height: settings.h});
593
594 publicMethod.position(settings.transition === "none" ? 0 : settings.speed);
595 }
596 };
597
598 publicMethod.prep = function (object) {
599 if (!open) {
600 return;
601 }
602
603 var callback, speed = settings.transition === "none" ? 0 : settings.speed;
604
605 $loaded.remove();
606 $loaded = $tag(div, 'LoadedContent').append(object);
607
608 function getWidth() {
609 settings.w = settings.w || $loaded.width();
610 settings.w = settings.mw && settings.mw < settings.w ? settings.mw : settings.w;
611 return settings.w;
612 }
613 function getHeight() {
614 settings.h = settings.h || $loaded.height();
615 settings.h = settings.mh && settings.mh < settings.h ? settings.mh : settings.h;
616 return settings.h;
617 }
618
619 $loaded.hide()
620 .appendTo($loadingBay.show())// content has to be appended to the DOM for accurate size calculations.
621 .css({width: getWidth(), overflow: settings.scrolling ? 'auto' : 'hidden'})
622 .css({height: getHeight()})// sets the height independently from the width in case the new width influences the value of height.
623 .prependTo($content);
624
625 $loadingBay.hide();
626
627 // floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width.
628 //$(photo).css({'float': 'none', marginLeft: 'auto', marginRight: 'auto'});
629
630 $(photo).css({'float': 'none'});
631
632 // Hides SELECT elements in IE6 because they would otherwise sit on top of the overlay.
633 if (isIE6) {
634 $('select').not($box.find('select')).filter(function () {
635 return this.style.visibility !== 'hidden';
636 }).css({'visibility': 'hidden'}).one(event_cleanup, function () {
637 this.style.visibility = 'inherit';
638 });
639 }
640
641 callback = function () {
642 var preload,
643 i,
644 total = $related.length,
645 iframe,
646 frameBorder = 'frameBorder',
647 allowTransparency = 'allowTransparency',
648 complete,
649 src,
650 img,
651 data;
652
653 if (!open) {
654 return;
655 }
656
657 function removeFilter() {
658 if (isIE) {
659 $box[0].style.removeAttribute('filter');
660 }
661 }
662
663 complete = function () {
664 clearTimeout(loadingTimer);
665 // Detaching forces Andriod stock browser to redraw the area underneat the loading overlay. Hiding alone isn't enough.
666 $loadingOverlay.detach().hide();
667 trigger(event_complete, settings.onComplete);
668 };
669
670 if (isIE) {
671 //This fadeIn helps the bicubic resampling to kick-in.
672 if (photo) {
673 $loaded.fadeIn(100);
674 }
675 }
676
677 $title.html(settings.title).add($loaded).show();
678
679 if (total > 1) { // handle grouping
680 if (typeof settings.current === "string") {
681 $current.html(settings.current.replace('{current}', index + 1).replace('{total}', total)).show();
682 }
683
684 $next[(settings.loop || index < total - 1) ? "show" : "hide"]().html(settings.next);
685 $prev[(settings.loop || index) ? "show" : "hide"]().html(settings.previous);
686
687 if (settings.slideshow) {
688 $slideshow.show();
689 }
690
691 // Preloads images within a rel group
692 if (settings.preloading) {
693 preload = [
694 getIndex(-1),
695 getIndex(1)
696 ];
697 while (i = $related[preload.pop()]) {
698 data = $.data(i, colorbox);
699
700 if (data && data.href) {
701 src = data.href;
702 if ($.isFunction(src)) {
703 src = src.call(i);
704 }
705 } else {
706 src = i.href;
707 }
708
709 if (isImage(src)) {
710 img = new Image();
711 img.src = src;
712 }
713 }
714 }
715 } else {
716 $groupControls.hide();
717 }
718
719 if (settings.iframe) {
720 iframe = $tag('iframe')[0];
721
722 if (frameBorder in iframe) {
723 iframe[frameBorder] = 0;
724 }
725 if (allowTransparency in iframe) {
726 iframe[allowTransparency] = "true";
727 }
728 // give the iframe a unique name to prevent caching
729 iframe.name = prefix + (+new Date());
730 if (settings.fastIframe) {
731 complete();
732 } else {
733 $(iframe).one('load', complete);
734 }
735 iframe.src = settings.href;
736 if (!settings.scrolling) {
737 iframe.scrolling = "no";
738 }
739 $(iframe).addClass(prefix + 'Iframe').appendTo($loaded).one(event_purge, function () {
740 iframe.src = "//about:blank";
741 });
742 } else {
743 complete();
744 }
745
746 if (settings.transition === 'fade') {
747 $box.fadeTo(speed, 1, removeFilter);
748 } else {
749 removeFilter();
750 }
751 };
752
753 if (settings.transition === 'fade') {
754 $box.fadeTo(speed, 0, function () {
755 publicMethod.position(0, callback);
756 });
757 } else {
758 publicMethod.position(speed, callback);
759 }
760 };
761
762 publicMethod.load = function (launched) {
763 var href, setResize, prep = publicMethod.prep;
764
765 active = true;
766
767 photo = false;
768
769 element = $related[index];
770
771 if (!launched) {
772 makeSettings();
773 }
774
775 trigger(event_purge);
776
777 trigger(event_load, settings.onLoad);
778
779 settings.h = settings.height ?
780 setSize(settings.height, 'y') - loadedHeight - interfaceHeight :
781 settings.innerHeight && setSize(settings.innerHeight, 'y');
782
783 settings.w = settings.width ?
784 setSize(settings.width, 'x') - loadedWidth - interfaceWidth :
785 settings.innerWidth && setSize(settings.innerWidth, 'x');
786
787 // Sets the minimum dimensions for use in image scaling
788 settings.mw = settings.w;
789 settings.mh = settings.h;
790
791 // Re-evaluate the minimum width and height based on maxWidth and maxHeight values.
792 // If the width or height exceed the maxWidth or maxHeight, use the maximum values instead.
793 if (settings.maxWidth) {
794 settings.mw = setSize(settings.maxWidth, 'x') - loadedWidth - interfaceWidth;
795 settings.mw = settings.w && settings.w < settings.mw ? settings.w : settings.mw;
796 }
797 if (settings.maxHeight) {
798 settings.mh = setSize(settings.maxHeight, 'y') - loadedHeight - interfaceHeight;
799 settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh;
800 }
801
802 href = settings.href;
803
804 loadingTimer = setTimeout(function () {
805 $loadingOverlay.show().appendTo($content);
806 }, 100);
807
808 if (settings.inline) {
809 // Inserts an empty placeholder where inline content is being pulled from.
810 // An event is bound to put inline content back when ColorBox closes or loads new content.
811 $tag(div).hide().insertBefore($(href)[0]).one(event_purge, function () {
812 $(this).replaceWith($loaded.children());
813 });
814 prep($(href));
815 } else if (settings.iframe) {
816 // IFrame element won't be added to the DOM until it is ready to be displayed,
817 // to avoid problems with DOM-ready JS that might be trying to run in that iframe.
818 prep(" ");
819 } else if (settings.html) {
820 prep(settings.html);
821 } else if (isImage(href)) {
822 $(photo = new Image())
823 .addClass(prefix + 'Photo')
824 .error(function () {
825 settings.title = false;
826 prep($tag(div, 'Error').html(settings.imgError));
827 })
828 .load(function () {
829 var percent;
830 photo.onload = null; //stops animated gifs from firing the onload repeatedly.
831
832 if (settings.scalePhotos) {
833 setResize = function () {
834 photo.height -= photo.height * percent;
835 photo.width -= photo.width * percent;
836 };
837 if (settings.mw && photo.width > settings.mw) {
838 percent = (photo.width - settings.mw) / photo.width;
839 setResize();
840 }
841 if (settings.mh && photo.height > settings.mh) {
842 percent = (photo.height - settings.mh) / photo.height;
843 setResize();
844 }
845 }
846
847 if (settings.h) {
848 photo.style.marginTop = Math.max(settings.h - photo.height, 0) / 2 + 'px';
849 }
850
851 if ($related[1] && (settings.loop || $related[index + 1])) {
852 photo.style.cursor = 'pointer';
853 photo.onclick = function () {
854 publicMethod.next();
855 };
856 }
857
858 if (isIE) {
859 photo.style.msInterpolationMode = 'bicubic';
860 }
861
862 setTimeout(function () { // A pause because Chrome will sometimes report a 0 by 0 size otherwise.
863 prep(photo);
864 }, 1);
865 });
866
867 setTimeout(function () { // A pause because Opera 10.6+ will sometimes not run the onload function otherwise.
868 photo.src = href;
869 }, 1);
870 } else if (href) {
871 $loadingBay.load(href, settings.data, function (data, status, xhr) {
872 prep(status === 'error' ? $tag(div, 'Error').html(settings.xhrError) : $(this).contents());
873 });
874 }
875 };
876
877 // Navigates to the next page/image in a set.
878 publicMethod.next = function () {
879 if (!active && $related[1] && (settings.loop || $related[index + 1])) {
880 index = getIndex(1);
881 publicMethod.load();
882 }
883 };
884
885 publicMethod.prev = function () {
886 if (!active && $related[1] && (settings.loop || index)) {
887 index = getIndex(-1);
888 publicMethod.load();
889 }
890 };
891
892 // Note: to use this within an iframe use the following format: parent.$.fn.colorbox.close();
893 publicMethod.close = function () {
894 if (open && !closing) {
895
896 closing = true;
897
898 open = false;
899
900 trigger(event_cleanup, settings.onCleanup);
901
902 $window.unbind('.' + prefix + ' .' + event_ie6);
903
904 $overlay.fadeTo(200, 0);
905
906 $box.stop().fadeTo(300, 0, function () {
907
908 $box.add($overlay).css({'opacity': 1, cursor: 'auto'}).hide();
909
910 trigger(event_purge);
911
912 $loaded.remove();
913
914 setTimeout(function () {
915 closing = false;
916 trigger(event_closed, settings.onClosed);
917 }, 1);
918 });
919 }
920 };
921
922 // Removes changes ColorBox made to the document, but does not remove the plugin
923 // from jQuery.
924 publicMethod.remove = function () {
925 $([]).add($box).add($overlay).remove();
926 $box = null;
927 $('.' + boxElement)
928 .removeData(colorbox)
929 .removeClass(boxElement)
930 .die();
931 };
932
933 // A method for fetching the current element ColorBox is referencing.
934 // returns a jQuery object.
935 publicMethod.element = function () {
936 return $(element);
937 };
938
939 publicMethod.settings = defaults;
940
941 }(jQuery, document, this));
Binary diff not shown
0 <div id='homer' style="background:url(../content/homer.jpg) right center no-repeat #ececec; height:135px; width:280px; padding:30px 10px;">
1 <strong>Homer</strong><br/>
2 <em>\noun\</em><br/>
3 <strong>1.</strong> American bonehead<br/>
4 <strong>2. Pull a Homer-</strong><br/>
5 to succeed despite<br/>
6 idiocy
7 </div>
8 <script>
9 $('#homer strong').css({color:'red'});
10 </script>
0 <div style="width:504px; height:412px; overflow:hidden;">
1 <object>
2 <param name="allowfullscreen" value="true" /><param name="wmode" value="opaque" />
3 <param name="allowscriptaccess" value="always" />
4 <param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=2285902&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" />
5 <embed src="http://vimeo.com/moogaloop.swf?clip_id=2285902&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" wmode="opaque" allowscriptaccess="always" width="504" height="412"></embed>
6 </object>
7 </div>
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
0 /*
1 ColorBox Core Style:
2 The following CSS is consistent between example themes and should not be altered.
3 */
4 #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
5 #cboxOverlay{position:fixed; width:100%; height:100%;}
6 #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
7 #cboxContent{position:relative;}
8 #cboxLoadedContent{overflow:auto;}
9 #cboxTitle{margin:0;}
10 #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
11 #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
12 .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;}
13 .cboxIframe{width:100%; height:100%; display:block; border:0;}
14 #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box;}
15
16 /*
17 User Style:
18 Change the following styles to modify the appearance of ColorBox. They are
19 ordered & tabbed in a way that represents the nesting of the generated HTML.
20 */
21 #cboxOverlay{background:url(images/overlay.png) repeat 0 0;}
22 #colorbox{}
23 #cboxTopLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px 0;}
24 #cboxTopRight{width:21px; height:21px; background:url(images/controls.png) no-repeat -130px 0;}
25 #cboxBottomLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px -29px;}
26 #cboxBottomRight{width:21px; height:21px; background:url(images/controls.png) no-repeat -130px -29px;}
27 #cboxMiddleLeft{width:21px; background:url(images/controls.png) left top repeat-y;}
28 #cboxMiddleRight{width:21px; background:url(images/controls.png) right top repeat-y;}
29 #cboxTopCenter{height:21px; background:url(images/border.png) 0 0 repeat-x;}
30 #cboxBottomCenter{height:21px; background:url(images/border.png) 0 -29px repeat-x;}
31 #cboxContent{background:#fff; overflow:hidden;}
32 .cboxIframe{background:#fff;}
33 #cboxError{padding:50px; border:1px solid #ccc;}
34 #cboxLoadedContent{margin-bottom:28px;}
35 #cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
36 #cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
37 #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
38 #cboxPrevious{position:absolute; bottom:0; left:0; background:url(images/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;}
39 #cboxPrevious:hover{background-position:-75px -25px;}
40 #cboxNext{position:absolute; bottom:0; left:27px; background:url(images/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;}
41 #cboxNext:hover{background-position:-50px -25px;}
42 #cboxLoadingOverlay{background:url(images/loading_background.png) no-repeat center center;}
43 #cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;}
44 #cboxClose{position:absolute; bottom:0; right:0; background:url(images/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;}
45 #cboxClose:hover{background-position:-25px -25px;}
46
47 /*
48 The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
49 when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
50 See: http://jacklmoore.com/notes/ie-transparency-problems/
51 */
52 .cboxIE #cboxTopLeft,
53 .cboxIE #cboxTopCenter,
54 .cboxIE #cboxTopRight,
55 .cboxIE #cboxBottomLeft,
56 .cboxIE #cboxBottomCenter,
57 .cboxIE #cboxBottomRight,
58 .cboxIE #cboxMiddleLeft,
59 .cboxIE #cboxMiddleRight {
60 filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
61 }
62
63 /*
64 The following provides PNG transparency support for IE6
65 Feel free to remove this and the /ie6/ directory if you have dropped IE6 support.
66 */
67 .cboxIE6 #cboxTopLeft{background:url(images/ie6/borderTopLeft.png);}
68 .cboxIE6 #cboxTopCenter{background:url(images/ie6/borderTopCenter.png);}
69 .cboxIE6 #cboxTopRight{background:url(images/ie6/borderTopRight.png);}
70 .cboxIE6 #cboxBottomLeft{background:url(images/ie6/borderBottomLeft.png);}
71 .cboxIE6 #cboxBottomCenter{background:url(images/ie6/borderBottomCenter.png);}
72 .cboxIE6 #cboxBottomRight{background:url(images/ie6/borderBottomRight.png);}
73 .cboxIE6 #cboxMiddleLeft{background:url(images/ie6/borderMiddleLeft.png);}
74 .cboxIE6 #cboxMiddleRight{background:url(images/ie6/borderMiddleRight.png);}
75
76 .cboxIE6 #cboxTopLeft,
77 .cboxIE6 #cboxTopCenter,
78 .cboxIE6 #cboxTopRight,
79 .cboxIE6 #cboxBottomLeft,
80 .cboxIE6 #cboxBottomCenter,
81 .cboxIE6 #cboxBottomRight,
82 .cboxIE6 #cboxMiddleLeft,
83 .cboxIE6 #cboxMiddleRight {
84 _behavior: expression(this.src = this.src ? this.src : this.currentStyle.backgroundImage.split('"')[1], this.style.background = "none", this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + this.src + ", sizingMethod='scale')");
85 }
Binary diff not shown
0 <!DOCTYPE html>
1 <html>
2 <head>
3 <meta charset='utf-8'/>
4 <title>ColorBox Examples</title>
5 <style>
6 body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;}
7 a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;}
8 h2{font-size:13px; margin:15px 0 0 0;}
9 </style>
10 <link rel="stylesheet" href="colorbox.css" />
11 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
12 <script src="../colorbox/jquery.colorbox.js"></script>
13 <script>
14 $(document).ready(function(){
15 //Examples of how to assign the ColorBox event to elements
16 $(".group1").colorbox({rel:'group1'});
17 $(".group2").colorbox({rel:'group2', transition:"fade"});
18 $(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"});
19 $(".group4").colorbox({rel:'group4', slideshow:true});
20 $(".ajax").colorbox();
21 $(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
22 $(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
23 $(".inline").colorbox({inline:true, width:"50%"});
24 $(".callbacks").colorbox({
25 onOpen:function(){ alert('onOpen: colorbox is about to open'); },
26 onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
27 onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
28 onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
29 onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
30 });
31
32 //Example of preserving a JavaScript event for inline calls.
33 $("#click").click(function(){
34 $('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
35 return false;
36 });
37 });
38 </script>
39 </head>
40 <body>
41 <h1>ColorBox Demonstration</h1>
42
43 <h2>Elastic Transition</h2>
44 <p><a class="group1" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
45 <p><a class="group1" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
46 <p><a class="group1" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
47
48 <h2>Fade Transition</h2>
49 <p><a class="group2" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee">Grouped Photo 1</a></p>
50 <p><a class="group2" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
51 <p><a class="group2" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
52
53 <h2>No Transition + fixed width and height (75% of screen size)</h2>
54 <p><a class="group3" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
55 <p><a class="group3" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
56 <p><a class="group3" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
57
58 <h2>Slideshow</h2>
59 <p><a class="group4" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
60 <p><a class="group4" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
61 <p><a class="group4" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
62
63 <h2>Other Content Types</h2>
64 <p><a class='ajax' href="../content/ajax.html" title="Homer Defined">Outside HTML (Ajax)</a></p>
65 <p><a class='ajax' href="../content/flash.html" title="Royksopp: Remind Me">Flash / Video (Ajax/Embedded)</a></p>
66 <p><a class='youtube' href="http://www.youtube.com/embed/617ANIA5Rqs?rel=0&amp;wmode=transparent" title="The Knife: We Share Our Mother's Health">Flash / Video (Iframe/Direct Link To YouTube)</a></p>
67 <p><a class='iframe' href="http://threadless.com">Outside Webpage (Iframe)</a></p>
68 <p><a class='inline' href="#inline_content">Inline HTML</a></p>
69
70 <h2>Demonstration of using callbacks</h2>
71 <p><a class='callbacks' href="../content/marylou.jpg" title="Marylou on Cumberland Island">Example with alerts</a>. Callbacks and event-hooks allow users to extend functionality without having to rewrite parts of the plugin.</p>
72
73 <!-- This contains the hidden content for inline calls -->
74 <div style='display:none'>
75 <div id='inline_content' style='padding:10px; background:#fff;'>
76 <p><strong>This content comes from a hidden element on this page.</strong></p>
77 <p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p>
78 <p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p>
79
80 <p><strong>If you try to open a new ColorBox while it is already open, it will update itself with the new content.</strong></p>
81 <p>Updating Content Example:<br />
82 <a class="ajax" href="../content/flash.html">Click here to load new content</a></p>
83 </div>
84 </div>
85 </body>
86 </html>
0 /*
1 ColorBox Core Style:
2 The following CSS is consistent between example themes and should not be altered.
3 */
4 #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
5 #cboxOverlay{position:fixed; width:100%; height:100%;}
6 #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
7 #cboxContent{position:relative;}
8 #cboxLoadedContent{overflow:auto;}
9 #cboxTitle{margin:0;}
10 #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
11 #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
12 .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;}
13 .cboxIframe{width:100%; height:100%; display:block; border:0;}
14 #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box;}
15
16 /*
17 User Style:
18 Change the following styles to modify the appearance of ColorBox. They are
19 ordered & tabbed in a way that represents the nesting of the generated HTML.
20 */
21 #cboxOverlay{background:#fff;}
22 #colorbox{}
23 #cboxContent{margin-top:32px; overflow:visible;}
24 .cboxIframe{background:#fff;}
25 #cboxError{padding:50px; border:1px solid #ccc;}
26 #cboxLoadedContent{background:#000; padding:1px;}
27 #cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;}
28 #cboxLoadingOverlay{background:#000;}
29 #cboxTitle{position:absolute; top:-22px; left:0; color:#000;}
30 #cboxCurrent{position:absolute; top:-22px; right:205px; text-indent:-9999px;}
31 #cboxSlideshow, #cboxPrevious, #cboxNext, #cboxClose{text-indent:-9999px; width:20px; height:20px; position:absolute; top:-20px; background:url(images/controls.png) no-repeat 0 0;}
32 #cboxPrevious{background-position:0px 0px; right:44px;}
33 #cboxPrevious:hover{background-position:0px -25px;}
34 #cboxNext{background-position:-25px 0px; right:22px;}
35 #cboxNext:hover{background-position:-25px -25px;}
36 #cboxClose{background-position:-50px 0px; right:0;}
37 #cboxClose:hover{background-position:-50px -25px;}
38 .cboxSlideshow_on #cboxPrevious, .cboxSlideshow_off #cboxPrevious{right:66px;}
39 .cboxSlideshow_on #cboxSlideshow{background-position:-75px -25px; right:44px;}
40 .cboxSlideshow_on #cboxSlideshow:hover{background-position:-100px -25px;}
41 .cboxSlideshow_off #cboxSlideshow{background-position:-100px 0px; right:44px;}
42 .cboxSlideshow_off #cboxSlideshow:hover{background-position:-75px -25px;}
0 <!DOCTYPE html>
1 <html>
2 <head>
3 <meta charset='utf-8'/>
4 <title>ColorBox Examples</title>
5 <style>
6 body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;}
7 a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;}
8 h2{font-size:13px; margin:15px 0 0 0;}
9 </style>
10 <link rel="stylesheet" href="colorbox.css" />
11 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
12 <script src="../colorbox/jquery.colorbox.js"></script>
13 <script>
14 $(document).ready(function(){
15 //Examples of how to assign the ColorBox event to elements
16 $(".group1").colorbox({rel:'group1'});
17 $(".group2").colorbox({rel:'group2', transition:"fade"});
18 $(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"});
19 $(".group4").colorbox({rel:'group4', slideshow:true});
20 $(".ajax").colorbox();
21 $(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
22 $(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
23 $(".inline").colorbox({inline:true, width:"50%"});
24 $(".callbacks").colorbox({
25 onOpen:function(){ alert('onOpen: colorbox is about to open'); },
26 onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
27 onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
28 onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
29 onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
30 });
31
32 //Example of preserving a JavaScript event for inline calls.
33 $("#click").click(function(){
34 $('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
35 return false;
36 });
37 });
38 </script>
39 </head>
40 <body>
41 <h1>ColorBox Demonstration</h1>
42
43 <h2>Elastic Transition</h2>
44 <p><a class="group1" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
45 <p><a class="group1" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
46 <p><a class="group1" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
47
48 <h2>Fade Transition</h2>
49 <p><a class="group2" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee">Grouped Photo 1</a></p>
50 <p><a class="group2" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
51 <p><a class="group2" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
52
53 <h2>No Transition + fixed width and height (75% of screen size)</h2>
54 <p><a class="group3" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
55 <p><a class="group3" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
56 <p><a class="group3" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
57
58 <h2>Slideshow</h2>
59 <p><a class="group4" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
60 <p><a class="group4" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
61 <p><a class="group4" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
62
63 <h2>Other Content Types</h2>
64 <p><a class='ajax' href="../content/ajax.html" title="Homer Defined">Outside HTML (Ajax)</a></p>
65 <p><a class='ajax' href="../content/flash.html" title="Royksopp: Remind Me">Flash / Video (Ajax/Embedded)</a></p>
66 <p><a class='youtube' href="http://www.youtube.com/embed/617ANIA5Rqs?rel=0&amp;wmode=transparent" title="The Knife: We Share Our Mother's Health">Flash / Video (Iframe/Direct Link To YouTube)</a></p>
67 <p><a class='iframe' href="http://threadless.com">Outside Webpage (Iframe)</a></p>
68 <p><a class='inline' href="#inline_content">Inline HTML</a></p>
69
70 <h2>Demonstration of using callbacks</h2>
71 <p><a class='callbacks' href="../content/marylou.jpg" title="Marylou on Cumberland Island">Example with alerts</a>. Callbacks and event-hooks allow users to extend functionality without having to rewrite parts of the plugin.</p>
72
73 <!-- This contains the hidden content for inline calls -->
74 <div style='display:none'>
75 <div id='inline_content' style='padding:10px; background:#fff;'>
76 <p><strong>This content comes from a hidden element on this page.</strong></p>
77 <p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p>
78 <p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p>
79
80 <p><strong>If you try to open a new ColorBox while it is already open, it will update itself with the new content.</strong></p>
81 <p>Updating Content Example:<br />
82 <a class="ajax" href="../content/flash.html">Click here to load new content</a></p>
83 </div>
84 </div>
85 </body>
86 </html>
0 /*
1 ColorBox Core Style:
2 The following CSS is consistent between example themes and should not be altered.
3 */
4 #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
5 #cboxOverlay{position:fixed; width:100%; height:100%;}
6 #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
7 #cboxContent{position:relative;}
8 #cboxLoadedContent{overflow:auto;}
9 #cboxTitle{margin:0;}
10 #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
11 #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
12 .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width: none;}
13 .cboxIframe{width:100%; height:100%; display:block; border:0;}
14 #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box;}
15
16 /*
17 User Style:
18 Change the following styles to modify the appearance of ColorBox. They are
19 ordered & tabbed in a way that represents the nesting of the generated HTML.
20 */
21 #cboxOverlay{background:#000;}
22 #colorbox{}
23 #cboxContent{margin-top:20px;}
24 .cboxIframe{background:#fff;}
25 #cboxError{padding:50px; border:1px solid #ccc;}
26 #cboxLoadedContent{border:5px solid #000; background:#fff;}
27 #cboxTitle{position:absolute; top:-20px; left:0; color:#ccc;}
28 #cboxCurrent{position:absolute; top:-20px; right:0px; color:#ccc;}
29 #cboxSlideshow{position:absolute; top:-20px; right:90px; color:#fff;}
30 #cboxPrevious{position:absolute; top:50%; left:5px; margin-top:-32px; background:url(images/controls.png) no-repeat top left; width:28px; height:65px; text-indent:-9999px;}
31 #cboxPrevious:hover{background-position:bottom left;}
32 #cboxNext{position:absolute; top:50%; right:5px; margin-top:-32px; background:url(images/controls.png) no-repeat top right; width:28px; height:65px; text-indent:-9999px;}
33 #cboxNext:hover{background-position:bottom right;}
34 #cboxLoadingOverlay{background:#000;}
35 #cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;}
36 #cboxClose{position:absolute; top:5px; right:5px; display:block; background:url(images/controls.png) no-repeat top center; width:38px; height:19px; text-indent:-9999px;}
37 #cboxClose:hover{background-position:bottom center;}
0 <!DOCTYPE html>
1 <html>
2 <head>
3 <meta charset='utf-8'/>
4 <title>ColorBox Examples</title>
5 <style>
6 body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;}
7 a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;}
8 h2{font-size:13px; margin:15px 0 0 0;}
9 </style>
10 <link rel="stylesheet" href="colorbox.css" />
11 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
12 <script src="../colorbox/jquery.colorbox.js"></script>
13 <script>
14 $(document).ready(function(){
15 //Examples of how to assign the ColorBox event to elements
16 $(".group1").colorbox({rel:'group1'});
17 $(".group2").colorbox({rel:'group2', transition:"fade"});
18 $(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"});
19 $(".group4").colorbox({rel:'group4', slideshow:true});
20 $(".ajax").colorbox();
21 $(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
22 $(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
23 $(".inline").colorbox({inline:true, width:"50%"});
24 $(".callbacks").colorbox({
25 onOpen:function(){ alert('onOpen: colorbox is about to open'); },
26 onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
27 onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
28 onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
29 onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
30 });
31
32 //Example of preserving a JavaScript event for inline calls.
33 $("#click").click(function(){
34 $('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
35 return false;
36 });
37 });
38 </script>
39 </head>
40 <body>
41 <h1>ColorBox Demonstration</h1>
42
43 <h2>Elastic Transition</h2>
44 <p><a class="group1" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
45 <p><a class="group1" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
46 <p><a class="group1" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
47
48 <h2>Fade Transition</h2>
49 <p><a class="group2" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee">Grouped Photo 1</a></p>
50 <p><a class="group2" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
51 <p><a class="group2" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
52
53 <h2>No Transition + fixed width and height (75% of screen size)</h2>
54 <p><a class="group3" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
55 <p><a class="group3" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
56 <p><a class="group3" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
57
58 <h2>Slideshow</h2>
59 <p><a class="group4" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
60 <p><a class="group4" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
61 <p><a class="group4" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
62
63 <h2>Other Content Types</h2>
64 <p><a class='ajax' href="../content/ajax.html" title="Homer Defined">Outside HTML (Ajax)</a></p>
65 <p><a class='ajax' href="../content/flash.html" title="Royksopp: Remind Me">Flash / Video (Ajax/Embedded)</a></p>
66 <p><a class='youtube' href="http://www.youtube.com/embed/617ANIA5Rqs?rel=0&amp;wmode=transparent" title="The Knife: We Share Our Mother's Health">Flash / Video (Iframe/Direct Link To YouTube)</a></p>
67 <p><a class='iframe' href="http://threadless.com">Outside Webpage (Iframe)</a></p>
68 <p><a class='inline' href="#inline_content">Inline HTML</a></p>
69
70 <h2>Demonstration of using callbacks</h2>
71 <p><a class='callbacks' href="../content/marylou.jpg" title="Marylou on Cumberland Island">Example with alerts</a>. Callbacks and event-hooks allow users to extend functionality without having to rewrite parts of the plugin.</p>
72
73 <!-- This contains the hidden content for inline calls -->
74 <div style='display:none'>
75 <div id='inline_content' style='padding:10px; background:#fff;'>
76 <p><strong>This content comes from a hidden element on this page.</strong></p>
77 <p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p>
78 <p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p>
79
80 <p><strong>If you try to open a new ColorBox while it is already open, it will update itself with the new content.</strong></p>
81 <p>Updating Content Example:<br />
82 <a class="ajax" href="../content/flash.html">Click here to load new content</a></p>
83 </div>
84 </div>
85 </body>
86 </html>
0 /*
1 ColorBox Core Style:
2 The following CSS is consistent between example themes and should not be altered.
3 */
4 #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
5 #cboxOverlay{position:fixed; width:100%; height:100%;}
6 #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
7 #cboxContent{position:relative;}
8 #cboxLoadedContent{overflow:auto;}
9 #cboxTitle{margin:0;}
10 #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
11 #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
12 .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;}
13 .cboxIframe{width:100%; height:100%; display:block; border:0;}
14 #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box;}
15
16 /*
17 User Style:
18 Change the following styles to modify the appearance of ColorBox. They are
19 ordered & tabbed in a way that represents the nesting of the generated HTML.
20 */
21 #cboxOverlay{background:#fff;}
22 #colorbox{}
23 #cboxTopLeft{width:25px; height:25px; background:url(images/border1.png) no-repeat 0 0;}
24 #cboxTopCenter{height:25px; background:url(images/border1.png) repeat-x 0 -50px;}
25 #cboxTopRight{width:25px; height:25px; background:url(images/border1.png) no-repeat -25px 0;}
26 #cboxBottomLeft{width:25px; height:25px; background:url(images/border1.png) no-repeat 0 -25px;}
27 #cboxBottomCenter{height:25px; background:url(images/border1.png) repeat-x 0 -75px;}
28 #cboxBottomRight{width:25px; height:25px; background:url(images/border1.png) no-repeat -25px -25px;}
29 #cboxMiddleLeft{width:25px; background:url(images/border2.png) repeat-y 0 0;}
30 #cboxMiddleRight{width:25px; background:url(images/border2.png) repeat-y -25px 0;}
31 #cboxContent{background:#fff; overflow:hidden;}
32 .cboxIframe{background:#fff;}
33 #cboxError{padding:50px; border:1px solid #ccc;}
34 #cboxLoadedContent{margin-bottom:20px;}
35 #cboxTitle{position:absolute; bottom:0px; left:0; text-align:center; width:100%; color:#999;}
36 #cboxCurrent{position:absolute; bottom:0px; left:100px; color:#999;}
37 #cboxSlideshow{position:absolute; bottom:0px; right:42px; color:#444;}
38 #cboxPrevious{position:absolute; bottom:0px; left:0; color:#444;}
39 #cboxNext{position:absolute; bottom:0px; left:63px; color:#444;}
40 #cboxLoadingOverlay{background:#fff url(images/loading.gif) no-repeat 5px 5px;}
41 #cboxClose{position:absolute; bottom:0; right:0; display:block; color:#444;}
42
43 /*
44 The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
45 when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
46 See: http://jacklmoore.com/notes/ie-transparency-problems/
47 */
48 .cboxIE #cboxTopLeft,
49 .cboxIE #cboxTopCenter,
50 .cboxIE #cboxTopRight,
51 .cboxIE #cboxBottomLeft,
52 .cboxIE #cboxBottomCenter,
53 .cboxIE #cboxBottomRight,
54 .cboxIE #cboxMiddleLeft,
55 .cboxIE #cboxMiddleRight {
56 filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
57 }
58
59 /*
60 The following provides PNG transparency support for IE6
61 Feel free to remove this and the /ie6/ directory if you have dropped IE6 support.
62 */
63 .cboxIE6 #cboxTopLeft{background:url(images/ie6/borderTopLeft.png);}
64 .cboxIE6 #cboxTopCenter{background:url(images/ie6/borderTopCenter.png);}
65 .cboxIE6 #cboxTopRight{background:url(images/ie6/borderTopRight.png);}
66 .cboxIE6 #cboxBottomLeft{background:url(images/ie6/borderBottomLeft.png);}
67 .cboxIE6 #cboxBottomCenter{background:url(images/ie6/borderBottomCenter.png);}
68 .cboxIE6 #cboxBottomRight{background:url(images/ie6/borderBottomRight.png);}
69 .cboxIE6 #cboxMiddleLeft{background:url(images/ie6/borderMiddleLeft.png);}
70 .cboxIE6 #cboxMiddleRight{background:url(images/ie6/borderMiddleRight.png);}
71
72 .cboxIE6 #cboxTopLeft,
73 .cboxIE6 #cboxTopCenter,
74 .cboxIE6 #cboxTopRight,
75 .cboxIE6 #cboxBottomLeft,
76 .cboxIE6 #cboxBottomCenter,
77 .cboxIE6 #cboxBottomRight,
78 .cboxIE6 #cboxMiddleLeft,
79 .cboxIE6 #cboxMiddleRight {
80 _behavior: expression(this.src = this.src ? this.src : this.currentStyle.backgroundImage.split('"')[1], this.style.background = "none", this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + this.src + ", sizingMethod='scale')");
81 }
0 <!DOCTYPE html>
1 <html>
2 <head>
3 <meta charset='utf-8'/>
4 <title>ColorBox Examples</title>
5 <style>
6 body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;}
7 a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;}
8 h2{font-size:13px; margin:15px 0 0 0;}
9 </style>
10 <link rel="stylesheet" href="colorbox.css" />
11 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
12 <script src="../colorbox/jquery.colorbox.js"></script>
13 <script>
14 $(document).ready(function(){
15 //Examples of how to assign the ColorBox event to elements
16 $(".group1").colorbox({rel:'group1'});
17 $(".group2").colorbox({rel:'group2', transition:"fade"});
18 $(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"});
19 $(".group4").colorbox({rel:'group4', slideshow:true});
20 $(".ajax").colorbox();
21 $(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
22 $(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
23 $(".inline").colorbox({inline:true, width:"50%"});
24 $(".callbacks").colorbox({
25 onOpen:function(){ alert('onOpen: colorbox is about to open'); },
26 onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
27 onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
28 onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
29 onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
30 });
31
32 //Example of preserving a JavaScript event for inline calls.
33 $("#click").click(function(){
34 $('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
35 return false;
36 });
37 });
38 </script>
39 </head>
40 <body>
41 <h1>ColorBox Demonstration</h1>
42
43 <h2>Elastic Transition</h2>
44 <p><a class="group1" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
45 <p><a class="group1" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
46 <p><a class="group1" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
47
48 <h2>Fade Transition</h2>
49 <p><a class="group2" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee">Grouped Photo 1</a></p>
50 <p><a class="group2" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
51 <p><a class="group2" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
52
53 <h2>No Transition + fixed width and height (75% of screen size)</h2>
54 <p><a class="group3" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
55 <p><a class="group3" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
56 <p><a class="group3" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
57
58 <h2>Slideshow</h2>
59 <p><a class="group4" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
60 <p><a class="group4" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
61 <p><a class="group4" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
62
63 <h2>Other Content Types</h2>
64 <p><a class='ajax' href="../content/ajax.html" title="Homer Defined">Outside HTML (Ajax)</a></p>
65 <p><a class='ajax' href="../content/flash.html" title="Royksopp: Remind Me">Flash / Video (Ajax/Embedded)</a></p>
66 <p><a class='youtube' href="http://www.youtube.com/embed/617ANIA5Rqs?rel=0&amp;wmode=transparent" title="The Knife: We Share Our Mother's Health">Flash / Video (Iframe/Direct Link To YouTube)</a></p>
67 <p><a class='iframe' href="http://threadless.com">Outside Webpage (Iframe)</a></p>
68 <p><a class='inline' href="#inline_content">Inline HTML</a></p>
69
70 <h2>Demonstration of using callbacks</h2>
71 <p><a class='callbacks' href="../content/marylou.jpg" title="Marylou on Cumberland Island">Example with alerts</a>. Callbacks and event-hooks allow users to extend functionality without having to rewrite parts of the plugin.</p>
72
73 <!-- This contains the hidden content for inline calls -->
74 <div style='display:none'>
75 <div id='inline_content' style='padding:10px; background:#fff;'>
76 <p><strong>This content comes from a hidden element on this page.</strong></p>
77 <p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p>
78 <p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p>
79
80 <p><strong>If you try to open a new ColorBox while it is already open, it will update itself with the new content.</strong></p>
81 <p>Updating Content Example:<br />
82 <a class="ajax" href="../content/flash.html">Click here to load new content</a></p>
83 </div>
84 </div>
85 </body>
86 </html>
0 /*
1 ColorBox Core Style:
2 The following CSS is consistent between example themes and should not be altered.
3 */
4 #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
5 #cboxOverlay{position:fixed; width:100%; height:100%;}
6 #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
7 #cboxContent{position:relative;}
8 #cboxLoadedContent{overflow:auto;}
9 #cboxTitle{margin:0;}
10 #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
11 #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
12 .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;}
13 .cboxIframe{width:100%; height:100%; display:block; border:0;}
14 #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box;}
15
16 /*
17 User Style:
18 Change the following styles to modify the appearance of ColorBox. They are
19 ordered & tabbed in a way that represents the nesting of the generated HTML.
20 */
21 #cboxOverlay{background:#000;}
22 #colorbox{}
23 #cboxTopLeft{width:14px; height:14px; background:url(images/controls.png) no-repeat 0 0;}
24 #cboxTopCenter{height:14px; background:url(images/border.png) repeat-x top left;}
25 #cboxTopRight{width:14px; height:14px; background:url(images/controls.png) no-repeat -36px 0;}
26 #cboxBottomLeft{width:14px; height:43px; background:url(images/controls.png) no-repeat 0 -32px;}
27 #cboxBottomCenter{height:43px; background:url(images/border.png) repeat-x bottom left;}
28 #cboxBottomRight{width:14px; height:43px; background:url(images/controls.png) no-repeat -36px -32px;}
29 #cboxMiddleLeft{width:14px; background:url(images/controls.png) repeat-y -175px 0;}
30 #cboxMiddleRight{width:14px; background:url(images/controls.png) repeat-y -211px 0;}
31 #cboxContent{background:#fff; overflow:visible;}
32 .cboxIframe{background:#fff;}
33 #cboxError{padding:50px; border:1px solid #ccc;}
34 #cboxLoadedContent{margin-bottom:5px;}
35 #cboxLoadingOverlay{background:url(images/loading_background.png) no-repeat center center;}
36 #cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;}
37 #cboxTitle{position:absolute; bottom:-25px; left:0; text-align:center; width:100%; font-weight:bold; color:#7C7C7C;}
38 #cboxCurrent{position:absolute; bottom:-25px; left:58px; font-weight:bold; color:#7C7C7C;}
39
40 #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{position:absolute; bottom:-29px; background:url(images/controls.png) no-repeat 0px 0px; width:23px; height:23px; text-indent:-9999px;}
41 #cboxPrevious{left:0px; background-position: -51px -25px;}
42 #cboxPrevious:hover{background-position:-51px 0px;}
43 #cboxNext{left:27px; background-position:-75px -25px;}
44 #cboxNext:hover{background-position:-75px 0px;}
45 #cboxClose{right:0; background-position:-100px -25px;}
46 #cboxClose:hover{background-position:-100px 0px;}
47
48 .cboxSlideshow_on #cboxSlideshow{background-position:-125px 0px; right:27px;}
49 .cboxSlideshow_on #cboxSlideshow:hover{background-position:-150px 0px;}
50 .cboxSlideshow_off #cboxSlideshow{background-position:-150px -25px; right:27px;}
51 .cboxSlideshow_off #cboxSlideshow:hover{background-position:-125px 0px;}
Binary diff not shown
0 <!DOCTYPE html>
1 <html>
2 <head>
3 <meta charset='utf-8'/>
4 <title>ColorBox Examples</title>
5 <style>
6 body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;}
7 a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;}
8 h2{font-size:13px; margin:15px 0 0 0;}
9 </style>
10 <link rel="stylesheet" href="colorbox.css" />
11 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
12 <script src="../colorbox/jquery.colorbox.js"></script>
13 <script>
14 $(document).ready(function(){
15 //Examples of how to assign the ColorBox event to elements
16 $(".group1").colorbox({rel:'group1'});
17 $(".group2").colorbox({rel:'group2', transition:"fade"});
18 $(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"});
19 $(".group4").colorbox({rel:'group4', slideshow:true});
20 $(".ajax").colorbox();
21 $(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
22 $(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
23 $(".inline").colorbox({inline:true, width:"50%"});
24 $(".callbacks").colorbox({
25 onOpen:function(){ alert('onOpen: colorbox is about to open'); },
26 onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
27 onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
28 onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
29 onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
30 });
31
32 //Example of preserving a JavaScript event for inline calls.
33 $("#click").click(function(){
34 $('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
35 return false;
36 });
37 });
38 </script>
39 </head>
40 <body>
41 <h1>ColorBox Demonstration</h1>
42
43 <h2>Elastic Transition</h2>
44 <p><a class="group1" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
45 <p><a class="group1" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
46 <p><a class="group1" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
47
48 <h2>Fade Transition</h2>
49 <p><a class="group2" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee">Grouped Photo 1</a></p>
50 <p><a class="group2" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
51 <p><a class="group2" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
52
53 <h2>No Transition + fixed width and height (75% of screen size)</h2>
54 <p><a class="group3" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
55 <p><a class="group3" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
56 <p><a class="group3" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
57
58 <h2>Slideshow</h2>
59 <p><a class="group4" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
60 <p><a class="group4" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
61 <p><a class="group4" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
62
63 <h2>Other Content Types</h2>
64 <p><a class='ajax' href="../content/ajax.html" title="Homer Defined">Outside HTML (Ajax)</a></p>
65 <p><a class='ajax' href="../content/flash.html" title="Royksopp: Remind Me">Flash / Video (Ajax/Embedded)</a></p>
66 <p><a class='youtube' href="http://www.youtube.com/embed/617ANIA5Rqs?rel=0&amp;wmode=transparent" title="The Knife: We Share Our Mother's Health">Flash / Video (Iframe/Direct Link To YouTube)</a></p>
67 <p><a class='iframe' href="http://threadless.com">Outside Webpage (Iframe)</a></p>
68 <p><a class='inline' href="#inline_content">Inline HTML</a></p>
69
70 <h2>Demonstration of using callbacks</h2>
71 <p><a class='callbacks' href="../content/marylou.jpg" title="Marylou on Cumberland Island">Example with alerts</a>. Callbacks and event-hooks allow users to extend functionality without having to rewrite parts of the plugin.</p>
72
73 <!-- This contains the hidden content for inline calls -->
74 <div style='display:none'>
75 <div id='inline_content' style='padding:10px; background:#fff;'>
76 <p><strong>This content comes from a hidden element on this page.</strong></p>
77 <p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p>
78 <p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p>
79
80 <p><strong>If you try to open a new ColorBox while it is already open, it will update itself with the new content.</strong></p>
81 <p>Updating Content Example:<br />
82 <a class="ajax" href="../content/flash.html">Click here to load new content</a></p>
83 </div>
84 </div>
85 </body>
86 </html>