How to Remove Scrolling Previous / Next Blogger Post

In Blogger / Blogspot, mobile templates have a swipe function that you apparently can't turn off, and that will go to the previous / next post if you swipe left or right.

This is good and that’s it, but my message has a table, and the swipe function will not let me scroll horizontally. Some kind of slop.

Is there a way to disable scrolling?

+4
source share
2 answers

The Blogger engine will insert scripts at the end of the template, whether you want it or not in the mobile version. Since God knows how and when they are introduced, and if there is a way to prevent this, I find it too difficult to completely not load the scripts. But you can get them to do nothing with this simple hack.

Just add the following lines up </body>to the template.

<script>
    // hackiest thing in the universe so disable the stupid swiping from blogger
    document.getElementById('main').addEventListener = function() {}
</script>

On the minus side, you cannot add any events at all to id=main div. On the plus side, the scroll has disappeared because the Blogger script cannot add events touchstart, touchmoveand touchend. Hooray!

+2
source

OdraEncoded , Blog Matheus ProduΓ§Γ΅es Blogger , , , , id = .

<b:if cond='data:blog.isMobile'>
  <b:if cond='data:blog.pageType == &quot;item&quot;'>

    <script>
      // hackiest thing in the universe so disable the stupid swiping from blogger
      document.getElementById('main').addEventListener = function() {}
    </script>

  </b:if>
</b:if>
+2

Source: https://habr.com/ru/post/1669852/


All Articles