某些移动端浏览器自带下拉功能,如腾讯x5浏览器下拉会出现浏览器及url信息,chrome浏览器下拉自带刷新,这些下拉功能在某些情况下会与自定义的下拉动作相冲突。

探索

开始考虑了一下,我觉得用event.preventDefault()会起作用,试了一下果然可以,但是浏览器的下拉功能是没有了,浏览器的scroll滚动条也跟着不起作用了。

解决

前面的preventDefault方法是只要触发事件就调用,如果能够在合适的时机调用preventDefault的话,那么既可以阻止浏览器的下拉功能,浏览器的滚动条也可以使用。
例如这次我写一个下拉刷新,只需要在下拉状态时调用touchmove的preventDefault,而不是下拉状态时不调用,那么就可以合理地阻止浏览器的下拉功能。

其他如阻止长按菜单同理

分类: 不太重要的

11 条评论

if g · 2020年6月21日 上午9:07

I believe everything said was actually very reasonable.
But, think about this, what if you were to write a awesome headline?
I am not saying your content isn’t solid., however what if you added a headline
that grabbed people’s attention? I mean 解决某些移动端浏览器下拉出现浏览器信息的问题 – 霜月秋风 is kinda
boring. You could look at Yahoo’s front page and watch how they
create article titles to get viewers to click. You might
add a video or a related pic or two to grab readers interested about
what you’ve got to say. In my opinion, it could bring your posts a little bit more interesting.

new g · 2020年6月21日 下午10:41

Hmm is anyone else encountering problems with the
images on this blog loading? I’m trying to figure out if its a problem
on my end or if it’s the blog. Any suggestions would be greatly appreciated.

journal.umpo.ac.id · 2020年6月26日 下午12:41

I am no longer sure the place you are getting your info,
however great topic. I must spend some time studying
more or figuring out more. Thank you for great information I used to be in search of this info for my mission.

http://tinyurl.com/ · 2020年6月26日 下午3:39

What’s up, its good piece of writing concerning media print,
we all be familiar with media is a impressive source of data.

http://www.forum-mecanique.net/ · 2020年6月26日 下午10:31

Hey! I know this is kinda off topic however I’d figured
I’d ask. Would you be interested in exchanging links or
maybe guest authoring a blog article or vice-versa?
My website addresses a lot of the same subjects as yours and I believe we could greatly benefit from each other.
If you might be interested feel free to send me an email.
I look forward to hearing from you! Awesome blog by the way!

http://viper.anarchygaming.uk/index.php?action=profile;u=892251 · 2020年6月27日 上午6:20

Thanks for finally writing about > 解决某些移动端浏览器下拉出现浏览器信息的问题 – 霜月秋风 < Loved it!

http://tinyurl.com/ · 2020年6月27日 上午9:59

Greetings from Ohio! I’m bored at work so I decided to check out your website
on my iphone during lunch break. I enjoy the information you provide here and can’t wait to take
a look when I get home. I’m shocked at how quick your blog loaded on my cell phone ..
I’m not even using WIFI, just 3G .. Anyways, amazing blog!

cbd oil that works 2020 · 2020年6月27日 下午5:48

This blog was… how do you say it? Relevant!! Finally I’ve found something which helped me.
Thanks a lot!

cbd oil that works 2020 · 2020年6月27日 下午9:50

Link exchange is nothing else but it is only placing the other
person’s webpage link on your page at appropriate place and other person will also do same in favor of you.

cbd oil that works 2020 · 2020年6月29日 上午5:51

Good day! I could have sworn I’ve been to this web site before but after looking at a
few of the posts I realized it’s new to me.
Anyhow, I’m certainly happy I came across it and I’ll be
book-marking it and checking back often!

cbd oil that works 2020 · 2020年6月29日 下午1:36

I’ve been browsing on-line greater than three hours lately, but I never found any attention-grabbing
article like yours. It is beautiful value sufficient for me.

In my view, if all website owners and bloggers made excellent content as you
probably did, the web will probably be a lot more helpful than ever before.

发表评论

电子邮件地址不会被公开。 必填项已用*标注