问题
Hello i am creating a mobile app with jquery mobile, am working the panel that can slide from right to left, but i want to move a step further, instead of it sliding from right to left, i want it to slide from top down
how do i go about this
this what i have done
<div data-role="panel" id="menu" data-position="right" data-display="overlay" style="background-color: rgba(0,0,0,0.7);">
Close panel
this presently slides from the right to left, so i want to change it so it can slide from the top
回答1:
The jQuery Mobile Panel is created to slide from left or right, not from top / bottom.
See doc here about the position
: http://api.jquerymobile.com/panel/#option-position
positionType: String
Default: "left"
The side of the screen the panel appears on. Values can be "left" or "right".
It may be quite complicated/long to implement the top or bottom slide, as you will have to look to jQuery mobile source to see how the panel is handled.
You can find some people that looked at this question, for example:
- How do I use Jquery Mobile Slide Panel to slide up from the bottom?
- How to swipe top down JQuery mobile
Be careful with the fact that those solutions may not be compatible with your version if they are too old
来源:https://stackoverflow.com/questions/26061191/jquery-mobile-panel-slide-from-top-instead-from-right-and-left