I need to display an image in a fixed size div.
Under the div must be some control, like a cursor bar, which sets the resolution of the displayed image.
I don’t mind much writing the thing, but I thought it might already exist. How come I can’t find such a thing ?
(I am not interested in things like jQZoom nor zoomimage which do not let the user choose dynamically the display resolution.)
As this question has now been seen more than 1k times, I add my solution to it. Feel free to copy and adapt.
The solution involves jQuery UI slider plugin. Mainly we create a div with fixed size, overflow:scroll, containing a img tag, and we add a slider under it. The slider ‘change’ event is bound to a rescale of the img@width/@height attributes.
Here is an excerpt of what we did :
HTML
JS