最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - Web: solution for image rotate and zoom - Stack Overflow

matteradmin9PV0评论

I have a web page which displays a large image, for example a page from a magazine. I have no control over the image size or orientation. It's possible that the image may need to be rotated by the user to orient it correctly.

Are there any Javascript or Flash solutions that will allow someone to rotate and zoom a given image? Ideally I'd specify a single image and the dimensions to use when displaying it. If the image is larger than those dimensions, the user could zoom in and view a portion of the image in greater detail.

I have a web page which displays a large image, for example a page from a magazine. I have no control over the image size or orientation. It's possible that the image may need to be rotated by the user to orient it correctly.

Are there any Javascript or Flash solutions that will allow someone to rotate and zoom a given image? Ideally I'd specify a single image and the dimensions to use when displaying it. If the image is larger than those dimensions, the user could zoom in and view a portion of the image in greater detail.

Share Improve this question edited Apr 24, 2009 at 14:15 cgp 41.4k12 gold badges106 silver badges131 bronze badges asked Apr 24, 2009 at 13:52 Chris NChris N 6277 silver badges7 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

I've seen a couple of solutions for rotating images with straight Javascript and CSS. Raphael would do the trick. There is apparently even an example featuring rotating an image. (it uses SVG but is support on all major browsers)

This one is not cross browser, but is an interesting exercise nevertheless.

As for flash rotation etc...

For rotating images, I used jquery-rotate and it works very well.

It is not totally cross-browser, it doesn't work with IE6 (and probably other old browsers).

For zooming, I guess you could make your own implementation using javascript, you can just resize the image (easy with jQuery).

Post a comment

comment list (0)

  1. No comments so far