title attribute and image swap

R

Richard

Now that I've finally gotten this menu scheme working properly, I am slowly
putting in some working images to go with it.
BTW, validating the file every step of the way.

Using an image on the original loaded page, validation requires an alt
attribute.
However, using the straightforward technique of image swapping
onclick="document.main.src='swap.jpg'"
The alt attribute appears as if the original image were still in place.
Is there a way to correct this so the proper alt information appears if I
don't just want to say "image"?
 
R

Richard

Now that I've finally gotten this menu scheme working properly, I am
slowly
putting in some working images to go with it.
BTW, validating the file every step of the way.
Using an image on the original loaded page, validation requires an alt
attribute.
However, using the straightforward technique of image swapping
onclick="document.main.src='swap.jpg'"
The alt attribute appears as if the original image were still in place.
Is there a way to correct this so the proper alt information appears if
I
don't just want to say "image"?


Totally idiotic.
onclick="document.main.src='images/galaxy.jpg'" alt="galaxy"

The alt tag makes the file compliant and does nothing.
When you mouse over the image, the old alt information shows up.
 
R

Richard

While sitting in a puddle Richard scribbled in the mud:
Yup, you sure are. down to only 12 Errors.
http://tinyurl.com/5btko

Really? Considering what I'm working on is not even online yet, how did you
manage that trick?
Besides, those errors are not of my doing if you'll bother to read them.

You are aware that it is possible to validate a LOCAL file right?
Maybe I should call you DtS. Duende the Stoopid.
 
S

Steve Pugh

Richard said:
Using an image on the original loaded page, validation requires an alt
attribute.
However, using the straightforward technique of image swapping
onclick="document.main.src='swap.jpg'"

The alt attribute appears as if the original image were still in place.
Is there a way to correct this so the proper alt information appears if I
don't just want to say "image"?

An image is defined as follows
<img src="value" alt="value">

When you change element.src what do you think you're changing? Yes,
well, done you're changing the value of src.

So how do you think you change the value of alt?

Yes, element.alt="new value"

Well done, now go back to your seat and try not to disturb the rest of
the class again.

Steve
 
B

Beauregard T. Shagnasty

Richard said:
Now that I've finally gotten this menu scheme working properly

...for some value of "properly". A very small value.

With js off, it does nothing. But you know that.

With js on, the flashing text and image outlines that fly around and
about the page, make it worthless. Pure crap.

Take a vacation.
 
N

nice.guy.nige

While the city slept, Richard ([email protected]) feverishly typed...
Using an image on the original loaded page, validation requires an alt
attribute.
However, using the straightforward technique of image swapping
onclick="document.main.src='swap.jpg'"
The alt attribute appears as if the original image were still in
place.

http://www.nigenet.org.uk/stuff/thumbtastic/

This uses javascript to swap the image and change the alt text if javascript
is available. If not, some PHP code reloads the page with the selected image
(and alt text).

Cheers,
Nige
 
O

Oli Filth

Richard said:
I have not yet put MY version online which WILL work with JS off.

I would guess that's because it's impossible (I'm assuming by JS you
imply all client-side script cleverness), unless you use server-side
scripting.

But then that would defeat the whole point of what you were originally
trying to do, which (IIRC) was to create a gallery that doesn't require
server-side scripting or an individual HTML page for each image.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top