简体   繁体   English

如何在触摸时上下滑动div?

[英]How to slide up/down div on touch?

I'm creating a website where I want a div box at bottom of the page which is just a little exposed with a title of what it has inside it like say 'More about this place' and that contains options like nearby places, ratings, reviews, etc but that is not exposed and is inside the div container.. 我正在创建一个网站,我希望在页面底部有一个div框,该框略微露出其内部标题,例如说“关于这个地方的更多信息”,并包含附近的地方,评分,评论等,但未公开且位于div容器内。

I want that box to slide out from bottom to top when someone selects(holds) that and swipe up! 当有人选择并按住该框并向上滑动时,我希望该框从底部滑到顶部!

And hide again back to it position when someone swipes that down. 然后当有人向下滑动时再次隐藏回原位。

How can I achieve this with Js/jQuery, css, html? 如何使用Js / jQuery,css,html实现此目标? Please help me with the code or the working behind it! 请帮助我代码或它背后的工作!

Reference: Similar like the "Explore Nearby" box of Google Map App! 参考:类似于Google Map App的“探索附近”框!

如果您不希望依赖第三方解决方案,则可以尝试使用Hammer.JS之类的库,或查看此答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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