Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing an Array of Strings through an Onclick

Status
Not open for further replies.

evilm

Programmer
Jul 18, 2007
4
US
Good Morning,
I have attempted to search for help with this but I'm lost at the moment.

First, a little background. I am creating a javascript thumbnail gallery which swaps a placeholder image with the one tied to the thumbnail. Due to my inexperience, I simply used the built-in image swap generator in Dreamweaver, so I have a very limited understanding Javascript.

Also, I need to show a description. Rather than make the text as an image I wanted to have plain text. This is also because the strings have HTML links in them.

I have made an array of the various strings, however I don't know where to start as far as passing the strings through the onclick event.

Also, if there is another way to do this which would be more efficient I am very open to suggestions.
 
I suggest you look around and find a gallery solution that someone else has already created. I think you are biting off more than you can chew (if, as you say, you have a very limited understanding of javascript).

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
You were absolutely right, I definitely had bit off more than I could chew, and my initial pursuit of a solution was headed in the wrong direction.

However, in the spirit of helping others I wanted to post my solution.

Dreamweaver has built-in javascript functions for image swapping, navigation bars, etc. While these are certainly not the greatest examples of programming, they work in a pinch when you're looking for a quick and dirty solution. Especially for the javascript-challenged like myself.

By positioning my caption div absolutely to its container div I was able to get Dreamweaver to recognize it as a "layer" thus allowing me to use the "set text" script built into Dreamweaver. From there it was simply a matter of using the CSS to style the content as it is flowed in by the pre-generated javascript.

Best regards,

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top