Sitecore has never had this functionality out of the box. Because Sitecore is a server based component, it never knows what the view port size of the user is, unless that information is specifically sent via JavaScript.
There are a few main ways of doing responsive images:
You can let the CSS handle all the resizing. This has the benefit of being simple, no extra js processing, the image is always downloaded with the page. But it also means that you have to supply an image that is max size. So for most people, they will be downloading too much.
Use JavaScript to do it. Have urls to multiple sizes of the image, and use media queries to swap images in and out based on certain break points. I have used this module for that before http://xoxco.com/projects/code/breakpoints/
You would set the image up like this:
<img data-responsive="true"
data-small-url="@(imageUrl)?w=100"
data-medium="@(imageUrl)?w=200"
data-large="@(imageUrl)?w=300" />
Then setup your js like:
$(window).setBreakpoints({
breakpoints: [
480,
768,
1024
]
});
$(window).bind('enterBreakpoint480',function() {
var $img = $('img[data-responsive="true"]');
$img.attr("src", $img.data("smallUrl"));
});
$(window).bind('enterBreakpoint768',function() {
var $img = $('img[data-responsive="true"]');
$img.attr("src", $img.data("mediumUrl"));
});
$(window).bind('enterBreakpoint1024',function() {
var $img = $('img[data-responsive="true"]');
$img.attr("src", $img.data("largeUrl"));
});
Thats very rough and untested code, but should give you the basic idea. There are probably plugins that would do it for you also if you didn't want to write your own script.
- There is a third option that uses some of the newer tags, but browser support would be limited for those. Here is a good article on that option: http://blog.navigationarts.com/responsive-image-sizing-with-html5-and-sitecore/