jQuery Mobile:对话框弹出滚动
我正在使用 jQuery Mobile 框架开发一个手机网站,该网站上有一些图像,我想在 Dialog 控件中以更大的格式打开。
我有一个页面设置,可以处理加载图像,其中图像位于溢出=自动的 div 中。它适用于桌面浏览器(Chrome),如果我缩小窗口,对话框内部会有图像滚动条。但它在我手机的浏览器(Android,即 Chrome 浏览器)上不起作用。 div 不想滚动。除了缩小图像之外,还有什么方法可以避免这个问题吗?
这是图像页面的代码:
<div data-role="dialog">
<div data-role="header" data-theme="d" data-position="inline">
<h1><%= ViewData["ImageTitle"] %></h1>
</div>
<div data-role="content" data-theme="c">
<div style="overflow:auto;">
<img alt="<%= ViewData["ImageAlt"] %>"
src="<%= ViewData["ImageUrl"] %>" />
</div>
</div>
</div>
I'm using the jQuery Mobile Framework to develop a website for phones, and there are some images on the site that I want to open up in a larger format in the Dialog control.
I have a page setup that handles loading the image where the image is in a div with overflow=auto. It works on a desktop browser (Chrome), where if I shrink the window down, the dialog has scroll bars internally for the image. It doesn't work however on my phone's browser (Android, so Chrome browser). The div doesn't want to scroll. Is there any way I can circumvent this, aside from shrinking the image down?
Here's the code for the image page:
<div data-role="dialog">
<div data-role="header" data-theme="d" data-position="inline">
<h1><%= ViewData["ImageTitle"] %></h1>
</div>
<div data-role="content" data-theme="c">
<div style="overflow:auto;">
<img alt="<%= ViewData["ImageAlt"] %>"
src="<%= ViewData["ImageUrl"] %>" />
</div>
</div>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如何在 CSS 溢出时获取滚动条iOS
How to get the scroll bar with CSS overflow on iOS
听起来你想要一个“灯箱”类型的插件。看看这个:最好的基于 jquery 的灯箱/弹出对话框?
或者
http://www.designyourway.net/blog/resources /30-efficient-jquery-lightbox-plugins/
很确定这些插件在移动环境中应该可以正常工作。
Sounds like you want a "lightbox" type of plugin. Check this out: best jquery-based lightbox / popup dialogbox?
or
http://www.designyourway.net/blog/resources/30-efficient-jquery-lightbox-plugins/
Pretty sure these plugins should work just fine in a mobile environment.