Need suggestions on Javascript for image rollover with text change in <div>
I'm trying to write a javascr开发者_Go百科ipt that will do two things. First when you roll over a thumbnail of a picture it loads the larger view in a div container. That part works. But the other thing is that there is a description that goes with each picture that needs to load in a different div container. So far I get the one description loaded and then it gets stuck and the next won't load. I think I just need a little push with the type of objects and methods and such to use. I'm obviously not an experienced javascripter.
Thanks in advance for any suggestions you can offer
Sue B.
Perfect case for jQuery... Try this... http://jsfiddle.net/jchandra/dY8Dp/
Basically I'm adding a data- attribute to store the real pic URL and reusing the title tag for the description.
If you insist on pure JavaScript, it's a bit ugly, but ... here it is... http://jsfiddle.net/jchandra/aDe3u/
精彩评论