Highlighted

Preventing the pull-to-refresh effect?

Explorer ,
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?

Most Valuable Participant
Correct answer by Ussnorway | Most Valuable Participant

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

Screenshot (13).png

Screenshot (14).png

Views

925

Likes

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

Preventing the pull-to-refresh effect?

Explorer ,
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?

Most Valuable Participant
Correct answer by Ussnorway | Most Valuable Participant

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

Screenshot (13).png

Screenshot (14).png

Views

926

Likes

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
May 18, 2017 0
Most Valuable Participant ,
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

Likes

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
Reply
Loading...
May 18, 2017 1
Explorer ,
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.

Likes

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
Reply
Loading...
May 19, 2017 0
Most Valuable Participant ,
May 19, 2017

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
May 19, 2017 0