Sunday, September 3, 2017

Wordpress Twenty Seventeen Front Page sections scroll effect not working on mobile

Leave a Comment

I have a wordpress site and using Twenty Seventeen theme, I like the scrolling feature on the Front Page Sections, just like in this demo:

https://2017.wordpress.net/

Now I am trying to get that scrolling feature to work on mobile, however when I look at the CSS I found this

.background-fixed .panel-image {
        background-attachment: fixed; } 

But I know background-attachment does not work very well on mobile. Does anyone know of a work around, everything I have found and tried online does not work.

3 Answers

Answers 1

You need to write above css in your style.css file. we have to set background image fixed not a scroll.

.panel-image {    background-attachment: fixed; } 

Answers 2

To make background scroll set the background attachment property to fixed

.background-fixed .panel-image {    background-attachment: fixed;  } 

To make it work on mobile you have to place above CSS in media query or copy paste the below code in your style.css

@media screen and (max-width: 768px){ .background-fixed .panel-image {    background-attachment: fixed;  } }  

Answers 3

Is not working on mobile because the theme only enabled this on desktop. To work on mobile, add this custom css:

.background-fixed .panel-image {     background-attachment: fixed; } 

This way, on every breakpoint the effect will be applied

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment