views:

68

answers:

1

On this page: http://sparqtraining.com/

The alt text for the thumbnails presents after the onmouseover event in a box underneath all of the pictures. How did they do that?

+1  A: 

Have one element be the element used for the captions, and assign an event handler on the 'mouseover' or special hover event then populate the caption element with data used from the image, or a sibling of the image element if you have a div containing the image element and another separate caption element.

meder
Awesome. What? Thanks for your reply, but ... now I have to dig deeper from the murky shadows of my understanding. I'm going to lay this out now: There are 18 thumbnails, each has an onclick that loads an image next to them. When overmoused, the alt shows below the thumbs. I am guessing there's a div with an ID of "caption" or the like, yes? So something is telling the page to load the "alt" when the event happens. If that's right, how and where is the assighment done? I really appreciate you helping me grasp this (for me) hard to understand phenomenon... multiple events w/o replaces...
Somethin like thishttp://jsbin.com/ahaza
meder
Maybe exactly like that. I'm gonna go play with that for a while and see how it works. My confusion continues to be how exactly I will define where the "alt" shows up but assuming that IDing the div positions the text I guess that's the ticket. Back soon... and thanks!
No, not quite like that. jsbin.com/ahaza is is an unordered list with bullet; the sparq thing is 18 images stacked three wide and six high.
... you're supposed to style and mark the html up however you want, but the javascript logic stays the same.
meder
Okay, this is amazing. I got it to work with all of the images in my table on my front page... the only catch left is positioning the text that appears on the mouseover; at the moment it's about 80px left of where it shoudl be... a spacer gif in the div didn't work, and a float didn't work (not that I really get how to do this, obvious by now!!!) but I imagine enough trial and error will do the trick... Hey, this is how you learn, right? Thanks for all the help1
You're welcome.
meder
By George, I got it! Thanks again.Next question coming right up!
yeah sure, now dont forget to choose an answer :)
meder