News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Responsive Images Using Picturefill and PHP
October 10, 2013 @ 10:08:11

On the SitePoint PHP blog there's a new post from Lukas White showing you how to use the Picturefill plugin (Javascript) along with PHP to make responsive images.

One of the key challenges with responsive web design, and a subject of much discussion in recent years, is how to deal with images. Setting a max-width on image elements enables designers to allow their size to adapt to the page dimensions, but in itself that approach can lead to far bigger images being downloaded than are required. [...] You can use a similar approach [to "source sets" of images] straight away and in a cross-browser compatible manner by using Javascript; one such method is the Picturefill plugin. In essence, Picturefill allows you to specify different src attributes for an image, each image file corresponding to a different media query. Thus

The tutorial helps you create an application, powered by the Slim framework and the ImageMagick extension, for the basic structure. He then grabs the Picturefill library and drops them into place. Some sample code is also included showing how to create the HTML structure for the images and the Javascript to handle the switching.

0 comments voice your opinion now!
responsive image picturefill tutorial resolution source set

Link: http://www.sitepoint.com/responsive-images-using-picturefill-php/

blog comments powered by Disqus

Similar Posts

Matthew Weir O'Phinney's Blog: Overloading arrays in PHP 5.2.0

MaltBlue.com: Easy Setter Injection in Zend Framework 2

IBM developerWorks: Ajax and XML: Ajax for chat

Enavu.com: PHP Smart Date Parsing: Natural Language Input (task.fm explained)

HowTo Forge: Fedora 8 Server Setup - LAMP, Email, DNS, FTP, ISPConfig - Page 6


Community Events











Don't see your event here?
Let us know!


podcast database composer introduction release hhvm symfony2 opinion security framework performance application install language component unittest facebook hack package series

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework