Web Development

Our forums are currently in maintenance mode and the ability to post is disabled. We will be back up and running as soon as possible. Thanks for your patience!

General discussion


Can I put transparent Color Over Image

By sancreations ·
Hi all,

Facing a new problem, I have an Image(.gif/.jpg) on my Html page, I want to create HotSpots On Some Parts Of That Image. I am able to create links at desired positions but i want "On Mouse Over to that link The ForeGround Color shud comeand the portion of the image behind it shud also be visible" / "or a kind of Transparent Color shud come".

If Somebody could help me out in this, it will be a great help.


This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

change images

by shelleydoll In reply to Can I put transparent Col ...

You have to create two images, one normal, and one with the transparancy or whatever, then use javascript to swap them out with the mouseover stuff. Try something like this:

function changeImages() {
if (document.images) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments].src = changeImages.arguments;

------- then, in your link definition in the body: -----

<a href="http://blah.com/index.html" ONMOUSEOVER="changeImages('imgname', './img/imgname_alt.jpg'); return true;" ONMOUSEOUT="changeImages('imgname','./img/imgname.jpg'); return true;"><img name="imgname" src="./img/imgname.jpg" border=0></a>


Hope this helps!

Related Discussions

Related Forums