Here you go. Using jQuery. The IMG tag is set as a background image using position:absolute; z-indez:0; position:absolute; z-indez:0; . When you resize the window, the image will resize accordingly. Cross browser compatible.
$(window).resize(function(){ var bgwidth = $(window).width(), bgheight= $(window).height(); $('img').attr({width:bgwidth, height:bgheight}); })
Hussein
source share