free hosting   image hosting   hosting reseller   online album   e-shop   famous people 
Free Website Templates
Free Installer

Graphic As Link
Using onMouseDown


This script creates a popup window when a graphic is clicked.

Nothing new about that, except this uses the onMouseDown command instead of the usual href.

This method has several interesting features:
  • no link details are displayed in the status line
  • there is no "pointing hand" cursor when the mouse is over the graphic
  • Any mouse button can be clicked to activate the link

  • Paste the code below into the head section of your page:
    Now paste this code in the body of your page:

    How It Works


    An onMouseDown command is inserted inside the img tag in the body of the page.

    When any button is clicked while the mouse is over the graphic, the function OpenWindow is called.

    The parameters for the popup window - (theURL,winName,features) - are passed from the link.

    So you can have several links with different graphics on the same page, and change each window's details depending on their content.


    An optional window.blur() command is included - simply uncomment the line if you wish to use it.

    If you do, here's what happens:

    when the link is clicked, the main window will be hidden by all other open windows, with the popup on top.

    When the popup is closed, the main window will move to top position again.


    Try It Out

    This uses the optional window.blur() command:


    Click for popup window   Click image for popup window





    © 2001 CyberSchool