JS to show a different image depending on webpage title

K

kieran5405

Hi,

I am not very familar with JS but this is what i am trying to do.

I have an html table with image links in it. When the user is on a
page that corresponds to one of the image links, i want that page to be
an image with a different background i.e. so that the user can see
easily where he is.

For example, in the below table the user is on access.html - so
therefore the image in the table shows 'Accessories_on.gif'. I have an
'_on.gif' for every image.

I was thinking of using some sort of 'case' scenerio which would check
the title of the page and then present the correct image.

Also as there are subpages of some of the links, i was looking to have
the JS check the title like so. The JS would check for the word access
in the start of the title so that it would present 'Accessories_on.gif'
for a webpage called 'access.html' and for a webpage called
'accessSubpage.html'. It would look for the spelling at the start of
each title.

I would greatly appreciate any tutorials or help.

Thanks.

--------------------------------------------------


<table>
<tr>
<a href="/"><IMG SRC="/images/MainLinks/HomePink.gif" ></a></td>

</a></td>

<td><a href="access.html" ><IMG
SRC="/images/MainLinks/Accessories_over.gif" ></a></td>

</a></td>

</a></td>

</a></td>
</tr>
</table>
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top