Dear Dr. Website®: I've been looking for a Java applet that will display an image which, when clicked, will be replaced in the same location and window with another image. For example, an opaque square that will reveal an image when clicked. This should enable me to design a game for language learners, where half of the squares hide an image and the other half hide a sound file.
I'm using a FrontPage Web page with hover buttons, but now I want to vary the pattern for quizzes and games. I've found all sorts of cool tricks, but none that does exactly what I want. I am not a techie and do not write HTML or Java. If I can't design it in FrontPage or cut and paste code into my page, I probably can't do it. Can you help?
You can paste the code from below into your page,
and replace the image names with your own image names. Note that the first image must be the same dimensions as the second (or vice versa).
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--//
function clicktext(image){
document.clear.src=image;
}
//-->
</SCRIPT>
<A HREF="#" onClick=clicktext('sometext.gif');>
<IMG SRC="first.gif" NAME="clear" BORDER=NO
WIDTH=191 HEIGHT=37></A>
Dear Dr. Website®: I know how to put music on a Web page, but how would I make it keep playing continuously as the visitor calls up various pages within the site?
The music is only going to play while the visitor is on that page. One solution would be to make a framed page, with one frame containing nothing but the music (a MIDI file, I assume--you don't want to cause your visitor to download a huge WAV file, because then the user will get tired of waiting and leave your site). You could make that frame invisible to users, and then they can continue on their way through the site while the music plays. But I suggest giving them at least a button to stop the music from playing, because not everyone likes musical accompaniment to their Web surfing.
Dear Dr. Website®: I'm using Claris Home Page 3.0 to design my church's Web page. I need to put a sidebar on all the pages for a section of pages in the site. I can't get the frames to work; I've also tried putting my sidebar image as the background, but it won't let me image-map background images. Also, I was wondering if I can put an animation on top of an image -- I want to add an animation on top of the sidebar, but Home Page won't let me.
Perhaps you should find another Web design tool
that will enable you to add these features. Something like Microsoft FrontPage, NetObjects Fusion, or Macromedia's Dreamweaver will allow you to add these features using drag-and-drop techniques. Of course, you could always grab a book about HTML and Web design, and have a go at it using an HTML editor such as Allaire's HomeSite. All of your questions can be answered by scrolling through the pages of WebDeveloper.com or The Web Developer's Virtual Library.
Dear Dr. Website®: I'm trying to refresh my home page whenever it is accessed by someone, and I want to make sure it is not inside a frame. I'm experienced with HTML, but I can't figure this one out. Here's my (failed) attempt:
<meta http-equiv="window-target" content="_top">
<meta http-equiv="refresh"
content="0;url=http://www.myhomepage.com/">
To keep your page out of a frameset,
you can place this tidbit of JavaScript in the first part of your document:
<SCRIPT LANGUAGE="JavaScript">
<!--//
if (parent.frames[1])
parent.location.href = self.location.href;
//-->
</SCRIPT>
As for the second part, there are a couple of META tags that were designed with that purpose in mind, but unfortunately, Microsoft Internet Explorer simply ignores the tag. A supposed fix that Microsoft provided, placing the META tag down further in the page, also does not seem to work. Here are the tags as they are supposed to appear:
<META HTTP-EQUIV="expires"
CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
The first META tag used "expires" to tell the browser to request a new copy of the page. The second tells the browser not to cache the page at all. These tags work with the Netscape browser, but we're still searching for an MSIE fix that works.
Dear Dr. Website®: On our intranet, I would like for a form to not only result to a separate (blank) window, but to automatically print on the user's default printer. The blank window is the easy part--it's the printing that has me stumped.
You can use a function
that is called when the form is submitted, but it will only pop up the default print dialog box, which requires the user to click again.
<SCRIPT LANGUAGE="JavaScript">
<!--//
function prn(){
this.print();
}
//-->
</SCRIPT>