Bind function getting crazy in loop?


i creating dynamic menu bar external data

 

i using loop doing replacement. doing in text replacement. however, goes crazy on binding "click" event .

 

please me fix first, , second button working in right url inside looping. not button 3 go right url.

 

 

demo: http://www.ctmotorfairing.com/test/an2/

source: http://www.ctmotorfairing.com/test/an2/an2.zip

var url, item;

 

 

for(var i=0; <= 7; i++) {

          item = sym.$("text" + (i + 1))

          item.html(menu[i][0]);

          url = menu[i][0];

          item.bind ("click",function(){alert(url);})

}

 

anyone can fix it????



More discussions in Edge Animate CC


adobe

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account