Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Location
    UK
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Alert box question

    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.



  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    626
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sure, try this:
    <A HREF="javascript:alert('Hello')"><IMG SRC="pic.gif" BORDER="0"></A>

  • #3
    New to the CF scene
    Join Date
    Aug 2002
    Location
    UK
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool Works thank you

    Hi requestcode,

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

  • #4
    New to the CF scene
    Join Date
    Aug 2002
    Location
    UK
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Embarrassing as it might be here's my 3rd attempt



  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •