Guest User

Untitled

a guest
Aug 16th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. var thumbs = [];
  2. thumbs[0] = {image: './pages/thumbs/images/parijs.png', name: '0'};
  3. thumbs[1] = {image: './pages/thumbs/images/woonboot.png', name: '1'};
  4. thumbs[2] = {image: './pages/thumbs/images/egypte.png', name: '2'};
  5. thumbs[3] = {image: './pages/thumbs/images/pichu.png', name: '3'};
  6. thumbs[4] = {image: './pages/thumbs/images/londen.png', name: '4'};
  7. thumbs[5] = {image: './pages/thumbs/images/myanmar.png', name: '5'};
  8. thumbs[6] = {image: './pages/thumbs/images/athene.png', name: '6'};
  9. thumbs[7] = {image: './pages/thumbs/images/thailand.png', name: '7'};
  10. thumbs[8] = {image: './pages/thumbs/images/china.png', name: '8'};
  11. thumbs[9] = {image: './pages/thumbs/images/india.png', name: '9'};
  12. thumbs[10] = {image: './pages/thumbs/images/antartica.png', name: '10'};
  13. thumbs[11] = {image: './pages/thumbs/images/moskou.png', name: '11'};
  14. thumbs[12] = {image: './pages/thumbs/images/rome.png', name: '12'};
  15. thumbs[13] = {image: './pages/thumbs/images/barcelona.png', name: '13'};
  16. thumbs[14] = {image: './pages/thumbs/images/sydney.png', name: '14'};
  17. thumbs[15] = {image: './pages/thumbs/images/turkije.png', name: '15'};
  18. thumbs[16] = {image: './pages/thumbs/images/dubai.png', name: '16'};
  19. thumbs[17] = {image: './pages/thumbs/images/duitsland.png', name: '17'};
  20. thumbs[18] = {image: './pages/thumbs/images/sahara.png', name: '18'};
  21. thumbs[19] = {image: './pages/thumbs/images/amerika.png', name: '19'};
  22. thumbs[20] = {image: './pages/thumbs/images/scandinavie.png', name: '20'};
  23. thumbs[21] = {image: './pages/thumbs/images/holland.png', name: '21'};
  24. thumbs[22] = {image: './pages/thumbs/images/italie.png', name: '22'};
  25.  
  26.  
  27. var win1 = Titanium.UI.createWindow({
  28. backgroundImage: pages[0],
  29.  
  30. orientationModes : [
  31. Titanium.UI.LANDSCAPE_LEFT,
  32. Titanium.UI.LANDSCAPE_RIGHT
  33. ]
  34. });
  35.  
  36. var pageBut = Titanium.UI.createImageView({
  37. image: "./UIelements/pageBut.png",
  38. width: 56,
  39. height: 46,
  40. bottom: 0,
  41. left: 150
  42. });
  43.  
  44. var scrollView = Titanium.UI.createScrollView({
  45. contentWidth: '3200',
  46. contentHeight: 140,
  47. backgroundImage: "./UIelements/pagesOver-bg.png",
  48. width: 1024,
  49. height: 150,
  50. bottom: -150,
  51. showVerticalScrollIndicator:false,
  52. showHorizontalScrollIndicator:false,
  53. zIndex: 8,
  54. opacity: 1
  55. });
  56.  
  57. function open_page(e) {
  58. //win1.backgroundImage = pages[j];
  59. Ti.API.info("Yay je hebt op " + imgv.id + " geklikt");
  60. }
  61.  
  62. var viewArr = [];
  63.  
  64. for(var j=0;j<thumbs.length;j++) {
  65.  
  66. var imgv = Titanium.UI.createImageView({
  67. image: thumbs[j].image,
  68. id: thumbs[j].name,
  69. bottom: 25,
  70. left: -3050 + viewArr.length * 290
  71. });
  72. imgv.addEventListener('click', open_page);
  73. scrollView.add(viewArr);
  74. viewArr.push(imgv);
  75. }
  76.  
  77. win1.add(pageBut);
  78. win1.add(scrollView);
  79. win1.open();
Add Comment
Please, Sign In to add comment