css - Why Parallax effect doesn't work on mobile devices? -


i working laravel 5.4 application having parallax effect main background. works fine on desktop, , works perfect on varied screen size through developer tool, when same page accessed via mobile device, parallax effect doesn't show up. have added block of code responsible needed effect.

#promo {     min-height: 25em;     width: 100%;     position: relative;     z-index: 0; } <body> <section id="promo" style="background: url({{$mainimg->path}}) 50% 0px repeat fixed; background-size:cover;"> </section> </body> 

the background position fixed doesnt work on mobile devices fix this, need simple trick, rather giving section background image , make fix, try make section:before , set position:fixed; , give backgroung image it.

#promo:before{ position:fixed; width:100%; height:100%; left:0; top:0; background:url('image.jpg'); } 

play z-index , here go. try , let me know.


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -