简体   繁体   中英

jQuery Mobile: Dialog popup scrolling

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>

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM