Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
68
rated 0 times [  72] [ 4]  / answers: 1 / hits: 39450  / 11 Years ago, thu, may 16, 2013, 12:00:00

I am working on Tizen and making web app.




I have a div in html5 and I set and image as background on this div. Now i have some scenario in which I have to show some random text in this div multiple times. It is no guaranteed that text always be the same size. My image size is 300 width and 90 height.



Now I want to set my div scroll in up and down direction through javascript whenever my text is larger. I tried scrollTop, overflow: auto/scroll but its not working.



Actually I can see result on HTML view in eclipse but when I run my code on device its not showing any scrollbars. Any help would be appreciated .




Here is my code in which I have a div named textView:




  <div id=textView style=height: 90px; width: 300px;  
margin-left: 20px; margin-top: 20px;overflow: auto;>
</div>



And in javascript:




  var elem = document.getElementById(textView);

elem.scrollTop=80px;

elem.innerHTML=llllllllllllllllllllllllllllllllllllllllll+'<br/>'
+llllllllllllllllllllllllllllllllllllllllllll+'<br/>'
+llllllllllllllllllllllllllllllllllllllllllll+'</br>'
+llllllllllllllllllllllllllllllllllllllllllll+'<br/>';
elem.style.color = White;

elem.style.fontSize = 50px;



I want to show text in image bounds not out of bounds of image.



More From » html

 Answers
23

I believe id you style it to overflow:scroll that should take care of it.



EDIT:



Look at setting overflow-x:hidden and overflow-y:auto



YET ANOTHER EDIT:
Perhaps this: https://developer.tizen.org/help/index.jsp?topic=%2Forg.tizen.web.appprogramming%2Fhtml%2Fguide%2Fui_guide%2Fui_framework_scrollview.htm


[#78203] Tuesday, May 14, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
gideons

Total Points: 197
Total Questions: 106
Total Answers: 108

Location: Moldova
Member since Sat, Jan 29, 2022
2 Years ago
;