HOW TO: Open a Custom Window from an Image Map by Using DHTML Using FrontPage 2000 (286015)



The information in this article applies to:

  • Microsoft FrontPage 2000

This article was previously published under Q286015

SUMMARY

This article describes how to use Dynamic Hypertext Markup Language (DHTML) to open a custom browser window from an Image Map hotspot. Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.

back to the top

Create a Sample Page

Follow these steps to create a DHTML sample by using the Image Map editing features of FrontPage 2000.
  1. Open a new, blank page in FrontPage.
  2. Insert an image on your page.
  3. Select the image. The Image Editing toolbar appears at the bottom of the screen. Click the Rectangular Hotspot button, and then draw a rectangular hotspot on the image.
  4. When the Create Hyperlink dialog box appears, delete all the text from the URL box, and then click OK.
  5. Switch to HTML view.
  6. Insert the following code in the <HEAD></HEAD> section of the page:
    <script language="javascript">
    <!--
    function OpenWindow(strURL,strWidth,strHeight)
    {
        /* open a new browser window based on info passed to the function */ 
        window.open(strURL,"","Width=" + strWidth + ",Height=" + strHeight,0);
    }
    //-->
    </script>
    						
  7. Locate the image map entry. It may resemble the following:
    <area nohref coords="0, 0, 100, 100" shape="rect">
    						
  8. Modify the image map entry so that it resembles the following example:
    <area nohref coords="0, 0, 100, 100" shape="rect"
        onClick="javascript:OpenWindow('http://www.msn.com',500,350);">
    						
  9. As an optional item, you can modify the image tag to display a different insertion point when a user rests their mouse on the image. Locate the image tag, which may resemble the following:
    <img width="200" height="200" src="images/image.gif" usemap="#FPMap0">
    						
    Modify the code by adding style="cursor:hand" so that the code resembles the following:
    <img style="cursor:hand" width="200" height="200" src="images/image.gif" usemap="#FPMap0">
    						
  10. Return to normal view and save the page.
back to the top


REFERENCES

For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

272163 FP2000: How to Open a Custom Child Window from a Hyperlink



For more information about Microsoft JScript, visit the following Microsoft Web site:

back to the top









Modification Type:MajorLast Reviewed:6/18/2005
Keywords:kbhowto kbHOWTOmaster KB286015 kbAudITPro