anonymous functions, using .html(array[i]), not working
I'm really stumped on this. it may have to do with javascript closures..?
hope i can explain...i have an array of 22 phoenician letters, (strange i know).
and there are 22 corresponding divs with numeric id's.
using jQuery i set mouseover & out event handlers to hide/show another div that contains the rolled over letter. i'm trying to use jQ's .html()
to put the content in the div like so.
.html(pLetters[i]), the counter i is not working, if i write .html(pLetters[1]) it will display the single letter, (thought not what i want.)
for(i=0;i<22;i++) {
//alert(pLetters[i]); this test works..
$('#p'+i).mouseover(function() {
$('#p-letter-container').fadeIn('fast');
$('#p-letter-container').html(pLetters(i)); //this is not working but doesn't throw an error either..?
});
$('#p'+i).mouseout(function() {
$('#p-letter-container').fadeOut('fast');
$('#p-letter-container').html(); //removes the HTML from the div
});
}
});
that was an error in my post. i actually have it coded with brackets. guess i was trying anything and everything at one point.
i don't normally post stuff in progress but will make an exception.
please know, this site is def underconstruction. i did not design, just building it.
Bookmarks