Languages

Menu
Sites
Language
Disable scrolling in Tizen Web app for Gear S

Hi,

I want to disable scrolling in my app for Gear S.
Unfortunately I couldn't find a method to prevent scrolling.

The following code disables scrolling but along with scrolling it prevents my buttons to work:


what else can I try ?

Responses

5 Replies
mekabe remain

The following code disables scrolling but along with scrolling it prevents my buttons to work:

 

$(document).bind("touchmove",function(event){
event.preventDefault();
});
 

daniel kim
<div class="ui-content content-padding">
      <ul class="ui-listview">
    <p>Hello! </p>
    <button type="button"  onclick="test()">test</button>
     <p>Hello! </p>
     <p>Hello! </p>
     <p>Hello! </p>
     <p>Hello! </p>
     <p>Hello! </p>
     <p>Hello! </p>
     <p>Hello! </p>
     <p>Hello! </p>
     <p>Hello! </p>             
     <p>Hello! </p>
   </ul>
   </ul>
</div>

<script>

function test() {
    alert("test");
}

document.addEventListener("touchmove", function(event){
 if(event.target.tagName != "BUTTON") {
  event.preventDefault();
 }
}, false);
</script>

Hi,

Wish above code will help you.

Regards

 

 

AVSukhov

Hello,

Using css: add "overflow: hidden" property.

Using js: prevent default behavior for touchmove event.

 

Palitsyna

Hello,

below link contains information about overflow property where you can find some examples : http://www.w3schools.com/cssref/pr_pos_overflow.asp

mekabe remain

thanks to all answers.

They helped me to find the solution.