开发者

Is there a way to define a min-width on a jquery mobile website?

I would like to define a min-width on a开发者_运维问答 page of a jquery mobile website but it seems not working. Am I wrong? Something like if the page width if less than 200px then place an horizontal scrollbar.

Thanks.


Hmm not sure about other smart phones but the iPhone (older models) are 320 x 480. I really don't think there is a 200px width on a smartphone, but I could be way off on this as well.

Supported Browsers: http://jquerymobile.com/gbs/

Also you could run media queries or add a breakpoint: http://jquerymobile.com/demos/1.0a4.1/#docs/api/mediahelpers.html

To utilize width breakpoints of your own, jQuery Mobile exposes the $.mobile.addResolutionBreakpoints function, which accepts either a single number or array of numbers that will be added to the min/max breakpoints whenever they apply.

//add a min/max class for 1200 pixel widths         
$.mobile.addResolutionBreakpoints(1200);

//add min/max classes for 1200, and 1440 pixel widths           
$.mobile.addResolutionBreakpoints([1200, 1440]);


min-width is working in most modern mobile browsers. What is not available there are horizontal and vertical scrollbars - no such thing in principle.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜