overflow:auto not working in touch devices(iOS)

2019-02-12 18:08发布

问题:

I have implemented a website using twitter bootstrap. At the top of the site I have used a nav bar, and inside that used a dropdown menu. The dropdown menu is made up of < ul > and < li > tags. I am showing a list of members inside that dropdwon menu. When the list of member grows the dropdown menu grows horizontally, for which I have added a overflow: auto to the dropdown-menu class. Now its showing an vertical scroll bar, and working fine in browser.

But the same thing is not working in iPad and other iOs devices. I have googled it and found -webkit-overflow-scrolling: touch should work. But it is not working for me. Lot of other solutions are also present, but unfortunately not working for me.

Is there any better solution available. May be anything we can do using css itself.

回答1:

Add the css property in to your div tag -webkit-overflow-scrolling: touch