internet.com

Go to WebDeveloper Home


hm-v6-139x61.gif

Database Journal: The Knowledge Center for Database Professionals

find a web host with:
CGI Access
DB Support
NT Servers
UNIX Servers
Telnet Access

advanced search
jobs

Get FREE Development Info via your Email!

The Webdeveloper channel
FlashKit
GIF.com
HiermenusCentral
webdeveloper Jobs
Java Boutique
JavaScript.com
JavaScript Source
ScriptSearch
StreamingMedia World
WDJ
WDVL
WebDeveloper.com
WebReference.com
XMLFiles.com

internet.com
Internet News
Internet Investing
Internet Technology
Windows Internet Tech.
Linux/Open Source
Web Developer
ECommerce/Marketing
ISP Resources
ASP Resources
Wireless Internet
Downloads
Internet Resources
Internet Lists
International
EarthWeb
Career Resources

Search internet.com
Advertise
Corporate Info
Newsletters
E-mail Offers

internet.commerce
Be a Commerce Partner










D R .   W E B S I T E®
WebDeveloper.com

June 28, 1999

Hiding Images Behind Images; How To Keep Music Playing

By David Fiedler and Scott Clark
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>

Visit The Dr. Website® Archives.
Click here for a list of Dr. Website's most frequently asked questions (and answers!).
Send your own question to Dr. Website®.

Fast Jump to Anywhere on WebDeveloper.com®:


Contact the WebDeveloper.com® staff

Last modified: 20

 

Refresh Daily
Join Editor-in-Chief David Fiedler The Editor With No Time and find truth, justice, and a clue or two.


Browse by Category
[ Site Map ]

ActiveX / VBscript
Animated GIF Archive
Browsers
CGI / Perl
Database Connectivity
E-Commerce
HTML-Advanced: DHTML, CSS
HTML / Site Authoring Tools
Intranet/Groupware
Java
JavaScript
Multimedia: Audio / Video / Streaming Technologies
Opinions
Refresh Daily: Editorial Column
Security
Servers & Server Tools
Site Design / Graphics
Site Management / Marketing / Log File Analysis
VRML / 3D
XML