How can I place code in the correct spot in the programming pane?

How can I place code in the correct spot in the programming pane?

I have created image rollovers (e.g., use onMouseOver and onMouseOut) in Paintshop Pro to get the code. This code is to be used on the Web. I have been having a problem placing the code created in the correct spot in the programming pane. I have tried to create the "picture-add hotspot" with no success. Any suggestions would be helpful. If more information is needed, please let me know. Thank you.

    Requires Free Membership to View

    Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.

    By submitting your registration information to SearchDomino.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchDomino.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

First of all, there's an easier way to do this that's been built into the product since R5. First, build a single image that contains both the image for the normal state and the mouseover state in a single image, with the mouseover image to the right of the normal image and a single pixel width in between the two images.

In this case, when the mouse is over the object with the image resource, the rightmost image is displayed; otherwise the normal image is displayed. Add this image to your form by doing an Insert Resource -- Image. You don't need to write any code -- when you see this form on the Web, you'll see the rollover happening!

Now to accomplish this the way you set out to, we'll take a different path. First, create a picture (Create -- Picture) in the body of a form or in a Rich Text field. If you're in a form in the Designer, the programming pane will then be navigated to the click event on the picture. You can then choose the onMouseOver and onMouseOut events and code away!

If you're in a document in the client, once you've done a create picture, choose the picture menu and select Add hotspot rectangle. Then move your mouse over the picture and draw the rectangle. When you finish drawing, the programming pane will appear. To write JavaScript code for the Web, you'll need to choose Web in the Run combo box, and then make sure that JavaScript is selected for a language. Then you will see the list of events available on the Web and can write your code for onMouseOver and onMouseOut.

Hope this helps!

This was first published in December 2003