Click to See Complete Forum and Search --> : JS to click link left <td>, get data rt <td>
I just saw a swf file do something that I believe could be accomplished in javascript, but I admit it is way beyond my own grasp of the language.
Here's the setup... simple table, left cell and right cell. In left cell are a series of bulleted text links, one overtop the other. When you click one of them, the info appears in the right cell.
Let's say for example, we had 5 names, and if someone clicked one of them, the contact phone # would come up in the right table cell.
++++++++++++++++++++++++++++
+ * Tom
+ * Bob................... 555-5555
+ * John
+ * Mary
+ * Ann
++++++++++++++++++++++++++++
How can that be accomplished with js?
Thanks for any help...
Thanks very much Dave. I copied the code exactly as written into my HTML Editor (1st Page 2000), and when I hit preview, I get these 2 error messages:
Line 31, Character 11... Expected ';'
...which is:
str += ','' + out + '');">';
Line 41, Character 1 ... Object Expected
...which is:
<body onload="return buildBook('phoneBook','divOutput');">
The lines of code are what 1st Page is showing at each line #, so I am assuming that those lines are the same one's referenced by the error messges.
From that info, can you determine the source of the problem?
Good job Dave! Works beautifully -- thanks very much.
If you should feel like playing with this a bit more, as your time allows, it would be a nice tweak to have the "I beam" cursor turn to a hand as it went over each name. Or as an alternative, have the background color directly behind the name change color on mouseover -- would make it more obvious that the name was "clickable".
With that minor exception, your script does exactly what I described -- thanks again...
linnie
02-09-2003, 08:20 PM
Originally posted by Reno
With that minor exception, your script does exactly what I described...
Well, you didn't describe that little minor nicety. I mean, wow, he gave you so much than you actually asked for in the first place -- you'd think you could add that little piece yourself. After all, how hard is it to add cursor:hand; to the style for the LI tag? :)
Lin
You are very right Linnie... anyone who follows this forum is well aware of Dave's generosity with his time and expertise, so leave it to me to push the envelope!
Your suggestion did the trick -- now maybe I should spend the rest of the evening thinking up some other enhancement...
linnie
02-09-2003, 08:35 PM
:)
What I love about this forum -- and the WWW in general -- is how many good hands there are to help out when help is needed. Keeps my faith in humanity alive and well (most of the time!).......