Software Archive
Read-only legacy content
17061 Discussions

Prevent Mainpage Scroll

Marco_S_
Beginner
699 Views

Hi all,

I'm looking for a method to prevent scroll on mainpage of my app.

I tried with:

mainpage.addEventListener('touchmove', function(e){
        e.preventDefault() // prevent scrolling when inside DIV
        }, false);

without success. Can anyone help me?

Thanks in advance.

Marco

0 Kudos
5 Replies
Amrita_C_Intel
Employee
699 Views

Hi,

If you are trying to prevent scrolling  in the entire app. Include this in your config.xml

 <preference name="DisallowOverscroll" value="true"/

Or if you want to prevent scrolling in just a section then try this

 

<div id="#pagetitle" title="Yourtitle" class="panel" style="overflow:hidden;">
0 Kudos
Marco_S_
Beginner
699 Views

Solved! Thank you very much Amrita!

0 Kudos
Marco_S_
Beginner
699 Views

Hi all,

  I solved only for iPhone App, for Android the behavoiur is different. Building Android App with style="overflow:hidden;" I have no scroll for every tab.

Anyway I have an app like Tab View App in Layout Template of XDK. I need to avoid the scrolling only for some tab not for all.

Thanks for help in advance

Mark

 

0 Kudos
Amrita_C_Intel
Employee
699 Views

I am glad it worked for you!

0 Kudos
Marco_S_
Beginner
699 Views

No, unfortunately not! It worked partially!

The problem persist, I don't know how to, with a TabView app, block the scroll only for some tab, not for all.

 

0 Kudos
Reply