I want to show part of an image, and scale the part of the image I show (either larger or smaller) within a webpage. It's really easy to show part of an image using css, for example:
$("#myDiv").css({
width: 100,
height: 100,
background: "url('myurl.jpg')",
backgroundPosition: "-100px -100px"
});
This pulls in the image at url "myurl.jpg", and displays a box 100 px square, at position 100,100 of that image: so all you see of myurl.jpg is that little box. However, I want to make this box bigger or smaller inside my webpage, say scaling it 50 px square. I can see lots of ways of scaling the background image, while showing it all. (eg, the very neat backstretch plugin (http://srobbin.com/jquery-plugins/backstretch/). But I don't see readily how to extract and scale at the same time.
Ideas please! (I am working in JQueryMobile so the answer needs to work there)