在移动 Safari 中仅缩放图像
我想看看是否有人有这方面的经验。我首先是一名开发人员,其次是一名设计师,所以这确实不是我的最强项。
我正在做一个项目,目标是在 iPhone 上以横向模式并排显示图像和文本。我希望能够像平常一样使用捏合来放大图像,但在发生这种情况时也不能放大文本。我不知道这是否可能,也不知道需要什么样的技巧才能使其发挥作用。
如果有人认为从 UI 角度来看这总体上很糟糕,我愿意接受建议。
我考虑过保留图像的两个副本(低分辨率和高分辨率),然后使用 overflow:scroll;
将它们交换到 div 内部,以便用户可以获得缩放版本,然后滚动。它不会为您提供缩放的全部效果,但它可能会实现类似的目标。我也不知道这是否有效。
如果有人对此主题有建议或经验,请加入。谢谢!
I'm looking to see if anyone has experience with this. I'm a developer first and a designer second, so this is really not my strongest suit.
I have a project I'm working on where the goal is to get image and text side-by-side in landscape mode on the iPhone. I'd like to be able to zoom in on the image using a pinch like normal, but not zoom in on the text as well while that is happening. I don't know if this is even possible or what kind of hacks it would take to get it working.
If someone thinks this is bad in general from a UI perspective, I am open to suggestions.
I have considered keeping two copies of the image (low and high res) and then swapping them out inside of div with an overflow: scroll;
so users can get a zoomed version and then scroll around. It doesn't give you the full effect of zooming, but it might accomplish a similar goal. I don't know if this would work either.
If anyone has suggestions or experience on the subject, please chime in. Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要在移动 Safari 中执行此操作,您可能必须使用 JavaScript。这里有一个 jQuery 插件: http://plugins.jquery.com/project/pinch
可能是一些帮助
To do this in mobile safari you would probably have to use javascript. Theres a jQuery plugin here: http://plugins.jquery.com/project/pinch
Might be of some help
如果您想使用 Mobile Safari,那么您将需要像 jTouch 这样的触摸框架来简化事情。
本质上,您应该将图像和文本放入 UIScrollView 中,并将 viewForZoomingInScrollView: (在滚动视图的委托中)中的图像视图返回到图像视图。
这就是你想要的吗?
If you want to use Mobile Safari, then you will need a touch framework like jTouch to simplify things.
Natively, you should put your image and text inside a UIScrollView, and return the image view in the the viewForZoomingInScrollView: (in the scroll view's delegates) to the image view.
Is that what you want?