Merge tag 'upstream/1.4.10'
Upstream version 1.4.10
Agustin Henze
11 years ago
0 | ## About ColorBox: | |
0 | ## About Colorbox: | |
1 | 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 | 2 | |
3 | 3 | ## Translations Welcome |
4 | 4 | Send me your language configuration files. See /i18n/jquery.colorbox-de.js as an example. |
5 | 5 | |
6 | 6 | ## Changelog: |
7 | ||
8 | ### Version 1.4.10 - 2013/4/2 | |
9 | ||
10 | * Better 'old IE' feature detection that fixes an error with jQuery 2.0.0pre. | |
11 | ||
12 | ### Version 1.4.9 - 2013/4/2 | |
13 | ||
14 | * Fixes bug introduced in previous version. | |
15 | ||
16 | ### Version 1.4.8 - 2013/4/2 | |
17 | ||
18 | * Dropped IE6 support. | |
19 | * Fixed other issues with $.colorbox.remove. | |
20 | ||
21 | ### Version 1.4.7 - 2013/4/1 | |
22 | ||
23 | * Prevented an error if $.colorbox.remove is called during the transition. | |
7 | 24 | |
8 | 25 | ### Version 1.4.6 - 2013/3/19 |
9 | 26 | |
56 | 73 | |
57 | 74 | ### Version 1.3.30 - 2013/1/25 |
58 | 75 | |
59 | * Delayed border-width calculations until after opening, to avoid a bug in FF when using ColorBox in a hidden iframe. | |
76 | * Delayed border-width calculations until after opening, to avoid a bug in FF when using Colorbox in a hidden iframe. | |
60 | 77 | |
61 | 78 | ### Version 1.3.29 - 2013/1/24 |
62 | 79 | |
84 | 101 | |
85 | 102 | ### Version 1.3.23 - 2013/1/18 |
86 | 103 | |
87 | * Minor bugfix for calling ColorBox on empty jQuery collections without a selector. | |
104 | * Minor bugfix for calling Colorbox on empty jQuery collections without a selector. | |
88 | 105 | |
89 | 106 | ### Version 1.3.22 - 2013/1/17 |
90 | 107 | |
112 | 129 | ### Version 1.3.18 - October 07 2011 |
113 | 130 | Files Changed:jquery.colorbox.js/jquery.colorbox-min.js, colorbox.css (all) and example 1's controls.png |
114 | 131 | |
115 | * Fixed a regression where Flash content displayed in ColorBox would be reloaded if the browser window was resized. | |
116 | * 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. | |
132 | * Fixed a regression where Flash content displayed in Colorbox would be reloaded if the browser window was resized. | |
133 | * 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. | |
117 | 134 | * Updated the example index.html files to be HTML5 compliant. |
118 | 135 | * Changed the slideshow behavior so that it immediately moves to the next slide when the slideshow is started. |
119 | 136 | * Minor regex bugfix to allow automatic detection of image URLs that include fragments. |
122 | 139 | Files Changed:jquery.colorbox.js/jquery.colorbox-min.js |
123 | 140 | |
124 | 141 | * Added properties "top", "bottom", "left" and "right" to specify a position relative to the viewport, rather than using the default centering. |
125 | * 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(). | |
126 | * 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. | |
142 | * 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(). | |
143 | * 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. | |
127 | 144 | * Fixed ClearType problem with IE7. |
128 | 145 | * Minor fixes. |
129 | 146 | |
149 | 166 | Files Changed: jquery.colorbox.js/jquery.colorbox-min.js |
150 | 167 | |
151 | 168 | * Changed the index.html example files to use YouTube's new embedded link format. |
152 | * 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. | |
169 | * 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. | |
153 | 170 | * Minor bug fix involved in using a combination of slideshow and non-slideshow content. |
154 | 171 | |
155 | 172 | ### Version 1.3.12 - October 20 2010 |
169 | 186 | * Fixed compatibility with jQuery 1.4.3 |
170 | 187 | * The 'open' property now accepts a function as a value, like all of the other properties. |
171 | 188 | * Preloading now loads the correct href for images when using a dynamic (function) value for the href property. |
172 | * Fixed bug in Safari 3 for Win where ColorBox centered on the document, rather than the visitor's viewport. | |
173 | * May have fixed an issue in Opera 10.6+ where ColorBox would rarely/randomly freeze up while switching between photos in a group. | |
189 | * Fixed bug in Safari 3 for Win where Colorbox centered on the document, rather than the visitor's viewport. | |
190 | * May have fixed an issue in Opera 10.6+ where Colorbox would rarely/randomly freeze up while switching between photos in a group. | |
174 | 191 | * Some functionality better encapsulated & minor performance improvements. |
175 | 192 | |
176 | 193 | ### Version 1.3.9 - July 7 2010 |
185 | 202 | |
186 | 203 | * 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). |
187 | 204 | * Fixed a bug where the onClosed callback would fire twice (only affected 1.3.7). |
188 | * 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. | |
205 | * 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. | |
189 | 206 | * Abstracted the identifiers (HTML ids & classes, and JS plugin name, method, and events) so that the plugin can be easily rebranded. |
190 | 207 | * Small changes to improve either code readability or compression. |
191 | 208 | |
196 | 213 | * Resize now accepts 'width', 'innerWidth', 'height' and 'innerHeight'. Example: $.colorbox.resize({width:"100%"}) |
197 | 214 | * Added option (loop:false) to disable looping in a group. |
198 | 215 | * Added options (escKey:false, arrowKey:false) to disable esc-key and arrow-key bindings. |
199 | * Added method for removing ColorBox from a document: $.colorbox.remove(); | |
216 | * Added method for removing Colorbox from a document: $.colorbox.remove(); | |
200 | 217 | * Fixed a bug where iframed URLs would be truncated if they contained an unencoded apostrophe. |
201 | 218 | * 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. |
202 | 219 | * Changed example documents over to HTML5. |
204 | 221 | ### Version 1.3.6 - Jan 13 2010 |
205 | 222 | Files Changed: jquery.colorbox.js/jquery.colorbox-min.js |
206 | 223 | |
207 | * Small change to make ColorBox compatible with jQuery 1.4 | |
224 | * Small change to make Colorbox compatible with jQuery 1.4 | |
208 | 225 | |
209 | 226 | ### Version 1.3.5 - December 15 2009 |
210 | 227 | Files Changed: jquery.colorbox.js/jquery.colorbox-min.js |
216 | 233 | ### Version 1.3.4 - December 5 2009 |
217 | 234 | Files Changed: jquery.colorbox.js/jquery.colorbox-min.js |
218 | 235 | |
219 | * Event delegation is now used for elements that ColorBox is assigned to, rather than individual click events. | |
220 | * 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. | |
236 | * Event delegation is now used for elements that Colorbox is assigned to, rather than individual click events. | |
237 | * 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. | |
221 | 238 | * Ajax content is now immediately added to the DOM to be more compatible if that content contains script tags. |
222 | 239 | * Focus is now returned to the calling element on closing. |
223 | 240 | * Fixed a bug where maxHeight and maxWidth did not work for non-photo content. |
224 | * Direct calls no longer need 'open:true', it is assumed. Example: `$.fn.colorbox({html:'<p>Hi</p>'});` | |
241 | * Direct calls no longer need 'open:true', it is assumed. Example: `$.colorbox({html:'<p>Hi</p>'});` | |
225 | 242 | |
226 | 243 | ### Version 1.3.3 - November 7 2009 |
227 | 244 | Files Changed: jquery.colorbox.js/jquery.colorbox-min.js |
228 | 245 | |
229 | * Changed $.fn.colorbox.element() to return a jQuery object rather the DOM element. | |
246 | * Changed $.colorbox.element() to return a jQuery object rather the DOM element. | |
230 | 247 | * jQuery.colorbox-min.js is compressed with Google's Closure Compiler rather than YUI Compressor. |
231 | 248 | |
232 | 249 | ### Version 1.3.2 - October 27 2009 |
233 | 250 | Files Changed: jquery.colorbox.js/jquery.colorbox-min.js |
234 | 251 | |
235 | * 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. | |
252 | * 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. | |
236 | 253 | * Renamed 'scrollbars' option to 'scrolling' to be in keeping with the existing HTML attribute. The option now also applies to iframes. |
237 | 254 | * Bug fix: In Safari, positioning occassionally incorrect when using '100%' dimensions. |
238 | 255 | * Bug fix: In IE6, the background overlay is briefly not full size when first viewing. |
239 | * Bug fix: In Firefox, opening ColorBox causes a split second shift with a small minority of webpage layouts. | |
256 | * Bug fix: In Firefox, opening Colorbox causes a split second shift with a small minority of webpage layouts. | |
240 | 257 | * Simplified code in a few areas. |
241 | 258 | |
242 | 259 | ### Version 1.3.1 - September 16 2009 |
248 | 265 | ### Version 1.3.0 - September 15 2009 |
249 | 266 | Files Changed: jquery.colorbox.js/jquery.colorbox-min.js/colorbox.css |
250 | 267 | |
251 | * Added $.fn.colorbox.resize() method to allow ColorBox to resize it's height if it's contents change. | |
268 | * Added $.colorbox.resize() method to allow Colorbox to resize it's height if it's contents change. | |
252 | 269 | * Added 'scrollbars' option to allow users to turn off scrollbars when using the resize() method. |
253 | 270 | * Renamed the 'resize' option to be less ambiguous. It's now 'scalePhotos'. |
254 | 271 | * 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. |
255 | * Fixed a bug with the slideshow mouseover graphics that appeared after ColorBox is opened a 2nd time. | |
272 | * Fixed a bug with the slideshow mouseover graphics that appeared after Colorbox is opened a 2nd time. | |
256 | 273 | * Fixed a bug where ClearType may not work in IE6&7 if using the fade transition. |
257 | 274 | * Minor code optimizations to increase compression. |
258 | 275 | |
273 | 290 | 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) |
274 | 291 | |
275 | 292 | * Code cleanup and reduction, better organization and documentation in the full source. |
276 | * Added ability to use functions in place of static values for ColorBox's options (thanks Ken!). | |
277 | * Added an option for straight HTML. Example: `$.fn.colorbox({html:'<p>Howdy</p>', open:true})` | |
278 | * 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. | |
279 | * Fixed a minor bug in IE6 that would cause a brief content shift in the parent document when opening ColorBox. | |
280 | * Fixed a minor bug in IE6 that would reveal select elements that had a hidden visibility after closing ColorBox. | |
281 | * The 'esc' key is unbound now when ColorBox is not open, to avoid any potential conflicts. | |
293 | * Added ability to use functions in place of static values for Colorbox's options (thanks Ken!). | |
294 | * Added an option for straight HTML. Example: `$.colorbox({html:'<p>Howdy</p>', open:true})` | |
295 | * 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. | |
296 | * Fixed a minor bug in IE6 that would cause a brief content shift in the parent document when opening Colorbox. | |
297 | * Fixed a minor bug in IE6 that would reveal select elements that had a hidden visibility after closing Colorbox. | |
298 | * The 'esc' key is unbound now when Colorbox is not open, to avoid any potential conflicts. | |
282 | 299 | * Used background sprites for examples 1 & 4. Put IE-only (non-sprite) background images in a separate folder. |
283 | 300 | * Example themes 1, 3, & 4 received slight visual tweaks. |
284 | 301 | * Optimized pngs for smaller file size. |
288 | 305 | Files Changed: jquery.colorbox.js/jquery.colorbox-min.js |
289 | 306 | |
290 | 307 | * Fixed a bug with fixed width/height images in Opera 9.64. |
291 | * Fixed a bug with trying to set a value for rel during a direct call to ColorBox. Example: `$.fn.colorbox({rel:'foo', open:true});` | |
292 | * 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. | |
308 | * Fixed a bug with trying to set a value for rel during a direct call to Colorbox. Example: `$.colorbox({rel:'foo', open:true});` | |
309 | * 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. | |
293 | 310 | * Fixed a FF3 bug where the back button was disabled after closing an iframe. |
294 | 311 | |
295 | 312 | ### Version 1.2.5 - June 23 2009 |
301 | 318 | ### Version 1.2.4 - June 9 2009 |
302 | 319 | Files Changed: jquery.colorbox.js, jquery.colorbox-min.js |
303 | 320 | |
304 | * Fixed an issue where ColorBox may not close completely if it is closed during a transition animation. | |
321 | * Fixed an issue where Colorbox may not close completely if it is closed during a transition animation. | |
305 | 322 | * Minor code reduction. |
306 | 323 | |
307 | 324 | ### Version 1.2.3 - June 4 2009 |
308 | 325 | * Fixed a png transparency stacking issue in IE. |
309 | 326 | * More accurate Ajax auto-sizing if the user was depending on the #cboxLoadedContent ID for CSS styling. |
310 | * Added a public function for returning the current html element that ColorBox is associated with. Example use: var that = $.fn.colorbox.element(); | |
327 | * Added a public function for returning the current html element that Colorbox is associated with. Example use: var that = $.colorbox.element(); | |
311 | 328 | * Added bicubic scaling for resized images in the original IE7. |
312 | 329 | * 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. |
313 | 330 | |
317 | 334 | ### Version 1.2.1 - May 28 2009 |
318 | 335 | * Note: If you are upgrading, update your jquery.colorbox.js and colorbox.css files. |
319 | 336 | * Added photo resizing. |
320 | * 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. | |
321 | * 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. | |
322 | * 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') | |
323 | * 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: | |
324 | `$.fn.colorbox({open:true, href:'yourLink.xxx'});` | |
325 | * 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. | |
337 | * 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. | |
338 | * 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. | |
339 | * 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') | |
340 | * 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: | |
341 | `$.colorbox({open:true, href:'yourLink.xxx'});` | |
342 | * 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. | |
326 | 343 | * For user callbacks, 'this' now refers to the element colorbox was opened from. |
327 | 344 | * Fixed a minor grouping issue with IE6, when transition type is set to 'none'. |
328 | 345 | * Added an Adobe Illustrator file that contains the borders and buttons used in the various examples. |
329 | 346 | |
330 | 347 | ### Version 1.2 - May 13 2009 |
331 | 348 | * Added a slideshow feature. |
332 | * Added re-positioning on browser resize. If the browser is resized, ColorBox will recenter itself onscreen. | |
349 | * Added re-positioning on browser resize. If the browser is resized, Colorbox will recenter itself onscreen. | |
333 | 350 | * Added hooks for key events: cbox_open, cbox_load, cbox_complete, cbox_closed. |
334 | 351 | * Fixed an IE transparency-stacking problem, where transparent PNGs would show through to the background overlay. |
335 | 352 | * Fixed an IE iframe issue where the ifame might shift up and to the left under certain circumstances. |
339 | 356 | * Changed how the JS is structured to be better organized and increase compression. Increased documentation. |
340 | 357 | * 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. |
341 | 358 | * 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. |
342 | * 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. | |
359 | * 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. | |
343 | 360 | * Changed the naming of variables in the parameter map to be more concise and intuitive. |
344 | 361 | * 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. |
345 | 362 | |
346 | 363 | ### Version 1.1.6 - April 28 2009 |
347 | 364 | * Prevented the default action of the next & previous anchors and the left and right keys for gallery mode. |
348 | * Fixed a bug where the title element was being added back to the DOM when closing ColorBox while using inline content. | |
365 | * Fixed a bug where the title element was being added back to the DOM when closing Colorbox while using inline content. | |
349 | 366 | * Fixed a bug where IE7 would crash for example 2. |
350 | 367 | * Smaller filesize: removed a small amount of unused code and rewrote the HTML injection with less syntax. |
351 | * 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. | |
368 | * Added a public method for closing Colorbox: $.colorbox.close(). This will allow iframe users to add an event to close Colorbox without having to create an additional function. | |
352 | 369 | |
353 | 370 | ### Version 1.1.5 - April 11 2009 |
354 | * Fixed minor issues with exiting ColorBox. | |
371 | * Fixed minor issues with exiting Colorbox. | |
355 | 372 | |
356 | 373 | ### Version 1.1.4 - April 08 2009 |
357 | * Fixed a bug in the fade transition where ColorBox not close completely if instructed to close during the fade-in portion of the transition. | |
374 | * Fixed a bug in the fade transition where Colorbox not close completely if instructed to close during the fade-in portion of the transition. | |
358 | 375 | |
359 | 376 | ### Version 1.1.3 - April 06 2009 |
360 | * Fixed an IE6&7 issue with using ColorBox to display animated GIFs. | |
377 | * Fixed an IE6&7 issue with using Colorbox to display animated GIFs. | |
361 | 378 | |
362 | 379 | ### Version 1.1.2 - April 05 2009 |
363 | * Added ability to change content when ColorBox is already open. | |
380 | * Added ability to change content when Colorbox is already open. | |
364 | 381 | * Added vertical photo centering now works for all browsers (this feature previously excluded IE6&7). |
365 | 382 | * Added namespacing to the esc-key keydown event for people who want to disable it: "keydown.colorClose" |
366 | * Added 'title' setting to add the ability to set an alternative title for any ColorBox call. | |
383 | * Added 'title' setting to add the ability to set an alternative title for any Colorbox call. | |
367 | 384 | * Fixed rollover navigation issue with IE8. (Added JS-based rollover state due to a browser-bug.) |
368 | 385 | * Fixed an overflow issue for when the fixed width/height is smaller than the size of a photo. |
369 | * Fixed a bug in the fade transition where the border would still come up if ColorBox was closed mid-transition. | |
386 | * Fixed a bug in the fade transition where the border would still come up if Colorbox was closed mid-transition. | |
370 | 387 | * Switch from JSMin to Yui Compressor for minification. Minified code now under 7KB. |
371 | 388 | |
372 | 389 | ### Version 1.1.1 - March 31 2009 |
373 | 390 | * More robust image detection regex. Now detects image file types with url fragments and/or query strings. |
374 | 391 | * Added 'nofollow' exception to rel grouping. |
375 | * Changed how images are loaded into the DOM to prevent premature size calculation by ColorBox. | |
392 | * Changed how images are loaded into the DOM to prevent premature size calculation by Colorbox. | |
376 | 393 | * 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. |
377 | 394 | |
378 | 395 | ### Version 1.1.0 - March 21 2009 |
379 | 396 | * Animation is now much smoother and less resource intensive. |
380 | 397 | * Added support for % sizing. |
381 | 398 | * Callback option added. |
382 | * Inline content now preserves JavaScript events, and changes made while ColorBox is open are also preserved. | |
383 | * Added 'href' setting to add the ability to set an alternative href for any anchor, or to assign the ColorBox event to non-anchors. | |
399 | * Inline content now preserves JavaScript events, and changes made while Colorbox is open are also preserved. | |
400 | * Added 'href' setting to add the ability to set an alternative href for any anchor, or to assign the Colorbox event to non-anchors. | |
384 | 401 | Example: $('button').colorbox({'href':'process.php'}) |
385 | 402 | Example: $('a[href='http://msn.com']).colorbox({'href':'http://google.com', iframe:true}); |
386 | 403 | * Photos are now horizontally centered if they are smaller than the lightbox size. Also vertically centered for browsers newer than IE7. |
387 | 404 | * 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. |
388 | 405 | * Keypress events don't queue up by holding down the arrow keys. |
389 | * Added option to close ColorBox by clicking on the background overlay. | |
406 | * Added option to close Colorbox by clicking on the background overlay. | |
390 | 407 | * Added 'none' transition setting. |
391 | 408 | * Changed 'contentIframe' and 'contentInline' to 'inline' and 'iframe'. Removed 'contentAjax' because it is automatically assumed for non-image file types. |
392 | 409 | * 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. |
0 | 0 | { |
1 | 1 | "name": "colorbox", |
2 | "title": "ColorBox", | |
2 | "title": "Colorbox", | |
3 | 3 | "description": "A lightweight customizable lightbox plugin", |
4 | 4 | "keywords": [ |
5 | 5 | "modal", |
8 | 8 | "popup", |
9 | 9 | "ui" |
10 | 10 | ], |
11 | "version": "1.4.6", | |
11 | "version": "1.4.10", | |
12 | 12 | "author": { |
13 | 13 | "name": "Jack Moore", |
14 | 14 | "url": "http://www.jacklmoore.com", |
0 | 0 | { |
1 | 1 | "name": "jquery-colorbox", |
2 | "version": "1.4.6", | |
2 | "version": "1.4.10", | |
3 | 3 | "main": "./jquery.colorbox-min.js", |
4 | 4 | "dependencies": { |
5 | 5 | "jquery": ">=1.3.2" |
0 | 0 | /* |
1 | ColorBox Core Style: | |
1 | Colorbox Core Style: | |
2 | 2 | The following CSS is consistent between example themes and should not be altered. |
3 | 3 | */ |
4 | 4 | #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} |
9 | 9 | #cboxTitle{margin:0;} |
10 | 10 | #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;} |
11 | 11 | #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} |
12 | .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;} | |
12 | .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;} | |
13 | 13 | .cboxIframe{width:100%; height:100%; display:block; border:0;} |
14 | 14 | #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} |
15 | 15 | |
16 | 16 | /* |
17 | 17 | User Style: |
18 | Change the following styles to modify the appearance of ColorBox. They are | |
18 | Change the following styles to modify the appearance of Colorbox. They are | |
19 | 19 | ordered & tabbed in a way that represents the nesting of the generated HTML. |
20 | 20 | */ |
21 | 21 | #cboxOverlay{background:url(images/overlay.png) repeat 0 0;} |
65 | 65 | .cboxIE #cboxMiddleLeft, |
66 | 66 | .cboxIE #cboxMiddleRight { |
67 | 67 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF); |
68 | } | |
69 | ||
70 | /* | |
71 | The following provides PNG transparency support for IE6 | |
72 | Feel free to remove this and the /ie6/ directory if you have dropped IE6 support. | |
73 | */ | |
74 | .cboxIE6 #cboxTopLeft{background:url(images/ie6/borderTopLeft.png);} | |
75 | .cboxIE6 #cboxTopCenter{background:url(images/ie6/borderTopCenter.png);} | |
76 | .cboxIE6 #cboxTopRight{background:url(images/ie6/borderTopRight.png);} | |
77 | .cboxIE6 #cboxBottomLeft{background:url(images/ie6/borderBottomLeft.png);} | |
78 | .cboxIE6 #cboxBottomCenter{background:url(images/ie6/borderBottomCenter.png);} | |
79 | .cboxIE6 #cboxBottomRight{background:url(images/ie6/borderBottomRight.png);} | |
80 | .cboxIE6 #cboxMiddleLeft{background:url(images/ie6/borderMiddleLeft.png);} | |
81 | .cboxIE6 #cboxMiddleRight{background:url(images/ie6/borderMiddleRight.png);} | |
82 | ||
83 | .cboxIE6 #cboxTopLeft, | |
84 | .cboxIE6 #cboxTopCenter, | |
85 | .cboxIE6 #cboxTopRight, | |
86 | .cboxIE6 #cboxBottomLeft, | |
87 | .cboxIE6 #cboxBottomCenter, | |
88 | .cboxIE6 #cboxBottomRight, | |
89 | .cboxIE6 #cboxMiddleLeft, | |
90 | .cboxIE6 #cboxMiddleRight { | |
91 | _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')"); | |
92 | } | |
68 | }⏎ |
1 | 1 | <html> |
2 | 2 | <head> |
3 | 3 | <meta charset='utf-8'/> |
4 | <title>ColorBox Examples</title> | |
4 | <title>Colorbox Examples</title> | |
5 | 5 | <style> |
6 | 6 | body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;} |
7 | 7 | a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;} |
8 | 8 | h2{font-size:13px; margin:15px 0 0 0;} |
9 | 9 | </style> |
10 | 10 | <link rel="stylesheet" href="colorbox.css" /> |
11 | <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> | |
11 | <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
12 | 12 | <script src="../jquery.colorbox.js"></script> |
13 | 13 | <script> |
14 | 14 | $(document).ready(function(){ |
15 | //Examples of how to assign the ColorBox event to elements | |
15 | //Examples of how to assign the Colorbox event to elements | |
16 | 16 | $(".group1").colorbox({rel:'group1'}); |
17 | 17 | $(".group2").colorbox({rel:'group2', transition:"fade"}); |
18 | 18 | $(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"}); |
42 | 42 | </script> |
43 | 43 | </head> |
44 | 44 | <body> |
45 | <h1>ColorBox Demonstration</h1> | |
45 | <h1>Colorbox Demonstration</h1> | |
46 | 46 | <h2>Elastic Transition</h2> |
47 | 47 | <p><a class="group1" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p> |
48 | 48 | <p><a class="group1" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p> |
85 | 85 | <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> |
86 | 86 | <p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p> |
87 | 87 | |
88 | <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> | |
88 | <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> | |
89 | 89 | <p>Updating Content Example:<br /> |
90 | 90 | <a class="ajax" href="../content/ajax.html">Click here to load new content</a></p> |
91 | 91 | </div> |
0 | 0 | /* |
1 | ColorBox Core Style: | |
1 | Colorbox Core Style: | |
2 | 2 | The following CSS is consistent between example themes and should not be altered. |
3 | 3 | */ |
4 | 4 | #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} |
9 | 9 | #cboxTitle{margin:0;} |
10 | 10 | #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;} |
11 | 11 | #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} |
12 | .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;} | |
12 | .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;} | |
13 | 13 | .cboxIframe{width:100%; height:100%; display:block; border:0;} |
14 | 14 | #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} |
15 | 15 | |
16 | 16 | /* |
17 | 17 | User Style: |
18 | Change the following styles to modify the appearance of ColorBox. They are | |
18 | Change the following styles to modify the appearance of Colorbox. They are | |
19 | 19 | ordered & tabbed in a way that represents the nesting of the generated HTML. |
20 | 20 | */ |
21 | 21 | #cboxOverlay{background:#fff;} |
1 | 1 | <html> |
2 | 2 | <head> |
3 | 3 | <meta charset='utf-8'/> |
4 | <title>ColorBox Examples</title> | |
4 | <title>Colorbox Examples</title> | |
5 | 5 | <style> |
6 | 6 | body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;} |
7 | 7 | a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;} |
12 | 12 | <script src="../jquery.colorbox.js"></script> |
13 | 13 | <script> |
14 | 14 | $(document).ready(function(){ |
15 | //Examples of how to assign the ColorBox event to elements | |
15 | //Examples of how to assign the Colorbox event to elements | |
16 | 16 | $(".group1").colorbox({rel:'group1'}); |
17 | 17 | $(".group2").colorbox({rel:'group2', transition:"fade"}); |
18 | 18 | $(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"}); |
42 | 42 | </script> |
43 | 43 | </head> |
44 | 44 | <body> |
45 | <h1>ColorBox Demonstration</h1> | |
45 | <h1>Colorbox Demonstration</h1> | |
46 | 46 | <h2>Elastic Transition</h2> |
47 | 47 | <p><a class="group1" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p> |
48 | 48 | <p><a class="group1" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p> |
85 | 85 | <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> |
86 | 86 | <p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p> |
87 | 87 | |
88 | <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> | |
88 | <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> | |
89 | 89 | <p>Updating Content Example:<br /> |
90 | 90 | <a class="ajax" href="../content/ajax.html">Click here to load new content</a></p> |
91 | 91 | </div> |
0 | 0 | /* |
1 | ColorBox Core Style: | |
1 | Colorbox Core Style: | |
2 | 2 | The following CSS is consistent between example themes and should not be altered. |
3 | 3 | */ |
4 | 4 | #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} |
9 | 9 | #cboxTitle{margin:0;} |
10 | 10 | #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;} |
11 | 11 | #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} |
12 | .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;} | |
12 | .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;} | |
13 | 13 | .cboxIframe{width:100%; height:100%; display:block; border:0;} |
14 | 14 | #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} |
15 | 15 | |
16 | 16 | /* |
17 | 17 | User Style: |
18 | Change the following styles to modify the appearance of ColorBox. They are | |
18 | Change the following styles to modify the appearance of Colorbox. They are | |
19 | 19 | ordered & tabbed in a way that represents the nesting of the generated HTML. |
20 | 20 | */ |
21 | 21 | #cboxOverlay{background:#000;} |
1 | 1 | <html> |
2 | 2 | <head> |
3 | 3 | <meta charset='utf-8'/> |
4 | <title>ColorBox Examples</title> | |
4 | <title>Colorbox Examples</title> | |
5 | 5 | <style> |
6 | 6 | body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;} |
7 | 7 | a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;} |
12 | 12 | <script src="../jquery.colorbox.js"></script> |
13 | 13 | <script> |
14 | 14 | $(document).ready(function(){ |
15 | //Examples of how to assign the ColorBox event to elements | |
15 | //Examples of how to assign the Colorbox event to elements | |
16 | 16 | $(".group1").colorbox({rel:'group1'}); |
17 | 17 | $(".group2").colorbox({rel:'group2', transition:"fade"}); |
18 | 18 | $(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"}); |
42 | 42 | </script> |
43 | 43 | </head> |
44 | 44 | <body> |
45 | <h1>ColorBox Demonstration</h1> | |
45 | <h1>Colorbox Demonstration</h1> | |
46 | 46 | <h2>Elastic Transition</h2> |
47 | 47 | <p><a class="group1" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p> |
48 | 48 | <p><a class="group1" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p> |
85 | 85 | <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> |
86 | 86 | <p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p> |
87 | 87 | |
88 | <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> | |
88 | <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> | |
89 | 89 | <p>Updating Content Example:<br /> |
90 | 90 | <a class="ajax" href="../content/ajax.html">Click here to load new content</a></p> |
91 | 91 | </div> |
0 | 0 | /* |
1 | ColorBox Core Style: | |
1 | Colorbox Core Style: | |
2 | 2 | The following CSS is consistent between example themes and should not be altered. |
3 | 3 | */ |
4 | 4 | #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} |
9 | 9 | #cboxTitle{margin:0;} |
10 | 10 | #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;} |
11 | 11 | #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} |
12 | .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;} | |
12 | .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;} | |
13 | 13 | .cboxIframe{width:100%; height:100%; display:block; border:0;} |
14 | 14 | #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} |
15 | 15 | |
16 | 16 | /* |
17 | 17 | User Style: |
18 | Change the following styles to modify the appearance of ColorBox. They are | |
18 | Change the following styles to modify the appearance of Colorbox. They are | |
19 | 19 | ordered & tabbed in a way that represents the nesting of the generated HTML. |
20 | 20 | */ |
21 | 21 | #cboxOverlay{background:#fff;} |
61 | 61 | .cboxIE #cboxMiddleLeft, |
62 | 62 | .cboxIE #cboxMiddleRight { |
63 | 63 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF); |
64 | } | |
65 | ||
66 | /* | |
67 | The following provides PNG transparency support for IE6 | |
68 | Feel free to remove this and the /ie6/ directory if you have dropped IE6 support. | |
69 | */ | |
70 | .cboxIE6 #cboxTopLeft{background:url(images/ie6/borderTopLeft.png);} | |
71 | .cboxIE6 #cboxTopCenter{background:url(images/ie6/borderTopCenter.png);} | |
72 | .cboxIE6 #cboxTopRight{background:url(images/ie6/borderTopRight.png);} | |
73 | .cboxIE6 #cboxBottomLeft{background:url(images/ie6/borderBottomLeft.png);} | |
74 | .cboxIE6 #cboxBottomCenter{background:url(images/ie6/borderBottomCenter.png);} | |
75 | .cboxIE6 #cboxBottomRight{background:url(images/ie6/borderBottomRight.png);} | |
76 | .cboxIE6 #cboxMiddleLeft{background:url(images/ie6/borderMiddleLeft.png);} | |
77 | .cboxIE6 #cboxMiddleRight{background:url(images/ie6/borderMiddleRight.png);} | |
78 | ||
79 | .cboxIE6 #cboxTopLeft, | |
80 | .cboxIE6 #cboxTopCenter, | |
81 | .cboxIE6 #cboxTopRight, | |
82 | .cboxIE6 #cboxBottomLeft, | |
83 | .cboxIE6 #cboxBottomCenter, | |
84 | .cboxIE6 #cboxBottomRight, | |
85 | .cboxIE6 #cboxMiddleLeft, | |
86 | .cboxIE6 #cboxMiddleRight { | |
87 | _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')"); | |
88 | } | |
64 | }⏎ |
1 | 1 | <html> |
2 | 2 | <head> |
3 | 3 | <meta charset='utf-8'/> |
4 | <title>ColorBox Examples</title> | |
4 | <title>Colorbox Examples</title> | |
5 | 5 | <style> |
6 | 6 | body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;} |
7 | 7 | a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;} |
12 | 12 | <script src="../jquery.colorbox.js"></script> |
13 | 13 | <script> |
14 | 14 | $(document).ready(function(){ |
15 | //Examples of how to assign the ColorBox event to elements | |
15 | //Examples of how to assign the Colorbox event to elements | |
16 | 16 | $(".group1").colorbox({rel:'group1'}); |
17 | 17 | $(".group2").colorbox({rel:'group2', transition:"fade"}); |
18 | 18 | $(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"}); |
42 | 42 | </script> |
43 | 43 | </head> |
44 | 44 | <body> |
45 | <h1>ColorBox Demonstration</h1> | |
45 | <h1>Colorbox Demonstration</h1> | |
46 | 46 | <h2>Elastic Transition</h2> |
47 | 47 | <p><a class="group1" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p> |
48 | 48 | <p><a class="group1" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p> |
85 | 85 | <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> |
86 | 86 | <p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p> |
87 | 87 | |
88 | <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> | |
88 | <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> | |
89 | 89 | <p>Updating Content Example:<br /> |
90 | 90 | <a class="ajax" href="../content/ajax.html">Click here to load new content</a></p> |
91 | 91 | </div> |
0 | 0 | /* |
1 | ColorBox Core Style: | |
1 | Colorbox Core Style: | |
2 | 2 | The following CSS is consistent between example themes and should not be altered. |
3 | 3 | */ |
4 | 4 | #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} |
9 | 9 | #cboxTitle{margin:0;} |
10 | 10 | #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;} |
11 | 11 | #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} |
12 | .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;} | |
12 | .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;} | |
13 | 13 | .cboxIframe{width:100%; height:100%; display:block; border:0;} |
14 | 14 | #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} |
15 | 15 | |
16 | 16 | /* |
17 | 17 | User Style: |
18 | Change the following styles to modify the appearance of ColorBox. They are | |
18 | Change the following styles to modify the appearance of Colorbox. They are | |
19 | 19 | ordered & tabbed in a way that represents the nesting of the generated HTML. |
20 | 20 | */ |
21 | 21 | #cboxOverlay{background:#000;} |
1 | 1 | <html> |
2 | 2 | <head> |
3 | 3 | <meta charset='utf-8'/> |
4 | <title>ColorBox Examples</title> | |
4 | <title>Colorbox Examples</title> | |
5 | 5 | <style> |
6 | 6 | body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;} |
7 | 7 | a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;} |
12 | 12 | <script src="../jquery.colorbox.js"></script> |
13 | 13 | <script> |
14 | 14 | $(document).ready(function(){ |
15 | //Examples of how to assign the ColorBox event to elements | |
15 | //Examples of how to assign the Colorbox event to elements | |
16 | 16 | $(".group1").colorbox({rel:'group1'}); |
17 | 17 | $(".group2").colorbox({rel:'group2', transition:"fade"}); |
18 | 18 | $(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"}); |
42 | 42 | </script> |
43 | 43 | </head> |
44 | 44 | <body> |
45 | <h1>ColorBox Demonstration</h1> | |
45 | <h1>Colorbox Demonstration</h1> | |
46 | 46 | <h2>Elastic Transition</h2> |
47 | 47 | <p><a class="group1" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p> |
48 | 48 | <p><a class="group1" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p> |
85 | 85 | <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> |
86 | 86 | <p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p> |
87 | 87 | |
88 | <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> | |
88 | <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> | |
89 | 89 | <p>Updating Content Example:<br /> |
90 | 90 | <a class="ajax" href="../content/ajax.html">Click here to load new content</a></p> |
91 | 91 | </div> |
0 | 0 | /* |
1 | jQuery ColorBox language configuration | |
1 | jQuery Colorbox language configuration | |
2 | 2 | language: Arabic (ar) |
3 | 3 | translated by: A.Rhman Sayes |
4 | 4 | */ |
0 | 0 | /* |
1 | jQuery ColorBox language configuration | |
1 | jQuery Colorbox language configuration | |
2 | 2 | language: Czech (cs) |
3 | 3 | translated by: Filip Novak |
4 | 4 | site: mame.napilno.cz/filip-novak |
0 | 0 | /* |
1 | jQuery ColorBox language configuration | |
1 | jQuery Colorbox language configuration | |
2 | 2 | language: Danish (da) |
3 | 3 | translated by: danieljuhl |
4 | 4 | site: danieljuhl.dk |
0 | 0 | /* |
1 | jQuery ColorBox language configuration | |
1 | jQuery Colorbox language configuration | |
2 | 2 | language: German (de) |
3 | 3 | translated by: wallenium |
4 | 4 | */ |
0 | 0 | /* |
1 | jQuery ColorBox language configuration | |
1 | jQuery Colorbox language configuration | |
2 | 2 | language: Spanish (es) |
3 | 3 | translated by: migolo |
4 | 4 | */ |
0 | 0 | /* |
1 | jQuery ColorBox language configuration | |
1 | jQuery Colorbox language configuration | |
2 | 2 | language: Persian (Farsi) |
3 | 3 | translated by: Mahdi Jaberzadeh Ansari (MJZSoft) |
4 | 4 | site: www.mjzsoft.ir |
0 | 0 | /* |
1 | jQuery ColorBox language configuration | |
1 | jQuery Colorbox language configuration | |
2 | 2 | language: French (fr) |
3 | 3 | translated by: oaubert |
4 | 4 | */ |
0 | 0 | /* |
1 | jQuery ColorBox language configuration | |
1 | jQuery Colorbox language configuration | |
2 | 2 | language: Croatian (hr) |
3 | 3 | translated by: Mladen Bicanic (base.hr) |
4 | 4 | */ |
0 | /* | |
1 | jQuery Colorbox language configuration | |
2 | language: Hungarian (hu) | |
3 | translated by: kovadani | |
4 | */ | |
5 | jQuery.extend(jQuery.colorbox.settings, { | |
6 | current: "{current}/{total} kép", | |
7 | previous: "Előző", | |
8 | next: "Következő", | |
9 | close: "Bezár", | |
10 | xhrError: "A tartalmat nem sikerült betölteni.", | |
11 | imgError: "A képet nem sikerült betölteni.", | |
12 | slideshowStart: "Diavetítés indítása", | |
13 | slideshowStop: "Diavetítés leállítása" | |
14 | });⏎ |
0 | 0 | /* |
1 | jQuery ColorBox language configuration | |
1 | jQuery Colorbox language configuration | |
2 | 2 | language: Italian (it) |
3 | 3 | translated by: maur8ino |
4 | 4 | */ |
0 | 0 | /* |
1 | jQuery ColorBox language configuration | |
1 | jQuery Colorbox language configuration | |
2 | 2 | language: Korean (kr) |
3 | 3 | translated by: lunareffect |
4 | 4 | */ |
0 | 0 | /* |
1 | jQuery ColorBox language configuration | |
1 | jQuery Colorbox language configuration | |
2 | 2 | language: Latvian (lv) |
3 | 3 | translated by: Matiss Roberts Treinis |
4 | 4 | site: x0.lv |
0 | 0 | /* |
1 | jQuery ColorBox language configuration | |
1 | jQuery Colorbox language configuration | |
2 | 2 | language: Dutch (nl) |
3 | 3 | translated by: barryvdh |
4 | 4 | */ |
0 | 0 | /* |
1 | jQuery ColorBox language configuration | |
1 | jQuery Colorbox language configuration | |
2 | 2 | language: Polski (pl) |
3 | 3 | translated by: Tomasz Wasiński |
4 | 4 | site: 2bevisible.pl |
0 | 0 | /* |
1 | jQuery ColorBox language configuration | |
1 | jQuery Colorbox language configuration | |
2 | 2 | language: Brazilian Portuguese (pt-br) |
3 | 3 | translated by: ReinaldoMT |
4 | 4 | */ |
0 | 0 | /* |
1 | jQuery ColorBox language configuration | |
1 | jQuery Colorbox language configuration | |
2 | 2 | language: Russian (ru) |
3 | 3 | translated by: Marfa |
4 | 4 | site: themarfa.name |
0 | 0 | /* |
1 | jQuery ColorBox language configuration | |
1 | jQuery Colorbox language configuration | |
2 | 2 | language: Turkish (tr) |
3 | 3 | translated by: Caner ÖNCEL |
4 | 4 | site: egonomik.com |
0 | 0 | /*! |
1 | jQuery ColorBox v1.4.6 - 2013-03-19 | |
1 | jQuery Colorbox v1.4.10 - 2013-04-02 | |
2 | 2 | (c) 2013 Jack Moore - jacklmoore.com/colorbox |
3 | 3 | license: http://www.opensource.org/licenses/mit-license.php |
4 | 4 | */ |
5 | (function(e,t,i){function o(i,o,n){var r=t.createElement(i);return o&&(r.id=et+o),n&&(r.style.cssText=n),e(r)}function n(){return i.innerHeight?i.innerHeight:e(i).height()}function r(e){var t=E.length,i=(j+e)%t;return 0>i?t+i:i}function h(e,t){return Math.round((/%/.test(e)?("x"===t?H.width():n())/100:1)*parseInt(e,10))}function s(e,t){return e.photo||e.photoRegex.test(t)}function l(e,t){return e.retinaUrl&&i.devicePixelRatio>1?t.replace(e.photoRegex,e.retinaSuffix):t}function a(e){"contains"in v[0]&&!v[0].contains(e.target)&&(e.stopPropagation(),v.focus())}function d(){var t,i=e.data(O,Z);null==i?(z=e.extend({},Y),console&&console.log&&console.log("Error: cboxElement missing settings object")):z=e.extend({},i);for(t in z)e.isFunction(z[t])&&"on"!==t.slice(0,2)&&(z[t]=z[t].call(O));z.rel=z.rel||O.rel||e(O).data("rel")||"nofollow",z.href=z.href||e(O).attr("href"),z.title=z.title||O.title,"string"==typeof z.href&&(z.href=e.trim(z.href))}function c(i,o){e(t).trigger(i),ct.trigger(i),e.isFunction(o)&&o.call(O)}function u(){var e,t,i,o,n,r=et+"Slideshow_",h="click."+et;z.slideshow&&E[1]?(t=function(){clearTimeout(e)},i=function(){(z.loop||E[j+1])&&(e=setTimeout(X.next,z.slideshowSpeed))},o=function(){F.html(z.slideshowStop).unbind(h).one(h,n),ct.bind(nt,i).bind(ot,t).bind(rt,n),v.removeClass(r+"off").addClass(r+"on")},n=function(){t(),ct.unbind(nt,i).unbind(ot,t).unbind(rt,n),F.html(z.slideshowStart).unbind(h).one(h,function(){X.next(),o()}),v.removeClass(r+"on").addClass(r+"off")},z.slideshowAuto?o():n()):v.removeClass(r+"off "+r+"on")}function f(i){G||(O=i,d(),E=e(O),j=0,"nofollow"!==z.rel&&(E=e("."+tt).filter(function(){var t,i=e.data(this,Z);return i&&(t=e(this).data("rel")||i.rel||this.rel),t===z.rel}),j=E.index(O),-1===j&&(E=E.add(O),j=E.length-1)),g.css({opacity:parseFloat(z.opacity),cursor:z.overlayClose?"pointer":"auto",visibility:"visible"}).show(),J&&v.add(g).removeClass(J),z.className&&v.add(g).addClass(z.className),J=z.className,K.html(z.close).show(),U||(U=$=!0,v.css({visibility:"hidden",display:"block"}),I=o(ut,"LoadedContent","width:0; height:0; overflow:hidden").appendTo(y),D=b.height()+k.height()+y.outerHeight(!0)-y.height(),B=C.width()+T.width()+y.outerWidth(!0)-y.width(),N=I.outerHeight(!0),A=I.outerWidth(!0),z.w=h(z.initialWidth,"x"),z.h=h(z.initialHeight,"y"),X.position(),at&&H.bind("resize."+dt+" scroll."+dt,function(){g.css({width:H.width(),height:n(),top:H.scrollTop(),left:H.scrollLeft()})}).trigger("resize."+dt),u(),c(it,z.onOpen),_.add(M).hide(),v.focus(),t.addEventListener&&(t.addEventListener("focus",a,!0),ct.one(ht,function(){t.removeEventListener("focus",a,!0)})),z.returnFocus&&ct.one(ht,function(){e(O).focus()})),w())}function p(){!v&&t.body&&(V=!1,H=e(i),v=o(ut).attr({id:Z,"class":lt?et+(at?"IE6":"IE"):"",role:"dialog",tabindex:"-1"}).hide(),g=o(ut,"Overlay",at?"position:absolute":"").hide(),W=o(ut,"LoadingOverlay").add(o(ut,"LoadingGraphic")),x=o(ut,"Wrapper"),y=o(ut,"Content").append(M=o(ut,"Title"),S=o(ut,"Current"),P=o("button","Previous"),R=o("button","Next"),F=o("button","Slideshow"),W,K=o("button","Close")),x.append(o(ut).append(o(ut,"TopLeft"),b=o(ut,"TopCenter"),o(ut,"TopRight")),o(ut,!1,"clear:left").append(C=o(ut,"MiddleLeft"),y,T=o(ut,"MiddleRight")),o(ut,!1,"clear:left").append(o(ut,"BottomLeft"),k=o(ut,"BottomCenter"),o(ut,"BottomRight"))).find("div div").css({"float":"left"}),L=o(ut,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),_=R.add(P).add(S).add(F),e(t.body).append(g,v.append(x,L)))}function m(){function i(e){e.which>1||e.shiftKey||e.altKey||e.metaKey||(e.preventDefault(),f(this))}return v?(V||(V=!0,R.click(function(){X.next()}),P.click(function(){X.prev()}),K.click(function(){X.close()}),g.click(function(){z.overlayClose&&X.close()}),e(t).bind("keydown."+et,function(e){var t=e.keyCode;U&&z.escKey&&27===t&&(e.preventDefault(),X.close()),U&&z.arrowKey&&E[1]&&!e.altKey&&(37===t?(e.preventDefault(),P.click()):39===t&&(e.preventDefault(),R.click()))}),e.isFunction(e.fn.on)?e(t).on("click."+et,"."+tt,i):e("."+tt).live("click."+et,i)),!0):!1}function w(){var t,n,r,a=X.prep,u=++ft;$=!0,q=!1,O=E[j],d(),c(st),c(ot,z.onLoad),z.h=z.height?h(z.height,"y")-N-D:z.innerHeight&&h(z.innerHeight,"y"),z.w=z.width?h(z.width,"x")-A-B:z.innerWidth&&h(z.innerWidth,"x"),z.mw=z.w,z.mh=z.h,z.maxWidth&&(z.mw=h(z.maxWidth,"x")-A-B,z.mw=z.w&&z.w<z.mw?z.w:z.mw),z.maxHeight&&(z.mh=h(z.maxHeight,"y")-N-D,z.mh=z.h&&z.h<z.mh?z.h:z.mh),t=z.href,Q=setTimeout(function(){W.show()},100),z.inline?(r=o(ut).hide().insertBefore(e(t)[0]),ct.one(st,function(){r.replaceWith(I.children())}),a(e(t))):z.iframe?a(" "):z.html?a(z.html):s(z,t)?(t=l(z,t),e(q=new Image).addClass(et+"Photo").bind("error",function(){z.title=!1,a(o(ut,"Error").html(z.imgError))}).one("load",function(){var e;u===ft&&(z.retinaImage&&i.devicePixelRatio>1&&(q.height=q.height/i.devicePixelRatio,q.width=q.width/i.devicePixelRatio),z.scalePhotos&&(n=function(){q.height-=q.height*e,q.width-=q.width*e},z.mw&&q.width>z.mw&&(e=(q.width-z.mw)/q.width,n()),z.mh&&q.height>z.mh&&(e=(q.height-z.mh)/q.height,n())),z.h&&(q.style.marginTop=Math.max(z.mh-q.height,0)/2+"px"),E[1]&&(z.loop||E[j+1])&&(q.style.cursor="pointer",q.onclick=function(){X.next()}),lt&&(q.style.msInterpolationMode="bicubic"),setTimeout(function(){a(q)},1))}),setTimeout(function(){q.src=t},1)):t&&L.load(t,z.data,function(t,i){u===ft&&a("error"===i?o(ut,"Error").html(z.xhrError):e(this).contents())})}var g,v,x,y,b,C,T,k,E,H,I,L,W,M,S,F,R,P,K,_,z,D,B,N,A,O,j,q,U,$,G,Q,X,J,V,Y={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,className:!1,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",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",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico)((#|\?).*)?$/i,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:void 0},Z="colorbox",et="cbox",tt=et+"Element",it=et+"_open",ot=et+"_load",nt=et+"_complete",rt=et+"_cleanup",ht=et+"_closed",st=et+"_purge",lt=!e.support.leadingWhitespace,at=lt&&!i.XMLHttpRequest,dt=et+"_IE6",ct=e("<a/>"),ut="div",ft=0;e.colorbox||(e(p),X=e.fn[Z]=e[Z]=function(t,i){var o=this;if(t=t||{},p(),m()){if(e.isFunction(o))o=e("<a/>"),t.open=!0;else if(!o[0])return o;i&&(t.onComplete=i),o.each(function(){e.data(this,Z,e.extend({},e.data(this,Z)||Y,t))}).addClass(tt),(e.isFunction(t.open)&&t.open.call(o)||t.open)&&f(o[0])}return o},X.position=function(e,t){function i(e){b[0].style.width=k[0].style.width=y[0].style.width=parseInt(e.style.width,10)-B+"px",y[0].style.height=C[0].style.height=T[0].style.height=parseInt(e.style.height,10)-D+"px"}var o,r,s,l=0,a=0,d=v.offset();H.unbind("resize."+et),v.css({top:-9e4,left:-9e4}),r=H.scrollTop(),s=H.scrollLeft(),z.fixed&&!at?(d.top-=r,d.left-=s,v.css({position:"fixed"})):(l=r,a=s,v.css({position:"absolute"})),a+=z.right!==!1?Math.max(H.width()-z.w-A-B-h(z.right,"x"),0):z.left!==!1?h(z.left,"x"):Math.round(Math.max(H.width()-z.w-A-B,0)/2),l+=z.bottom!==!1?Math.max(n()-z.h-N-D-h(z.bottom,"y"),0):z.top!==!1?h(z.top,"y"):Math.round(Math.max(n()-z.h-N-D,0)/2),v.css({top:d.top,left:d.left,visibility:"visible"}),e=v.width()===z.w+A&&v.height()===z.h+N?0:e||0,x[0].style.width=x[0].style.height="9999px",o={width:z.w+A+B,height:z.h+N+D,top:l,left:a},0===e&&v.css(o),v.dequeue().animate(o,{duration:e,complete:function(){i(this),$=!1,x[0].style.width=z.w+A+B+"px",x[0].style.height=z.h+N+D+"px",z.reposition&&setTimeout(function(){H.bind("resize."+et,X.position)},1),t&&t()},step:function(){i(this)}})},X.resize=function(e){U&&(e=e||{},e.width&&(z.w=h(e.width,"x")-A-B),e.innerWidth&&(z.w=h(e.innerWidth,"x")),I.css({width:z.w}),e.height&&(z.h=h(e.height,"y")-N-D),e.innerHeight&&(z.h=h(e.innerHeight,"y")),e.innerHeight||e.height||(I.css({height:"auto"}),z.h=I.height()),I.css({height:z.h}),X.position("none"===z.transition?0:z.speed))},X.prep=function(t){function i(){return z.w=z.w||I.width(),z.w=z.mw&&z.mw<z.w?z.mw:z.w,z.w}function n(){return z.h=z.h||I.height(),z.h=z.mh&&z.mh<z.h?z.mh:z.h,z.h}if(U){var h,a="none"===z.transition?0:z.speed;I.empty().remove(),I=o(ut,"LoadedContent").append(t),I.hide().appendTo(L.show()).css({width:i(),overflow:z.scrolling?"auto":"hidden"}).css({height:n()}).prependTo(y),L.hide(),e(q).css({"float":"none"}),h=function(){function t(){lt&&v[0].style.removeAttribute("filter")}var i,n,h=E.length,d="frameBorder",u="allowTransparency";U&&(n=function(){clearTimeout(Q),W.hide(),c(nt,z.onComplete)},lt&&q&&I.fadeIn(100),M.html(z.title).add(I).show(),h>1?("string"==typeof z.current&&S.html(z.current.replace("{current}",j+1).replace("{total}",h)).show(),R[z.loop||h-1>j?"show":"hide"]().html(z.next),P[z.loop||j?"show":"hide"]().html(z.previous),z.slideshow&&F.show(),z.preloading&&e.each([r(-1),r(1)],function(){var t,i,o=E[this],n=e.data(o,Z);n&&n.href?(t=n.href,e.isFunction(t)&&(t=t.call(o))):t=e(o).attr("href"),t&&s(n,t)&&(t=l(n,t),i=new Image,i.src=t)})):_.hide(),z.iframe?(i=o("iframe")[0],d in i&&(i[d]=0),u in i&&(i[u]="true"),z.scrolling||(i.scrolling="no"),e(i).attr({src:z.href,name:(new Date).getTime(),"class":et+"Iframe",allowFullScreen:!0,webkitAllowFullScreen:!0,mozallowfullscreen:!0}).one("load",n).appendTo(I),ct.one(st,function(){i.src="//about:blank"}),z.fastIframe&&e(i).trigger("load")):n(),"fade"===z.transition?v.fadeTo(a,1,t):t())},"fade"===z.transition?v.fadeTo(a,0,function(){X.position(0,h)}):X.position(a,h)}},X.next=function(){!$&&E[1]&&(z.loop||E[j+1])&&(j=r(1),f(E[j]))},X.prev=function(){!$&&E[1]&&(z.loop||j)&&(j=r(-1),f(E[j]))},X.close=function(){U&&!G&&(G=!0,U=!1,c(rt,z.onCleanup),H.unbind("."+et+" ."+dt),g.fadeTo(200,0),v.stop().fadeTo(300,0,function(){v.add(g).css({opacity:1,cursor:"auto"}).hide(),c(st),I.empty().remove(),setTimeout(function(){G=!1,c(ht,z.onClosed)},1)}))},X.remove=function(){e([]).add(v).add(g).remove(),v=null,e("."+tt).removeData(Z).removeClass(tt),e(t).unbind("click."+et)},X.element=function(){return e(O)},X.settings=Y)})(jQuery,document,window);⏎ | |
5 | (function(e,t,i){function o(i,o,n){var r=t.createElement(i);return o&&(r.id=et+o),n&&(r.style.cssText=n),e(r)}function n(){return i.innerHeight?i.innerHeight:e(i).height()}function r(e){var t=H.length,i=(j+e)%t;return 0>i?t+i:i}function h(e,t){return Math.round((/%/.test(e)?("x"===t?E.width():n())/100:1)*parseInt(e,10))}function s(e,t){return e.photo||e.photoRegex.test(t)}function l(e,t){return e.retinaUrl&&i.devicePixelRatio>1?t.replace(e.photoRegex,e.retinaSuffix):t}function a(e){"contains"in v[0]&&!v[0].contains(e.target)&&(e.stopPropagation(),v.focus())}function d(){var t,i=e.data(O,Z);null==i?(D=e.extend({},Y),console&&console.log&&console.log("Error: cboxElement missing settings object")):D=e.extend({},i);for(t in D)e.isFunction(D[t])&&"on"!==t.slice(0,2)&&(D[t]=D[t].call(O));D.rel=D.rel||O.rel||e(O).data("rel")||"nofollow",D.href=D.href||e(O).attr("href"),D.title=D.title||O.title,"string"==typeof D.href&&(D.href=e.trim(D.href))}function c(i,o){e(t).trigger(i),lt.trigger(i),e.isFunction(o)&&o.call(O)}function u(){var e,t,i,o,n,r=et+"Slideshow_",h="click."+et;D.slideshow&&H[1]?(t=function(){clearTimeout(e)},i=function(){(D.loop||H[j+1])&&(e=setTimeout(J.next,D.slideshowSpeed))},o=function(){M.html(D.slideshowStop).unbind(h).one(h,n),lt.bind(nt,i).bind(ot,t).bind(rt,n),v.removeClass(r+"off").addClass(r+"on")},n=function(){t(),lt.unbind(nt,i).unbind(ot,t).unbind(rt,n),M.html(D.slideshowStart).unbind(h).one(h,function(){J.next(),o()}),v.removeClass(r+"on").addClass(r+"off")},D.slideshowAuto?o():n()):v.removeClass(r+"off "+r+"on")}function f(i){G||(O=i,d(),H=e(O),j=0,"nofollow"!==D.rel&&(H=e("."+tt).filter(function(){var t,i=e.data(this,Z);return i&&(t=e(this).data("rel")||i.rel||this.rel),t===D.rel}),j=H.index(O),-1===j&&(H=H.add(O),j=H.length-1)),g.css({opacity:parseFloat(D.opacity),cursor:D.overlayClose?"pointer":"auto",visibility:"visible"}).show(),V&&v.add(g).removeClass(V),D.className&&v.add(g).addClass(D.className),V=D.className,K.html(D.close).show(),$||($=q=!0,v.css({visibility:"hidden",display:"block"}),W=o(at,"LoadedContent","width:0; height:0; overflow:hidden").appendTo(y),B=b.height()+k.height()+y.outerHeight(!0)-y.height(),N=C.width()+T.width()+y.outerWidth(!0)-y.width(),z=W.outerHeight(!0),A=W.outerWidth(!0),D.w=h(D.initialWidth,"x"),D.h=h(D.initialHeight,"y"),J.position(),u(),c(it,D.onOpen),_.add(F).hide(),v.focus(),t.addEventListener&&(t.addEventListener("focus",a,!0),lt.one(ht,function(){t.removeEventListener("focus",a,!0)})),D.returnFocus&<.one(ht,function(){e(O).focus()})),w())}function p(){!v&&t.body&&(X=!1,E=e(i),v=o(at).attr({id:Z,"class":e.support.opacity===!1?et+"IE":"",role:"dialog",tabindex:"-1"}).hide(),g=o(at,"Overlay").hide(),S=o(at,"LoadingOverlay").add(o(at,"LoadingGraphic")),x=o(at,"Wrapper"),y=o(at,"Content").append(F=o(at,"Title"),I=o(at,"Current"),P=o("button","Previous"),R=o("button","Next"),M=o("button","Slideshow"),S,K=o("button","Close")),x.append(o(at).append(o(at,"TopLeft"),b=o(at,"TopCenter"),o(at,"TopRight")),o(at,!1,"clear:left").append(C=o(at,"MiddleLeft"),y,T=o(at,"MiddleRight")),o(at,!1,"clear:left").append(o(at,"BottomLeft"),k=o(at,"BottomCenter"),o(at,"BottomRight"))).find("div div").css({"float":"left"}),L=o(at,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),_=R.add(P).add(I).add(M),e(t.body).append(g,v.append(x,L)))}function m(){function i(e){e.which>1||e.shiftKey||e.altKey||e.metaKey||e.control||(e.preventDefault(),f(this))}return v?(X||(X=!0,R.click(function(){J.next()}),P.click(function(){J.prev()}),K.click(function(){J.close()}),g.click(function(){D.overlayClose&&J.close()}),e(t).bind("keydown."+et,function(e){var t=e.keyCode;$&&D.escKey&&27===t&&(e.preventDefault(),J.close()),$&&D.arrowKey&&H[1]&&!e.altKey&&(37===t?(e.preventDefault(),P.click()):39===t&&(e.preventDefault(),R.click()))}),e.isFunction(e.fn.on)?e(t).on("click."+et,"."+tt,i):e("."+tt).live("click."+et,i)),!0):!1}function w(){var t,n,r,a=J.prep,u=++dt;q=!0,U=!1,O=H[j],d(),c(st),c(ot,D.onLoad),D.h=D.height?h(D.height,"y")-z-B:D.innerHeight&&h(D.innerHeight,"y"),D.w=D.width?h(D.width,"x")-A-N:D.innerWidth&&h(D.innerWidth,"x"),D.mw=D.w,D.mh=D.h,D.maxWidth&&(D.mw=h(D.maxWidth,"x")-A-N,D.mw=D.w&&D.w<D.mw?D.w:D.mw),D.maxHeight&&(D.mh=h(D.maxHeight,"y")-z-B,D.mh=D.h&&D.h<D.mh?D.h:D.mh),t=D.href,Q=setTimeout(function(){S.show()},100),D.inline?(r=o(at).hide().insertBefore(e(t)[0]),lt.one(st,function(){r.replaceWith(W.children())}),a(e(t))):D.iframe?a(" "):D.html?a(D.html):s(D,t)?(t=l(D,t),e(U=new Image).addClass(et+"Photo").bind("error",function(){D.title=!1,a(o(at,"Error").html(D.imgError))}).one("load",function(){var e;u===dt&&(D.retinaImage&&i.devicePixelRatio>1&&(U.height=U.height/i.devicePixelRatio,U.width=U.width/i.devicePixelRatio),D.scalePhotos&&(n=function(){U.height-=U.height*e,U.width-=U.width*e},D.mw&&U.width>D.mw&&(e=(U.width-D.mw)/U.width,n()),D.mh&&U.height>D.mh&&(e=(U.height-D.mh)/U.height,n())),D.h&&(U.style.marginTop=Math.max(D.mh-U.height,0)/2+"px"),H[1]&&(D.loop||H[j+1])&&(U.style.cursor="pointer",U.onclick=function(){J.next()}),setTimeout(function(){a(U)},1))}),setTimeout(function(){U.src=t},1)):t&&L.load(t,D.data,function(t,i){u===dt&&a("error"===i?o(at,"Error").html(D.xhrError):e(this).contents())})}var g,v,x,y,b,C,T,k,H,E,W,L,S,F,I,M,R,P,K,_,D,B,N,z,A,O,j,U,$,q,G,Q,J,V,X,Y={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,className:!1,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",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",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico)((#|\?).*)?$/i,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:void 0},Z="colorbox",et="cbox",tt=et+"Element",it=et+"_open",ot=et+"_load",nt=et+"_complete",rt=et+"_cleanup",ht=et+"_closed",st=et+"_purge",lt=e("<a/>"),at="div",dt=0;e.colorbox||(e(p),J=e.fn[Z]=e[Z]=function(t,i){var o=this;if(t=t||{},p(),m()){if(e.isFunction(o))o=e("<a/>"),t.open=!0;else if(!o[0])return o;i&&(t.onComplete=i),o.each(function(){e.data(this,Z,e.extend({},e.data(this,Z)||Y,t))}).addClass(tt),(e.isFunction(t.open)&&t.open.call(o)||t.open)&&f(o[0])}return o},J.position=function(e,t){function i(e){b[0].style.width=k[0].style.width=y[0].style.width=parseInt(e.style.width,10)-N+"px",y[0].style.height=C[0].style.height=T[0].style.height=parseInt(e.style.height,10)-B+"px"}var o,r,s,l=0,a=0,d=v.offset();E.unbind("resize."+et),v.css({top:-9e4,left:-9e4}),r=E.scrollTop(),s=E.scrollLeft(),D.fixed?(d.top-=r,d.left-=s,v.css({position:"fixed"})):(l=r,a=s,v.css({position:"absolute"})),a+=D.right!==!1?Math.max(E.width()-D.w-A-N-h(D.right,"x"),0):D.left!==!1?h(D.left,"x"):Math.round(Math.max(E.width()-D.w-A-N,0)/2),l+=D.bottom!==!1?Math.max(n()-D.h-z-B-h(D.bottom,"y"),0):D.top!==!1?h(D.top,"y"):Math.round(Math.max(n()-D.h-z-B,0)/2),v.css({top:d.top,left:d.left,visibility:"visible"}),e=v.width()===D.w+A&&v.height()===D.h+z?0:e||0,x[0].style.width=x[0].style.height="9999px",o={width:D.w+A+N,height:D.h+z+B,top:l,left:a},0===e&&v.css(o),v.dequeue().animate(o,{duration:e,complete:function(){i(this),q=!1,x[0].style.width=D.w+A+N+"px",x[0].style.height=D.h+z+B+"px",D.reposition&&setTimeout(function(){E.bind("resize."+et,J.position)},1),t&&t()},step:function(){i(this)}})},J.resize=function(e){$&&(e=e||{},e.width&&(D.w=h(e.width,"x")-A-N),e.innerWidth&&(D.w=h(e.innerWidth,"x")),W.css({width:D.w}),e.height&&(D.h=h(e.height,"y")-z-B),e.innerHeight&&(D.h=h(e.innerHeight,"y")),e.innerHeight||e.height||(W.css({height:"auto"}),D.h=W.height()),W.css({height:D.h}),J.position("none"===D.transition?0:D.speed))},J.prep=function(t){function i(){return D.w=D.w||W.width(),D.w=D.mw&&D.mw<D.w?D.mw:D.w,D.w}function n(){return D.h=D.h||W.height(),D.h=D.mh&&D.mh<D.h?D.mh:D.h,D.h}if($){var h,a="none"===D.transition?0:D.speed;W.empty().remove(),W=o(at,"LoadedContent").append(t),W.hide().appendTo(L.show()).css({width:i(),overflow:D.scrolling?"auto":"hidden"}).css({height:n()}).prependTo(y),L.hide(),e(U).css({"float":"none"}),h=function(){function t(){e.support.opacity===!1&&v[0].style.removeAttribute("filter")}var i,n,h=H.length,d="frameBorder",u="allowTransparency";$&&(n=function(){clearTimeout(Q),S.hide(),c(nt,D.onComplete)},F.html(D.title).add(W).show(),h>1?("string"==typeof D.current&&I.html(D.current.replace("{current}",j+1).replace("{total}",h)).show(),R[D.loop||h-1>j?"show":"hide"]().html(D.next),P[D.loop||j?"show":"hide"]().html(D.previous),D.slideshow&&M.show(),D.preloading&&e.each([r(-1),r(1)],function(){var t,i,o=H[this],n=e.data(o,Z);n&&n.href?(t=n.href,e.isFunction(t)&&(t=t.call(o))):t=e(o).attr("href"),t&&s(n,t)&&(t=l(n,t),i=new Image,i.src=t)})):_.hide(),D.iframe?(i=o("iframe")[0],d in i&&(i[d]=0),u in i&&(i[u]="true"),D.scrolling||(i.scrolling="no"),e(i).attr({src:D.href,name:(new Date).getTime(),"class":et+"Iframe",allowFullScreen:!0,webkitAllowFullScreen:!0,mozallowfullscreen:!0}).one("load",n).appendTo(W),lt.one(st,function(){i.src="//about:blank"}),D.fastIframe&&e(i).trigger("load")):n(),"fade"===D.transition?v.fadeTo(a,1,t):t())},"fade"===D.transition?v.fadeTo(a,0,function(){J.position(0,h)}):J.position(a,h)}},J.next=function(){!q&&H[1]&&(D.loop||H[j+1])&&(j=r(1),f(H[j]))},J.prev=function(){!q&&H[1]&&(D.loop||j)&&(j=r(-1),f(H[j]))},J.close=function(){$&&!G&&(G=!0,$=!1,c(rt,D.onCleanup),E.unbind("."+et),g.fadeTo(200,0),v.stop().fadeTo(300,0,function(){v.add(g).css({opacity:1,cursor:"auto"}).hide(),c(st),W.empty().remove(),setTimeout(function(){G=!1,c(ht,D.onClosed)},1)}))},J.remove=function(){v&&(v.stop(),e.colorbox.close(),v.stop().remove(),g.remove(),G=!1,v=null,e("."+tt).removeData(Z).removeClass(tt),e(t).unbind("click."+et))},J.element=function(){return e(O)},J.settings=Y)})(jQuery,document,window);⏎ |
0 | 0 | /*! |
1 | jQuery ColorBox v1.4.6 - 2013-03-19 | |
1 | jQuery Colorbox v1.4.10 - 2013-04-02 | |
2 | 2 | (c) 2013 Jack Moore - jacklmoore.com/colorbox |
3 | 3 | license: http://www.opensource.org/licenses/mit-license.php |
4 | 4 | */ |
83 | 83 | event_cleanup = prefix + '_cleanup', |
84 | 84 | event_closed = prefix + '_closed', |
85 | 85 | event_purge = prefix + '_purge', |
86 | ||
87 | // Special Handling for IE | |
88 | isIE = !$.support.leadingWhitespace, // IE6 to IE8 | |
89 | isIE6 = isIE && !window.XMLHttpRequest, // IE6 | |
90 | event_ie6 = prefix + '_IE6', | |
91 | 86 | |
92 | 87 | // Cached jQuery Object Variables |
93 | 88 | $overlay, |
317 | 312 | }); |
318 | 313 | index = $related.index(element); |
319 | 314 | |
320 | // Check direct calls to ColorBox. | |
315 | // Check direct calls to Colorbox. | |
321 | 316 | if (index === -1) { |
322 | 317 | $related = $related.add(element); |
323 | 318 | index = $related.length - 1; |
350 | 345 | $loaded = $tag(div, 'LoadedContent', 'width:0; height:0; overflow:hidden').appendTo($content); |
351 | 346 | |
352 | 347 | // Cache values needed for size calculations |
353 | interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();//Subtraction needed for IE6 | |
348 | interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height(); | |
354 | 349 | interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width(); |
355 | 350 | loadedHeight = $loaded.outerHeight(true); |
356 | 351 | loadedWidth = $loaded.outerWidth(true); |
357 | 352 | |
358 | 353 | |
359 | // Opens inital empty ColorBox prior to content being loaded. | |
354 | // Opens inital empty Colorbox prior to content being loaded. | |
360 | 355 | settings.w = setSize(settings.initialWidth, 'x'); |
361 | 356 | settings.h = setSize(settings.initialHeight, 'y'); |
362 | 357 | publicMethod.position(); |
363 | 358 | |
364 | if (isIE6) { | |
365 | $window.bind('resize.' + event_ie6 + ' scroll.' + event_ie6, function () { | |
366 | $overlay.css({width: $window.width(), height: winheight(), top: $window.scrollTop(), left: $window.scrollLeft()}); | |
367 | }).trigger('resize.' + event_ie6); | |
368 | } | |
369 | ||
370 | 359 | slideshow(); |
371 | 360 | |
372 | 361 | trigger(event_open, settings.onOpen); |
398 | 387 | } |
399 | 388 | } |
400 | 389 | |
401 | // ColorBox's markup needs to be added to the DOM prior to being called | |
390 | // Colorbox's markup needs to be added to the DOM prior to being called | |
402 | 391 | // so that the browser will go ahead and load the CSS background images. |
403 | 392 | function appendHTML() { |
404 | 393 | if (!$box && document.body) { |
405 | 394 | init = false; |
406 | ||
407 | 395 | $window = $(window); |
408 | 396 | $box = $tag(div).attr({ |
409 | 397 | id: colorbox, |
410 | 'class': isIE ? prefix + (isIE6 ? 'IE6' : 'IE') : '', | |
398 | 'class': $.support.opacity === false ? prefix + 'IE' : '', // class for optional IE8 & lower targeted CSS. | |
411 | 399 | role: 'dialog', |
412 | 400 | tabindex: '-1' |
413 | 401 | }).hide(); |
414 | $overlay = $tag(div, "Overlay", isIE6 ? 'position:absolute' : '').hide(); | |
402 | $overlay = $tag(div, "Overlay").hide(); | |
415 | 403 | $loadingOverlay = $tag(div, "LoadingOverlay").add($tag(div, "LoadingGraphic")); |
416 | 404 | $wrap = $tag(div, "Wrapper"); |
417 | 405 | $content = $tag(div, "Content").append( |
424 | 412 | $close = $tag('button', "Close") |
425 | 413 | ); |
426 | 414 | |
427 | $wrap.append( // The 3x3 Grid that makes up ColorBox | |
415 | $wrap.append( // The 3x3 Grid that makes up Colorbox | |
428 | 416 | $tag(div).append( |
429 | 417 | $tag(div, "TopLeft"), |
430 | 418 | $topBorder = $tag(div, "TopCenter"), |
450 | 438 | } |
451 | 439 | } |
452 | 440 | |
453 | // Add ColorBox's event bindings | |
441 | // Add Colorbox's event bindings | |
454 | 442 | function addBindings() { |
455 | 443 | function clickHandler(e) { |
456 | 444 | // ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt. |
457 | 445 | // See: http://jacklmoore.com/notes/click-events/ |
458 | if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey)) { | |
446 | if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.control)) { | |
459 | 447 | e.preventDefault(); |
460 | 448 | launch(this); |
461 | 449 | } |
514 | 502 | return false; |
515 | 503 | } |
516 | 504 | |
517 | // Don't do anything if ColorBox already exists. | |
505 | // Don't do anything if Colorbox already exists. | |
518 | 506 | if ($.colorbox) { |
519 | 507 | return; |
520 | 508 | } |
525 | 513 | |
526 | 514 | // **************** |
527 | 515 | // PUBLIC FUNCTIONS |
528 | // Usage format: $.fn.colorbox.close(); | |
529 | // Usage from within an iframe: parent.$.fn.colorbox.close(); | |
516 | // Usage format: $.colorbox.close(); | |
517 | // Usage from within an iframe: parent.jQuery.colorbox.close(); | |
530 | 518 | // **************** |
531 | 519 | |
532 | 520 | publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) { |
577 | 565 | scrollTop = $window.scrollTop(); |
578 | 566 | scrollLeft = $window.scrollLeft(); |
579 | 567 | |
580 | if (settings.fixed && !isIE6) { | |
568 | if (settings.fixed) { | |
581 | 569 | offset.top -= scrollTop; |
582 | 570 | offset.left -= scrollLeft; |
583 | 571 | $box.css({position: 'fixed'}); |
724 | 712 | return; |
725 | 713 | } |
726 | 714 | |
727 | function removeFilter() { | |
728 | if (isIE) { | |
715 | function removeFilter() { // Needed for IE7 & IE8 in versions of jQuery prior to 1.7.2 | |
716 | if ($.support.opacity === false) { | |
729 | 717 | $box[0].style.removeAttribute('filter'); |
730 | 718 | } |
731 | 719 | } |
735 | 723 | $loadingOverlay.hide(); |
736 | 724 | trigger(event_complete, settings.onComplete); |
737 | 725 | }; |
738 | ||
739 | if (isIE) { | |
740 | //This fadeIn helps the bicubic resampling to kick-in. | |
741 | if (photo) { | |
742 | $loaded.fadeIn(100); | |
743 | } | |
744 | } | |
726 | ||
745 | 727 | |
746 | 728 | $title.html(settings.title).add($loaded).show(); |
747 | 729 | |
885 | 867 | |
886 | 868 | if (settings.inline) { |
887 | 869 | // Inserts an empty placeholder where inline content is being pulled from. |
888 | // An event is bound to put inline content back when ColorBox closes or loads new content. | |
870 | // An event is bound to put inline content back when Colorbox closes or loads new content. | |
889 | 871 | $inline = $tag(div).hide().insertBefore($(href)[0]); |
890 | 872 | |
891 | 873 | $events.one(event_purge, function () { |
946 | 928 | publicMethod.next(); |
947 | 929 | }; |
948 | 930 | } |
949 | ||
950 | if (isIE) { | |
951 | photo.style.msInterpolationMode = 'bicubic'; | |
952 | } | |
953 | ||
931 | ||
954 | 932 | setTimeout(function () { // A pause because Chrome will sometimes report a 0 by 0 size otherwise. |
955 | 933 | prep(photo); |
956 | 934 | }, 1); |
983 | 961 | } |
984 | 962 | }; |
985 | 963 | |
986 | // Note: to use this within an iframe use the following format: parent.$.fn.colorbox.close(); | |
964 | // Note: to use this within an iframe use the following format: parent.jQuery.colorbox.close(); | |
987 | 965 | publicMethod.close = function () { |
988 | 966 | if (open && !closing) { |
989 | 967 | |
993 | 971 | |
994 | 972 | trigger(event_cleanup, settings.onCleanup); |
995 | 973 | |
996 | $window.unbind('.' + prefix + ' .' + event_ie6); | |
974 | $window.unbind('.' + prefix); | |
997 | 975 | |
998 | 976 | $overlay.fadeTo(200, 0); |
999 | 977 | |
1013 | 991 | } |
1014 | 992 | }; |
1015 | 993 | |
1016 | // Removes changes ColorBox made to the document, but does not remove the plugin | |
1017 | // from jQuery. | |
994 | // Removes changes Colorbox made to the document, but does not remove the plugin. | |
1018 | 995 | publicMethod.remove = function () { |
1019 | $([]).add($box).add($overlay).remove(); | |
996 | if (!$box) { return; } | |
997 | ||
998 | $box.stop(); | |
999 | $.colorbox.close(); | |
1000 | $box.stop().remove(); | |
1001 | $overlay.remove(); | |
1002 | closing = false; | |
1020 | 1003 | $box = null; |
1021 | 1004 | $('.' + boxElement) |
1022 | 1005 | .removeData(colorbox) |
1025 | 1008 | $(document).unbind('click.'+prefix); |
1026 | 1009 | }; |
1027 | 1010 | |
1028 | // A method for fetching the current element ColorBox is referencing. | |
1011 | // A method for fetching the current element Colorbox is referencing. | |
1029 | 1012 | // returns a jQuery object. |
1030 | 1013 | publicMethod.element = function () { |
1031 | 1014 | return $(element); |