Re: (simple?) DOM problem
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: (simple?) DOM problem

From: Randy Webb <HikksNotAtHome@aol.com>
Date: Wed Feb 08 2006 - 17:42:12 CET

bmgz said the following on 2/8/2006 6:16 AM:
> I have a simple DHTML gallery:

No, that's not a "DHTML gallery", it is a simple image swap routine.

> <script>

<script type="text/javascript">

> viewPhoto(thumb){

That is a good example of why people shouldn't try to type/paste
snippets into a post. I have to assume that was an errant mis snip.

> function viewPhoto(thumb){
> document.getElementById('mainPhoto').src=thumb.href;

document.images['imageNAME'].src = thumb.href;

Now, it is more cross-browser friendly.

> return false;
> }
> </script>
>
> ....
> <body>
> <a onclick="javascript:return viewPhoto(this);" href="whatever"><img

no need for the javascript: label, drop it.

> src="thumbnail" /></a>
> </body>
> ....
>
>
> I want the currently viewed images' thumbnail to have a nice thick
> red-border.

Then give it one. That is what CSS is for:

<img ...... name="mainPhoto" style="border: solid 20EM red">

How thick do you want it?

> I have managed to do this slap dash, but I had a better way

What in the world is a "slap dash"?

> My only problem is that I need to find out the DOM Array value of
> the thumbnail object (ie the "thumb" param)

Nothing in that sentence makes any sense at all.

What is a "DOM Array value"?

> Is this possible?

Nobody can answer that until you explain what it is you are trying to do.

-- 
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Received on Mon May 1 03:10:26 2006