{"id":728,"date":"2008-07-31T15:06:51","date_gmt":"2008-07-31T07:06:51","guid":{"rendered":"http:\/\/www.nargalzius.com\/blog2\/http:\/www.nargalzius.com\/blog2\/archives\/2008\/07\/2008_07_31_1506.php"},"modified":"2008-07-31T15:06:51","modified_gmt":"2008-07-31T07:06:51","slug":"zoom-just-one-look","status":"publish","type":"post","link":"http:\/\/nargalzius.com\/blog\/archives\/2008\/07\/31\/zoom-just-one-look","title":{"rendered":"Zoom, just one look&#8230;"},"content":{"rendered":"<p><em>&#8230; and then my heart went boom!<\/em><\/p>\n<p>Remember that song? Well, it doesn&#8217;t really have anything to do with this post apart from the reference of the word &#8220;zoom.&#8221; (and personally, my heart <em>did<\/em> go &#8220;boom&#8221; when I saw the awesomeness of what I&#8217;m about to discuss).<\/p>\n<p>I&#8217;ve implemented a new &#8220;lightboxing&#8221; system in my site using the <a href=\"http:\/\/www.cabel.name\/2008\/02\/fancyzoom-10.html\" title=\"what is FancyZoom?\">FancyZoom<\/a> script.<\/p>\n<p>For the uninitiated, a the term <em>lightbox<\/em> has its etymology rooted in photography, but sufficed to say, in &#8220;internet&#8221; lingo, it&#8217;s a script which is commonly used for toggling image magnification <em>without<\/em> having to leave the current page. I&#8217;ve been using it in my site almost every time I use a thumbnail (which will be demonstrated in a while). For a quick sample though, click <a href=\"http:\/\/farm4.static.flickr.com\/3245\/2708109605_b82452e186.jpg\">right here.<\/a><\/p>\n<p>Oh and if you&#8217;re reading this via <code>RSS<\/code> reader, I&#8217;d suggest you visit the actual page for this entry, else none of this will work.<\/p>\n<!--more-->\n<p>Enough of the introductions, most of you know what it is, and for those who <em>do<\/em> you know that the earlier lightbox system I had was a modified version of the popular <a href=\"http:\/\/www.cabel.name\/2008\/02\/fancyzoom-10.html\" title=\"what is FancyZoom?\"><em>Lightbox JS<\/em><\/a> by Lokesh Dhakar. I&#8217;ve switched over to <a href=\"http:\/\/www.cabel.name\/2008\/02\/fancyzoom-10.html\" title=\"what is FancyZoom?\">FancyZoom<\/a> by Cabel Maxfield Sasser &#8211; a <a href=\"http:\/\/www.panic.com\" title=\"what is Panic?\">Panic<\/a> employee. I noticed the script while viewing the screenshots of their <a href=\"http:\/\/www.panic.com\/transmit\" title=\"visit\">products<\/a> and thought this was even more elegant (and simple) than what I had in place.<\/p>\n<p>So basically what it does is instead of the darkening of the background and showing the bigger picture, it actually <em>zooms<\/em> the picture out from the source (text or thumbnail) and into full view (and back) &#8211; and that&#8217;s just awesome. It also automatically parses all <code>href<\/code>s that point to images in the page&#8230; unlike the older method which required a <code>rel<\/code> tag to flag something as a lightbox element. This means that upon implementing the script, it immediately was reflected in all pages of my site which had such links (including all previously &#8220;lightboxed&#8221; elements). Quite literally plug and play.<\/p>\n<p>It was even easier to implement the <a href=\"http:\/\/www.nargalzius.com\/blog\/archives\/2006\/07\/2006_07_13_1001.php\" title=\"read old post\">regex hack<\/a> I did before. But that didn&#8217;t mean I didn&#8217;t have my share of issues.<\/p>\n<h1>Concerns: It&#8217;s not a bug, but&#8230;<\/h1>\n<p>One major concern I had was that it was very picky with whitespace, so while it would interpret code like this just fine:<\/p>\n<pre><code>&lt;a href=\"IMAGE_FULLSIZE_URL\"&gt;&lt;src=\"IMAGE_THUMBNAIL_URL\" \/&gt;&lt;\/a&gt;<\/code><\/pre>\n<p>But would have certain issues when done this way:<\/p>\n<pre><code>&lt;a href=\"IMAGE_FULLSIZE_URL\"&gt;\n&lt;src=\"IMAGE_THUMBNAIL_URL\" \/&gt;\n&lt;\/a&gt;<\/code><\/pre>\n<p>To demonstrate, here are some images of my cool new shades, spread apart, and lightboxed using the first method:<\/p>\n<p><a href=\"http:\/\/farm4.static.flickr.com\/3092\/2667420192_7c4a129377_o.jpg\" target=\"_blank\" title=\"You may click on the image for more details\"><img decoding=\"async\" alt=\"\" src=\"http:\/\/farm4.static.flickr.com\/3092\/2667420192_cfa3cd49e1_t.jpg\" align=\"right\" \/><\/a><\/p>\n<p><a href=\"http:\/\/farm4.static.flickr.com\/3119\/2666596891_7b17a03ff3_o.jpg\" target=\"_blank\" title=\"You may click on the image for more details\"><img decoding=\"async\" alt=\"\" src=\"http:\/\/farm4.static.flickr.com\/3119\/2666596891_fa8b3b3c0e_t.jpg\" \/><\/a><\/p>\n<p>Notice how the zoom starts exactly where they are, and start at the minimized size&#8230; meaning it works <strong>perfectly.<\/strong><\/p>\n<p>But let&#8217;s try it the second way:<\/p>\n<p><a href=\"http:\/\/farm4.static.flickr.com\/3036\/2666598049_a84e50cd1c_o.jpg\" target=\"_blank\"><\/p>\n<img decoding=\"async\" src=\"http:\/\/farm4.static.flickr.com\/3036\/2666598049_2eb65d9973_t.jpg\" align=\"right\" \/>\n<p><\/a><\/p>\n<p><a href=\"http:\/\/farm4.static.flickr.com\/3004\/2667419034_652a655fde_o.jpg\" target=\"_blank\"><\/p>\n<img decoding=\"async\" src=\"http:\/\/farm4.static.flickr.com\/3004\/2667419034_b100cbf226_t.jpg\" \/>\n<p><\/a><\/p>\n<p>Notice that the one on the right is still zooming from the left! There&#8217;s also a nuance that you&#8217;ll probably not see with a thumbnail this size, but it doesn&#8217;t zoom from the right source dimensions as well! Consider the identical thumbnails below:<\/p>\n<div align=\"center\">\n<a href=\"http:\/\/farm4.static.flickr.com\/3261\/2666597379_243bc04f82_o.jpg\" target=\"_blank\">\n<img decoding=\"async\" src=\"http:\/\/farm4.static.flickr.com\/3261\/2666597379_582b47cbdf_m.jpg\">\n<\/a>\n<a href=\"http:\/\/farm4.static.flickr.com\/3261\/2666597379_243bc04f82_o.jpg\" target=\"_blank\"><img decoding=\"async\" src=\"http:\/\/farm4.static.flickr.com\/3261\/2666597379_582b47cbdf_m.jpg\"><\/a>\n<\/div>\n<p>Did you see where the left was zooming from &#8211; also the width and height it started out from? The lower bottom portion and much smaller than the thumbnail. The way it <em>should<\/em> be zooming like is the one on the right (which uses the first method)<\/p>\n<p>So there, it&#8217;s not really a bug, but because of that nuance, I had to edit all my entries since <strong>July 2006;<\/strong> the first time I started using lightboxes. I&#8217;m sure there are other entries before that, but they&#8217;re not a priority \ud83d\ude09<\/p>\n<p>Best of all, it even works on the iPhone!<\/p>","protected":false},"excerpt":{"rendered":"<p>&#8230; and then my heart went boom! Remember that song? Well, it doesn&#8217;t really have anything to do with this post apart from the reference of the word &#8220;zoom.&#8221; (and personally, my heart did go &#8220;boom&#8221; when I saw the awesomeness of what I&#8217;m about to discuss). I&#8217;ve implemented a new &#8220;lightboxing&#8221; system in my &hellip; <p class=\"link-more\"><a href=\"http:\/\/nargalzius.com\/blog\/archives\/2008\/07\/31\/zoom-just-one-look\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Zoom, just one look&#8230;&#8221;<\/span><\/a><\/p><\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[4,5,9,13],"tags":[420,694,1333],"class_list":["post-728","post","type-post","status-publish","format-standard","hentry","category-general","category-internet","category-nargalzius","category-technology","tag-fancyzoom","tag-lightbox","tag-zoom"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"http:\/\/nargalzius.com\/blog\/wp-json\/wp\/v2\/posts\/728","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/nargalzius.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/nargalzius.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/nargalzius.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/nargalzius.com\/blog\/wp-json\/wp\/v2\/comments?post=728"}],"version-history":[{"count":0,"href":"http:\/\/nargalzius.com\/blog\/wp-json\/wp\/v2\/posts\/728\/revisions"}],"wp:attachment":[{"href":"http:\/\/nargalzius.com\/blog\/wp-json\/wp\/v2\/media?parent=728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/nargalzius.com\/blog\/wp-json\/wp\/v2\/categories?post=728"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/nargalzius.com\/blog\/wp-json\/wp\/v2\/tags?post=728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}