Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript text overlay

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36368
    margaux
    Participant

    I”m attempting to write a little javascript function which will display an overlay with some text when an image is clicked on. I’ve created an array variable which holds the different text descriptions. the index should correspond to the image e.g. image 0 will correspond to the 1st item in the text array and so forth. how do i find out which child of the parent node “photoWrap” has been clicked on? if I know which child it is, I can use that as the index to the overlayText array – or do you have a better way of associating the image with the text?
    The html is










    the javascript is

    #96095
    margaux
    Participant

    yes, using the alt attribute is an easier way, thanks.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.