This article may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. To maintain the flow of the article, we've left these URLs in the text, but disabled the links.


MIND


GEEK

Robert Hess

Download the code (1KB)

GEEK How do I script two simultaneous events for the DHTML onmouseover event? My current code (below) is in black and simply changes the class of the object on rollover. I'd also like to display a message in the status bar from the same event. The code in green (proper syntax notwithstanding) is what I would like to add. Any ideas?
      This didn't work:


 <DIV ID="html" STYLE="position:absolute; top: 100px; z-index: 0">
 <P><A HREF="html.htm"
  CLASS = "offmed" TARGET="main"
 ONMOUSEOVER = "this.className ='onmed';" 
  "window.status = ' Websites I developed using HTML...' ; return true;"
 ONMOUSEOUT = "this.className = 'offmed';">Website Development</A></DIV>
Neither did this:

 <DIV ID="html" STYLE="position:absolute; top: 100px; z-index: 0">
 <P><A HREF="html.htm"
  CLASS = "offmed" TARGET="main"
  ONMOUSEOVER = "this.className ='onmed';"
  ONMOUSEOVER = "window.status = ' Websites I developed using HTML...' ;
      return true;"
  ONMOUSEOUT = "this.className = 'offmed';">Website Development</A></DIV>
GEEK You can't assign more than one onmouseover to a single object, but you should be able to bubble multiple onmouseover events through contained objects. Here is an example I worked up to demonstrate this:

 <html>
 <body bgcolor=white>
 <div onmouseover="window.status='Just A Test'" 
    onmouseout="window.status=''">
 <span onmouseover="this.style.background='yellow'"   
    onmouseout="this.style.background='white'">
 This is a test
 </span>
 </div>
 </body>
 </html>
GEEK I am developing a Web site using Active Server Pages (ASP) and SQL Server ™. One of the text fields that I will need to capture can exceed 32KB, but that's the limit on a standard textarea. Since you can't specify a width of 100 percent on a textarea, the control seems very limited. Is there a cross-platform, cross-browser alternative?
GEEK With the cross-platform, cross-browser limitation, the easiest solution would be to simply use several textarea controls. Perhaps you could allow the user to enter information in blocks of text and provide a "But I Need To Type More!" button. This button would submit the current text block, then jump to a new page that displays the currently submitted text and present another textarea control for the user to keep typing in. It might also be possible to write a Java application to do this, but that could be trickier to coordinate appropriately.
      You could also allow users to submit a standard text file that was prepared elsewhere. You would do this using the File Upload capability that Microsoft® Internet Explorer 3.0 and 4.0 and most versions of Netscape Navigator support. But this would require some additional code on the server for grabbing and storing these data files.

GEEK In a recent response to an "applet as a body background" question, I was surprised that you didn't suggest using an animated watermark background image. By grabbing a few screen shots of http://www.isbiel.ch/~troxp/java/apl/Snow/e.html, I created a quick animated snowing GIF using Microsoft Image Composer. I then loaded an HTML page with the following:


 <HTML>
 <BODY BACKGROUND="snowing.gif" TEXT=#FFFFFF>
 <H1>This is a test<H1>
 <H3>of the snowing GIF background<H3>
 </BODY>
 </HTML>
GEEK I was prevented from offering a suggestion like this due to built-in safeguards within my Web page design algorithms. In fact, I now need to do a quick reboot just to clear this from my memory!

GEEK Is there any way that I can add a script to automatically invoke the full-screen mode on Internet Explorer 4.0 when a user visits my Web site?
GEEK Earlier versions of Internet Explorer had a scriptable explorer object that provided a fullscreen property. Because of concerns that this and some other explorer object features could be used to play tricks on users' machines and thus fall into the realm of a security issue, this object was removed. To switch to a full-screen view on the browser, you essentially need to launch a new instance of the browser and start it out in full-screen mode (see Figure 1). Note that not only am I opening a new full-screen window, but in the old window I am also displaying information as to what I am doing. I could have invoked the window.close method to close this first window, but that results in a message box to the user alerting them that a script on the page is trying to close the window. My preference would be to instead utilize the first window to provide some sort of information to the user.

GEEK How can I have people choose a URL from a dropdown list and press a button to take them to it? I have to provide these pages to college administrators, and we're not allowed to run any server-side components.
GEEK With the strictly client-side restrictions you state, the following should suit your needs nicely. This will work on the latest versions of Microsoft Internet Explorer or Netscape Navigator:

 <html>
 <body>
 
 <form>
 <select name=redir>
 <option value="http://www.Microsoft.com">Microsoft</option>
 <option value="http://www.CocktailTime.com">Cocktails</option>
 <option value="http://Seattle.Sidewalk.Com">Seattle</option>
 </select>
 <input type=button value="Go!"
 onclick="location.href=redir.options[redir.selectedIndex].value;">
 </form>
 
 </body>
 </html>
GEEK I have been using Microsoft Image Composer 1.5 for a while now. Every time I use a font within a design, the font always looks terrible (fuzzy) when I view the final image on a Web page. How can I get good-looking fonts like I often see on the Web?
GEEK The issues you are running into have to do with four slightly separate aspects of images.
  1. In a worst-case scenario, a 256-color system will only be able to display colors that are made up of the color values containing hex values 00, 33, 66, 99, CC, or FF. Any other color that attempts to be displayed will either be dithered or set to the perceived closest match.
  2. With small font lettering, any dithering will look really bad.
  3. JPEG images use "lossy" compression, which means that the rendered image has less color information than the original image did. To see this, make a large solid color square, save it out as a JPEG image, then look at it with your browser. Yuck!
  4. While rendered JPEG images will also be limited to the safety palette colors, due to lossy compression you really don't have much say in the exact palette color being used, so it's no use even trying.
      So the approach to take with your image is to enlarge the size of the font so that the dithering anomalies are less noticeable, and add a bit of visual sleight of hand to draw readers' eyes away from any fuzziness that might be coming into play. I do this with a white drop shadow. There are a number of other ways you could have done this. You might want to see what this looks like with a white outline, but note that this often actually makes the problem worse because the outline is actually drawing more focused attention to the letters, as opposed to pulling the eyes away from them like the drop shadow does.
      I did a fairly detailed writeup about the safety palette some time ago for Microsoft SiteBuilder:http://msdn.microsoft.com/workshop/design/color/safety.asp This explains the problem and talks you through the solution.
      The article contains a GIF file whose palette contains only the 216 colors of the safety palette. You can use that image to build a .pal file with most image tools. Note that Image Composer and most other high-end image tools will utilize special gamma correction, which in most cases keeps you from making an image exactly match a palette without a lot of magic. Fortunately, Image Composer 1.5 provides built-in support for the safety palette. From the View menu, select Color Format which will allow you to select from "True Color," "Gray Ramp," "Web dithered," and "Web solid." This is a better way to create images that utilize the safety palette. The only drawback is that there isn't any (easy) way to combine both dithered and solid components into a single image.
      I personally use both Microsoft Image Composer and JASC Paintshop Pro (http://www.jasc.com). Image Composer does a wonderful job at sprite manipulation, color blending, and effects, and it allows me to create great looking graphics. However, it isn't a tool for bit-level manipulation of images. So I often build up the image in Image Composer, then copy it over to Paintshop Pro for final tweaking before saving it out as a GIF file. Paintshop Pro allows me to fix up any pixel-level anomalies in the images and force it to conform to the safety palette. This level of image manipulation can be rather tricky and it takes practice.

GEEK I was reading a recent geektogeek and have a question regarding one of the questions. One geek was berating you for erroneous information and said that the statement


 document.myForm.myField.focus();
works in Internet Explorer. I have found that it works fine if myField is of type text. If it is a submit button, I get an error message saying the method is unsupported. This seems to happen only in Internet Explorer, not Netscape Navigator.
GEEK The problem you are running into is that the focus method in Internet Explorer 3.x was only defined for the radio, password, text, and select elements of a form. In Internet Explorer 4.0 form elements the focus method is exposed for everything except for hidden or label elements.

GEEK I'm trying to populate a combobox in my ASP code with a list found in a field in a Microsoft Access database. Microsoft FrontPage 98® makes it very easy to stick controls like dropdown comboboxes and listboxes on a page, but provides almost no useful information on how to use them. Why can't using these controls be as easy as using the same or similar controls in Microsoft Access or Microsoft Excel?
GEEK It sounds like your main problem is simply locating documentation for the properties, methods, and events that a particular ActiveX® control provides. The ActiveX interface is designed to allow a host application (like FrontPage 98) to query any ActiveX control to discover the names and parameters of its interfaces. In this way, you can simply right-click on a given control and select the Properties item. This will bring up a Properties dialog that allows you to see the assignable properties of the control. Likewise, the Scripting Wizard in FrontPage 98 displays all of the controls you currently have on your page and provides access to the methods you can call, as well as the events you can respond to.
      Of course, just knowing the properties, methods, and events of an ActiveX control really doesn't help you understand how to use it properly. You might see a property named Bounds that takes a numerical value, but what the heck does it do? There's a method called Synchronize, but when are you supposed to call it? It might make perfect sense to the programmer who designed it, but they often forget that the people trying to use these controls don't have access to their source code.
      The problem is that ActiveX controls are only partially self- documenting; first-time users of these controls still need to have some sort of written documentation or tutorial to understand how to best use them. But with ActiveX controls popping up all over the place, it is often difficult to track down all of the relevant documentation. I encourage the developers of these ActiveX controls to provide clear and easy-to-find documentation for their controls.
      In your instance, it sounds like you are specifically trying to use the Forms 2.0 controls. A good place to start understanding how to use these is to look through the tutorial information for the ActiveX Control Pad. You can find that at: http://msdn.microsoft.com/workshop/author/cpad/ You can also look through a FAQ about using ActiveX controls at: http://msdn.microsoft.com/library/bkgrnd/ctrlfaq.htmAnd as for other ActiveX controls, you might want to check out: http://www.ActiveX.com This is a Web site offered by c|Net that is essentially a central clearing house for ActiveX controls.


From the April 1998 issue of Microsoft Interactive Developer.