Barry said:
Thanks Trevor,
I have copied in your script and can see it working,
but your scripting ability is (much) better than mine...
I can see the text changing colour, and the change of button graphic
on select,
... but I can't see in your script where the button graphics are
defined I need (I think) to design my own as they need to be tabs
rather than buttons. Sorry to be so dense.
Ah, I see
In that case you would have to design your own graphics in 3 versions
1. Normal, i.e. as first seen on page (say image1.gif)
2. The mouseover, or hover, version (say image2.gif)
3. The mouseout, or visited, version (say image3.gif)
Then you would need to alter the <button> tag to something else
Try this
<div id ="tab1" style="position: relative; width: 60px; height: 25px;"
onmouseover="setImage('tab1','<img src=\'images\\image2.gif\'>');"
onmouseout="setImage('tab1','<img src=\'images\\image3.gif\'>');">
<img src='images\image1.gif'>
</div>
Note that the images must be of the same size, in this example 60 by 25.
If they are a different size, alter the width and height parameters in the
style="..." spec
And take care with the backslashses, that is this character: \
Use of these is important:
\' this escapes the ' character so that it is read corretly within a set
of quotes (' and ' )
\\ this escapes the \ character itself
and in one case
\ this is the normal way of indicating a folder
No doubt you want to do something when the graphic is clicked, so just add
onlick="fnname()"
where fnname is a JS function which is known, e.g. it has been defined
between
<script type="text/javascript">
and
</script>
or it can be valid JS (e.g. to test this I used onclick="alert('clicked')" )
I note that you say you want to use tabs (plural) so using a <div> tag may
not be the best option. The next <div> will appear below the previous one
So you can use a table
<table>
<tr>
<td id="tab1" onmouseover="setImage('test','<img
src=\'images\\image2.gif\'>');"
onmouseout="setImage('test','<img src=\'images\\image3.gif\'>');">
<img src='images\image1.gif'>
</td>
etc.
I haven't tested this
If I have confused you, post your code and I will look at it
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website:
http://trevorl.mvps.org/
----------------------------------------