• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Preventing the pull-to-refresh effect?

Explorer ,
May 18, 2017 May 18, 2017

Copy link to clipboard

Copied

This is only a problem on an andriod device in chrome.

ok I made a long scrolling website design and scrolling up or down works great but if I click on an anchor that takes me down the page and then I manually scroll back to the top, if i scroll to far past the top of the page chrome does this "pull to refresh" function. This wouldn't be a problem if it just refreshed at the top of the page but its refreshing back to the last anchor I used at the bottom of the page. The end result is if i scroll past the top of the page accidentally it jumps down to the last anchor I used.

I found this article but if i knew how to write code i probably wouldn't be using muse.

html - Disabling android's chrome pull-down-to-refresh feature - Stack Overflow

at the bottom of the article is this code

$("html").css({
  
"touch-action": "pan-down"
});

Where does this code go? in a javascript file ? or a css file?

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , May 18, 2017 May 18, 2017

you can have it in an iframe, page or site... most designs work best with a page

Screenshot (13).png

Screenshot (14).png

Votes

Translate

Translate
LEGEND ,
May 18, 2017 May 18, 2017

Copy link to clipboard

Copied

you can have it in an iframe, page or site... most designs work best with a page

Screenshot (13).png

Screenshot (14).png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 19, 2017 May 19, 2017

Copy link to clipboard

Copied

I put it in there but it's not working. isn't code with a $ go into a javascript file? this put it in the index.html head.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 19, 2017 May 19, 2017

Copy link to clipboard

Copied

LATEST

productionArtistChad  wrote

I put it in there but it's not working.

your question was where does this code go... not would it work in your site.

productionArtistChad  wrote

isn't code with a $ go into a javascript file?

no a $ tells the browser that this IS code... it is added to whatever javascript the browser is using but it not placed inside it and some browsers will ignore code addons because they are not trusted

productionArtistChad  wrote

this put it in the index.html head.

the code says add this (css codes) when this (html = page) is rendored;

  • if you put it in your site propreties it will load on every page of your site,
  • if you load it into the home page propreties it will only load on the home | index page and
  • if you put it in an iframe or div then it will only load in that element

moving forward, there is a code sub-group in the Dreamwever forum and  I recommend you ask your code questions there as those guys have forgotten more about javascript etc than most people ever learn

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines