Lightbox (JavaScript): Difference between revisions

Content deleted Content added
No edit summary
m Removing link(s) Wikipedia:Articles for deletion/IBM Developer closed as soft delete (XFDcloser)
 
(77 intermediate revisions by 56 users not shown)
Line 1:
{{Short description|JavaScript library}}
{{Infobox software
[[File:Lightbox mockup.jpg|thumb|A typical lightbox image display]]
| name = Lightbox
| screenshot = [[Image:lightbox2.png|225px]]
| caption = A webpage showing a Lightbox 2 window.
| developer = Lokesh Dhakar
| latest release version = 2.04
| latest release date = {{release date|2008|03|09}}
| operating system = [[Cross-platform]]
| language = [[English language|English]]
| status = [[Software release cycle#Stable/unstable|Stable]]
| license = [[Creative Commons Attribution 2.5 License]]
| website = http://www.lokeshdhakar.com/projects/lightbox2/
}}
'''Lightbox''', and the newer '''Lightbox 2''', is a [[JavaScript]] application used to display large images using [[Modal window|modal dialogs]]. The script has gained widespread popularity due to its simple yet elegant style and easy implementation. While it was initially developed from scratch, Lightbox has since been modified to use a number of JavaScript libraries (such as the [[Prototype Javascript Framework]]<ref name="Herrington">{{cite web | last = Herrington | first = Jack D | date = | title = Ajax and XML: Ajax for lightboxes | work = [[IBM DeveloperWorks]] | url = http://www.ibm.com/developerworks/library/x-ajaxxml6/ | accessdate = 2008-05-21 }}</ref> and [[script.aculo.us]]<ref name="Schmitt">{{cite book | last = Schmitt | first = Christopher | year = 2006 | title = CSS Cookbook | publisher = [[O'Reilly]] | isbn = 0-596-52741-1 | pages = p. 204 }}</ref> for its animations and positioning), in order to reduce the size of the code.<ref name="Resig">{{cite book | last = Resig | first = John | year = 2006 | title = Pro JavaScript Techniques | publisher = [[Apress]] | isbn = 1-59059-727-3 }}</ref> The release of Lightbox encouraged other developers to work on similar projects, resulting in products such as the later Thickbox and lighter Slimbox.<ref name="Resig" />
 
'''Lightbox''' is a [[JavaScript]] library that displays images and videos by filling the screen, and dimming out the rest of the [[web page]].<ref name="useit">{{Cite web|url=http://www.useit.com/alertbox/application-design.html|title=10 Best Application UIs|author=Jakob Nielsen, Alertbox}}</ref>
== How it works ==
 
The original JavaScript library was written by Lokesh Dhakar.<ref>{{cite web | accessdate=2012-12-17 | first=Lokesh | last=Dhakar | title=Lightbox JS | url=http://lokeshdhakar.com/projects/lightbox/}}</ref> The term Lightbox may also refer to other similar JavaScript libraries. The technique gained widespread popularity due to its simple and elegant style.
On a Lightbox-enabled page, a user can click an image to have it magnified in a Lightbox window, which resizes itself according to the size of the image using a gliding animation. Lightbox determines which images will be shown in the modal window through the XHTML "rel" attribute, which is used on an &lt;a&gt; element wrapped around the &lt;img&gt; element. Lightbox also provides a way to attach captions to images and to run a slide show, which can be navigated using the arrow keys.
 
'''Lightbox''',The andoriginal the newer '''Lightbox 2''', is a [[JavaScript]] applicationlibrary used to display large images using [[Modal window|modal dialogs]]. The script has gained widespread popularity due to its simple yet elegant style and easy implementation. While it was initially developed from scratch, Lightbox has since been modified to use a number oftwo JavaScript libraries (such as the, [[Prototype Javascript Framework]]<ref name="Herrington">{{cite web | last = Herrington | first = Jack D | date = | title = Ajax and XML: Ajax for lightboxes | work = [[IBM DeveloperWorks]] | url = http://www.ibm.com/developerworks/library/x-ajaxxml6/ | accessdate = 2008-05-21 }}</ref> and [[script.aculo.us]],<ref name="Schmitt">{{cite book | last = Schmitt | first = Christopher | year = 2006 | title = CSS Cookbook | publisher = [[O'Reilly Media|O'Reilly]] | isbn = 0-596-52741-1 | pages = p. 204 }}</ref> for its animations and positioning),. inIn orderApril to reduce2012, the size[[Plug-in of(computing)|plugin]] thewas coderewritten for [[jQuery]].<ref name="Resig">{{cite bookweb | last accessdate= Resig2012-12-17 | first = JohnLokesh | year last= 2006Dhakar | title = Pro JavaScript TechniquesLightbox2 | publisher url= [[Apress]] | isbn = 1-59059-727-3 http://lokeshdhakar.com/projects/lightbox2/}}</ref> The releaseopen-source nature of Lightbox encouraged other developers to workmodify onand similarfork projectsthe code, resulting in productsplugins such as theColorbox, laterMagnific ThickboxPopup, andSlimbox lighteror SlimboxThickbox.<ref name="Resig" />
== Functionality ==
 
Lightbox scripts are dependent upon a browser's [[JavaScript]] support.<ref name="Schmitt2">{{cite book | last = Schmitt | first = Christopher | year = 2006 | title = CSS Cookbook | publisher = [[O'Reilly Media|O'Reilly]] | isbn = 0-596-52741-1 | pages = 207 }}</ref> Browsers that do not load the script for whatever reason can instead simply load the image as a separate page load, losing the Lightbox effect but still retaining the ability to display the image.<ref name="Zervaas">{{cite book | last = Zervaas | first = Quentin | year = 2007 | title = Practical Web 2.0 Applications with PHP | publisher = Springer | isbn = 1-59059-906-3 | pages = [https://archive.org/details/practicalweb20ap0000zerv/page/423 423] | url = https://archive.org/details/practicalweb20ap0000zerv/page/423 }}</ref>
''Lightbox'' permits users to view larger versions of images without having to leave the current page,<ref name="Zervaas">{{cite book | last = Zervaas | first = Quentin | year = 2007 | title = Practical Web 2.0 Applications with PHP | publisher = Springer | isbn = 1-59059-906-3 | pages = p. 423 }}</ref> and is also able to display simple slideshows. The use of the dark background, which dims the page over which the image has been overlaid, also serves to disable the remainder of the interface.
 
While ''Lightbox'' is dependent upon a browser's compatibility with [[Prototype JavaScript Framework|Prototype]] to function,<ref name="Schmitt">{{cite book | last = Schmitt | first = Christopher | year = 2006 | title = CSS Cookbook | publisher = [[O'Reilly]] | isbn = 0-596-52741-1 | pages = p. 207 }}</ref> Lightbox is triggered through a standard link tag. Thus browsers that do not support JavaScript simply load the image as a separate file, losing the Lightbox effect but still retaining the ability to display the full-sized image.<ref name="Zervaas" /> Even so, some compatibility problems have been identified with versions of Lightbox, in particular when displaying larger images on [[Firefox]] or [[Opera (web browser)|Opera]].<ref name="Campbell">{{cite web | last = Campbell | first = Debbie | date = February 15, 2007 | title = Thickbox – For Image Display and Slideshows | work = WebProNews | url = http://www.webpronews.com/blogtalk/2007/02/15/thickbox-for-image-display-and-slideshows | accessdate = 2008-05-21 }}</ref>
 
Many users have also noted that there is a lack of compatibility across the [[Internet Explorer]] range of browsers. However, many times the compatibility issues can be attributed to users not reading the documentation on how to make lightbox function correctly in these browsers.{{Citation needed|date=February 2010}}
 
== References ==
{{reflistReflist}}
 
== External links ==
* {{Commons catcategory inline|Lightbox (JavaScript)}}
{{External links|date=February 2010}}
* [http://lokeshdhakar.com/projects/lightbox2/ Official Lightbox website]
* [http://planetozh.com/projects/lightbox-clones/ The Lightbox Clones Matrix] provides a listing of Lightbox alternatives (clones) in a JavaScript-enhanced tabular format
 
[[Category:JavaScript]]
[[Category:Web design]]
[[Category:Web development]]
[[Category:Web 2.0]]
[[Category:Ajax (programming)]]
 
[[Category:JavaScript libraries]]
[[cs:Lightbox 2]]
[[es:Lightbox (JavaScript)]]
[[ja:Lightbox]]