Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Variable in AddEventListener

$
0
0

Hi guys,

I got a quick and newbie question on variables in javascript

I was wondering is it possible to get the updated value in a whenever I scroll the scrollView?

Many thanks!

Code example:

var a = "1";
scrollView.addEventListener('scroll',function(e){
    Ti.API.info('a' + a) // gives me 1 when i scroll every time (It didn't increase to 2,3,4,5,6,etc,etc)
    a++ 
});

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>