언어 설정

Menu
Sites
Language
Scrolling the listview with rotary bezel

I am having problems with what seems to be an easy task. I want to scroll an UL list with the rotary bezel. Here is my code:

 


<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width,user-scalable=no">
	<title>Circular UI</title>
	<link rel="stylesheet" href="lib/tau/wearable/theme/default/tau.min.css">
	<link rel="stylesheet" media="all and (-tizen-geometric-shape: circle)" href="lib/tau/wearable/theme/default/tau.circle.min.css">
</head>
<body>
	<div class="ui-page ui-page-active" id="main">
		<header class="ui-header">
			<h2 class="ui-title">TAU List</h2>
		</header>
		<div class="ui-content">
			<ul id="lv" class="ui-listview">
				<li><a href="#">List1</a></li>
				<li><a href="#">List2</a></li>
				<li><a href="#">List3</a></li>
				<li><a href="#">List4</a></li>
				<li><a href="#">List5</a></li>
				<li><a href="#">List6</a></li>
				<li><a href="#">List7</a></li>
				<li><a href="#">List8</a></li>
				<li><a href="#">List9</a></li>
				<li><a href="#">List10</a></li>
			</ul>
		</div>
	</div>
	<script type="text/javascript" src="lib/tau/wearable/js/tau.min.js"></script>
	<script src="app.js"></script>
</body>
</html>

app.js

( function () {
		
	document.addEventListener("rotarydetent", function(event) {
		
		if (event.detail.direction === "CW") {
			
			console.log("CW");
			document.getElementById('lv').scrollTop += 25;
			
		} else if (event.detail.direction === "CCW") {
			
			console.log("CCW");
			document.getElementById('lv').scrollTop -= 25;

		}
	}, false);
} () );

 

This does not work. Events get triggered, but the list doesn't move. Changing the scrollTop property has no effect.

Could anybody help me? You can try reproducing this issue quickly by pasting the code in a sample project.

 

Thank you,

Responses

4 댓글
colin Rao

try to console.log() the scrollTop value after you change its vaule. 

and try once more 

document.getElementById('lv').style.scrollTop += 25;

 

Maciej

Hello

The scrollTop property value is always 0, before and after the change. Both for the UL list and for the containing div (I tried both).

daniel kim

Hi,

If you create your project using below template, the list scrolling by bezel is supported as a default behavior.

  wearable-2.3.1-->Wearable UI --> List

 Regards

Maciej

Hello

I know that, but I don't want to use the Snaplist that is used in the template project. I want to use my own list and handle scrolling manually.

I have found a topic and a bug report:

https://developer.tizen.org/forums/web-application-development/scrolltop
https://bugs.tizen.org/jira/browse/TWEB-112

 

It's from 2.5 years ago... it is possible that it still hasn't been fixed? It would be quite shocking actually:)