Saturday 11 May 2013

A little improvement for mobile readers

When i started this blog some years ago, Blogger wasn't offering the lightbox function to show large images.

I didn't really know Blogger specific coding rules and was a little afraid to implement my own css and javascript in the template. Instead, i choose to setup a page on my web server dedicated to show my photos at large size.
I wanted the most clean and simple design, so it just displays a black background with the image centered horizontally and vertically. The basic css code is automatically generated by a php script on the server according to the image sizes.

When Google included the lightbox in Blogger, i didn't want to edit all my old posts and decided to keep my own solution.

As far as i know, the blog displays nicely on mobile devices (tablets and phones) it just had a problem when users tried to open the large photos on with "small" screens.
As more and more people browse the internet with mobile tools i had to do something.

So, this morning i took a few time to add a little javascript to my system. It resizes and recenters the image according to its original sizes and to the display resolution.

No comments :

Related Posts Plugin for WordPress, Blogger...