{"id":1555,"date":"2008-06-10T23:55:31","date_gmt":"2008-06-11T04:55:31","guid":{"rendered":"http:\/\/teamtutorials.com\/?p=1555"},"modified":"2008-10-26T14:47:52","modified_gmt":"2008-10-26T18:47:52","slug":"professional-javascript-based-photo-viewer","status":"publish","type":"post","link":"https:\/\/teamtutorials.com\/web-development-tutorials\/professional-javascript-based-photo-viewer","title":{"rendered":"Professional Javascript Based Photo Viewer"},"content":{"rendered":"

This tutorial will walk you through installing and configuring Lightbox 2. Lightbox allows you to show your pictures on your site in a whole new light. It gives you a sleek and professional look and is VERY easy to implement. Lightbox is written by Lokesh Dhakar <\/a> and can be downloaded from HuddleTogeteher<\/a><\/p>\n

\"configuring_lightbox_01\"<\/a><\/p>\n

Once the site loads it should take you straight to the download section of the page. Click on it to download the files you need. They will come in.ZIP file.<\/p>\n

\"configuring_lightbox_02\"<\/a><\/p>\n

Save the file to your desktop or somewhere else that you will be able to get to it easily when it is completed.<\/p>\n

\"configuring_lightbox_03\"<\/a><\/p>\n

If you have WinRAR or some other program installed that will uncompress it you will be able to right-click on it and select uncompress to (file name here). <\/p>\n

\"configuring_lightbox_04\"<\/a><\/p>\n

This is what the files look like once you un-compressed them. For the easiest use, you should leave these files the way they are and upload them to your server. If you have a different layout you use on your server (for storing scripts and pictures) I will cover how to make those changes later.<\/p>\n

Now we need to create our index.html file that will call these files and make them work. Please note that I added 4 files to the images directory with the names of image-2.jpg, image3.jpg, image4.jpg, and image5.jpg. I have also made the 4 extra thumbnails for them as well and named them accordingly. You can Download the Images.( www.teamtutorials.com\/images.zip)<\/p>\n

Now let\u2019s look at our code to make this work:<\/p>\n

\r\n<html>\r\n<head>\r\n<link rel="stylesheet" href="css\/lightbox.css" type="text\/css" media="screen" \/>\r\n<script type="text\/javascript" src="js\/prototype.js"><\/script>\r\n<script type="text\/javascript" src="js\/scriptaculous.js?load=effects,builder"><\/script>\r\n<script type="text\/javascript" src="js\/lightbox.js"><\/script>\r\n<\/head>\r\n<\/pre>\n

The above lines simply tell the HTML file where to get the javascript to handle our pictures that we are using. It also says where to get our Cascading Style Sheet to format the output. <\/p>\n

\r\n<body bgcolor = \u201c666666\u201d>\r\n<font color ="FFFFFF">\r\n <H2> Set 1 <\/H2>\r\n<a href="images\/image-1.jpg" rel="lightbox&#91;set1&#93;" title="Set 1 Picture 1"><img src="images\/thumb-1.jpg"\/><\/a>\r\n\r\n<a href="images\/image-2.jpg" rel="lightbox&#91;set1&#93;" title="Set 1 Picture 2"><img src="images\/thumb-2.jpg"\/><\/a><br \/><br \/>\r\n\r\n <H2> Set 2 <\/H2>\r\n\r\n<a href="images\/image-3.jpg" rel="lightbox&#91;set2&#93;" title="Set 2 Picture 1"><img src="images\/thumb-3.jpg"\/><\/a>\r\n\r\n<a href="images\/image-4.jpg" rel="lightbox&#91;set2&#93;" title="Set 2 Picture 2"><img src="images\/thumb-4.jpg"\/><\/a>\r\n\r\n<a href="images\/image-5.jpg" rel="lightbox&#91;set2&#93;" title="Set 2 Picture 3"><img src="images\/thumb-5.jpg"\/><\/a>\r\n\r\n<\/body>\r\n<\/html>\r\n<\/pre>\n

The above text is simple html to show the images. The only difference you will need to note is the \u201crel=lightbox[]\u201d area. Notice How the first ones say set1 and the second set say set 2. You can do this with any names you want to make separate sets. This way they can view all the pictures from one set and then go to the next set. If you just have one big set, you can leave the brackets blank. This should work now, as long as you set everything up the way it came in the zip file, if you moved any of the files, you will have to change a few things. One is the line in the html that calls the style sheet. If you have that somewhere else change that line and obviously the images your linking too will be different. If you have the javascripts somewhere else you need to change them in the HTML file as well. If you re-locate the images you need to change some things in the CSS and in one of the JS files.<\/p>\n

In the CSS look for these two lines and change them accordingly to match where your images are:<\/p>\n

\r\n#prevLink:hover, #prevLink:visited:hover { background: url(..\/images\/prevlabel.gif) left 15% no-repeat; }\r\n#nextLink:hover, #nextLink:visited:hover { background: url(..\/images\/nextlabel.gif) right 15% no-repeat; }\r\n<\/pre>\n

In the lightbox.js file near the top look for these two lines and change them to match where you put your image files:<\/p>\n

\r\nLightboxOptions = Object.extend({\r\n    fileLoadingImage:        'images\/loading.gif',     \r\n    fileBottomNavCloseImage: 'images\/closelabel.gif',\r\n<\/pre>\n

Other than that every thing should still work. If you have any troubles, ensure that your files are all located in the correct place. I find it simpler to make it work the way it came first, and then move it the way you wanted to make sure that you understand what changes you made.
\nIf the above code all works and you have the files in the correct place the main page should look like this:<\/p>\n

\"configuring_lightbox_05\"<\/a><\/p>\n

When you click on one of the images from a set it should turn into this:<\/p>\n

\"configuring_lightbox_06\"<\/a><\/p>\n

I hope this helps you and that you were able to follow it without any issues. Good luck and thanks for reading.<\/p>\n","protected":false},"excerpt":{"rendered":"

This tutorial will walk you through installing and configuring Lightbox 2. Lightbox allows you to show your pictures on your site in a whole new light. It gives you a sleek and professional look and is VERY easy to implement.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[44,30,17],"tags":[50,49,51,163,55],"yoast_head":"\nProfessional Javascript Based Photo Viewer<\/title>\n<meta name=\"description\" content=\"This tutorial will walk you through installing and configuring Lightbox 2. Lightbox allows you to show your pictures on your site in a whole new light. It gives you a sleek and professional look and is VERY easy to implement.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/teamtutorials.com\/web-development-tutorials\/professional-javascript-based-photo-viewer\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mike Maguire\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/teamtutorials.com\/#website\",\"url\":\"https:\/\/teamtutorials.com\/\",\"name\":\"Team Tutorials\",\"description\":\"Learn something new today\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/teamtutorials.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/teamtutorials.com\/web-development-tutorials\/professional-javascript-based-photo-viewer#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"http:\/\/teamtutorials.com\/wp-content\/uploads\/2008\/06\/configuring_lightbox_01.jpg\",\"contentUrl\":\"http:\/\/teamtutorials.com\/wp-content\/uploads\/2008\/06\/configuring_lightbox_01.jpg\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/teamtutorials.com\/web-development-tutorials\/professional-javascript-based-photo-viewer#webpage\",\"url\":\"https:\/\/teamtutorials.com\/web-development-tutorials\/professional-javascript-based-photo-viewer\",\"name\":\"Professional Javascript Based Photo Viewer\",\"isPartOf\":{\"@id\":\"https:\/\/teamtutorials.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/teamtutorials.com\/web-development-tutorials\/professional-javascript-based-photo-viewer#primaryimage\"},\"datePublished\":\"2008-06-11T04:55:31+00:00\",\"dateModified\":\"2008-10-26T18:47:52+00:00\",\"author\":{\"@id\":\"https:\/\/teamtutorials.com\/#\/schema\/person\/eb38d967529dbe49f7cbe082fd39105b\"},\"description\":\"This tutorial will walk you through installing and configuring Lightbox 2. Lightbox allows you to show your pictures on your site in a whole new light. It gives you a sleek and professional look and is VERY easy to implement.\",\"breadcrumb\":{\"@id\":\"https:\/\/teamtutorials.com\/web-development-tutorials\/professional-javascript-based-photo-viewer#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/teamtutorials.com\/web-development-tutorials\/professional-javascript-based-photo-viewer\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/teamtutorials.com\/web-development-tutorials\/professional-javascript-based-photo-viewer#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/teamtutorials.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Professional Javascript Based Photo Viewer\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/teamtutorials.com\/#\/schema\/person\/eb38d967529dbe49f7cbe082fd39105b\",\"name\":\"Mike Maguire\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/teamtutorials.com\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/36f2aa9a11241ca79ed05e758e36f3cb?s=96&d=mm&r=r\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/36f2aa9a11241ca79ed05e758e36f3cb?s=96&d=mm&r=r\",\"caption\":\"Mike Maguire\"},\"sameAs\":[\"http:\/\/mikemaguire.me\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Professional Javascript Based Photo Viewer","description":"This tutorial will walk you through installing and configuring Lightbox 2. Lightbox allows you to show your pictures on your site in a whole new light. It gives you a sleek and professional look and is VERY easy to implement.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/teamtutorials.com\/web-development-tutorials\/professional-javascript-based-photo-viewer","twitter_misc":{"Written by":"Mike Maguire","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/teamtutorials.com\/#website","url":"https:\/\/teamtutorials.com\/","name":"Team Tutorials","description":"Learn something new today","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/teamtutorials.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/teamtutorials.com\/web-development-tutorials\/professional-javascript-based-photo-viewer#primaryimage","inLanguage":"en-US","url":"http:\/\/teamtutorials.com\/wp-content\/uploads\/2008\/06\/configuring_lightbox_01.jpg","contentUrl":"http:\/\/teamtutorials.com\/wp-content\/uploads\/2008\/06\/configuring_lightbox_01.jpg"},{"@type":"WebPage","@id":"https:\/\/teamtutorials.com\/web-development-tutorials\/professional-javascript-based-photo-viewer#webpage","url":"https:\/\/teamtutorials.com\/web-development-tutorials\/professional-javascript-based-photo-viewer","name":"Professional Javascript Based Photo Viewer","isPartOf":{"@id":"https:\/\/teamtutorials.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/teamtutorials.com\/web-development-tutorials\/professional-javascript-based-photo-viewer#primaryimage"},"datePublished":"2008-06-11T04:55:31+00:00","dateModified":"2008-10-26T18:47:52+00:00","author":{"@id":"https:\/\/teamtutorials.com\/#\/schema\/person\/eb38d967529dbe49f7cbe082fd39105b"},"description":"This tutorial will walk you through installing and configuring Lightbox 2. Lightbox allows you to show your pictures on your site in a whole new light. It gives you a sleek and professional look and is VERY easy to implement.","breadcrumb":{"@id":"https:\/\/teamtutorials.com\/web-development-tutorials\/professional-javascript-based-photo-viewer#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/teamtutorials.com\/web-development-tutorials\/professional-javascript-based-photo-viewer"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/teamtutorials.com\/web-development-tutorials\/professional-javascript-based-photo-viewer#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/teamtutorials.com\/"},{"@type":"ListItem","position":2,"name":"Professional Javascript Based Photo Viewer"}]},{"@type":"Person","@id":"https:\/\/teamtutorials.com\/#\/schema\/person\/eb38d967529dbe49f7cbe082fd39105b","name":"Mike Maguire","image":{"@type":"ImageObject","@id":"https:\/\/teamtutorials.com\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/36f2aa9a11241ca79ed05e758e36f3cb?s=96&d=mm&r=r","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/36f2aa9a11241ca79ed05e758e36f3cb?s=96&d=mm&r=r","caption":"Mike Maguire"},"sameAs":["http:\/\/mikemaguire.me"]}]}},"_links":{"self":[{"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/posts\/1555"}],"collection":[{"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/comments?post=1555"}],"version-history":[{"count":0,"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/posts\/1555\/revisions"}],"wp:attachment":[{"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/media?parent=1555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/categories?post=1555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/tags?post=1555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}