...

View Full Version : Alert box question



TL63
08-21-2002, 01:19 PM
Hi to all,

Is it possible to have an alert box when a visitor clicks on an image, instead of text?
It's not mega-important just a bit of fun.

I'm using the following code '<A HREF="noplace" onMouseover="alert('Blah-di-blah')"> Don't click this link!</A>
although I do have the following script for my mouseover nav buttons in the HEAD section.

<SCRIPT language="JavaScript">
<!--

if (document.images)
{
pic1on= new Image(88,31);
pic1on.src="images/butt2.gif";
pic2on= new Image(88,31);
pic2on.src="images/butt3.gif";
pic3on= new Image(88,31);
pic3on.src="images/butt4.gif";
pic4on= new Image(88,31);
pic4on.src="images/butt5.gif";


pic1off= new Image(88,31);
pic1off.src="images/butt2_over.gif";
pic2off= new Image(88,31);
pic2off.src="images/butt3_over.gif";
pic3off= new Image(88,31);
pic3off.src="images/butt4_over.gif";
pic4off= new Image(88,31);
pic4off.src="images/butt5_over.gif";

}

function picon(imgName)
{
if (document.images)
{
imgOn=eval(imgName + "on.src");
document[imgName].src= imgOn;
}
}

function picoff(imgName)
{
if (document.images)
{
imgOff=eval(imgName + "off.src");
document[imgName].src= imgOff;
}
}

//-->
</SCRIPT>

If the answer is No, I'm gonna laugh first, then cry.
Thanks.


:D

requestcode
08-21-2002, 01:56 PM
Sure, try this:
<A HREF="javascript:alert('Hello')"><IMG SRC="pic.gif" BORDER="0"></A>

TL63
08-21-2002, 02:06 PM
Hi requestcode,

Many thanks for that. Sometimes you can run around in circles and miss the blatantly obvious. :rolleyes:
I will post a link when my 'site is back up and running.

TL63
08-28-2002, 10:48 PM
Embarrassing as it might be here's my 3rd attempt (http://www.tl.roberts63.btinternet.co.uk)

:o



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum