ammwebmaster2
04-27-2005, 02:17 PM
I am using a script for a link description box and the message box shows up in IE fine but in Mozilla only part of the text shows up. In IE the box is yellow in Mozilla the box is white. I have tried to increase the box size but it will not change in Mozilla. Also I am getting a JavaScript "Object not specified" Please help!!! I have tried script after script after script to find one that works in both IE and Mozilla and I am going crazy trying to figure this out. I am new to JavaScript so I don't know what to do to make it work. Any help would be much appreciated. The code is following:
Thanks,
This is the Script in the Head:
<style type="text/css">
<!--
a.ln
{
font-family: "Times New Roman";
font-size: 11pt;
color: #006699;
}
a.ln:hover
{
font-family: "Times New Roman";
font-size: 11pt;
color: #6699CC;
}
span.txt
{
font-family: "Times New Roman";
font-size: 12pt;
color: #6699CC;
}
.box
{
border: solid 1px #000000;
height: 300;
width: 400;
color: #FFFFCC;
}
-->
</style>
<script language="javascript" type="text/javascript">
/*****************************************************
THIS FUNCTION WILL GENERATE THE PREVIEW. IT TAKES 5
ARGUMENTS. THE FIRST ARGUMENT IS REQUIRED. OTHERS ARE
OPTIONAL.
******************************************************/
function showPreview(url, border, width, height, desc)
{
border = typeof(border) == "defined" ? 0 : border;
width = typeof(width) == "defined" ? 400 : width;
height = typeof(height) == "defined" ? 300 : height;
desc = typeof(desc) == "defined" ? "" : desc;
document.getElementById("sp").innerHTML = '<url + '" border="' + border + '" width="' + width + '" height="' + height '">' + desc;
}
/***************************************************
THIS FUNCTION WILL CLEAR THE GENERATED PREVIEW. IT
DOES NOT TAKE ANY ARGUMENTS.
****************************************************/
function clearPreview()
{
document.getElementById("sp").innerHTML = "Move you mouse over a link to generate a preview.";
}
//-->
</script>
This Script is in the Body:
<!-- CALLING THE imgPreview() FUNCTION WITH ALL PARAMETERS -->
<center>
<p><span id="sp" class="txt"><font size="4">Move you mouse over a link to generate a preview.</font></span></p>
<p>
<a href="http://home.amm.org/ecard/default.asp" onMouseOver='showPreview("Choose from several designs, including a card to send to someone in the military, each with a spiritual greeting, and space to add your own message.", 0, 400, 300, "Choose from several designs, including a card to send to someone in the military, each with a spiritual greeting, and space to add your own message.");' onMouseOut="clearPreview();" class="ln" title="Choose from several designs, including a card to send to someone in the military, each with a spiritual greeting, and space to add your own message.">Send an e-card to brighten up someone's day</a>
<a href="http://home.amm.org/submissions/tribute" onMouseOver='showPreview("Honor or commemorate that special person in your life with a Tribute Gift to our Lady’s Association. You and your loved one will share in the prayers of the Vincentian community.", 0, 400, 300, "Honor or commemorate that special person in your life with a Tribute Gift to our Lady’s Association. You and your loved one will share in the prayers of the Vincentian community.");' onMouseOut="clearPreview();" class="ln" title="Honor or commemorate that special person in your life with a Tribute Gift to our Lady’s Association. You and your loved one will share in the prayers of the Vincentian community."><br>
Remember Someone with a Tribute Gift</a>
Thanks,
This is the Script in the Head:
<style type="text/css">
<!--
a.ln
{
font-family: "Times New Roman";
font-size: 11pt;
color: #006699;
}
a.ln:hover
{
font-family: "Times New Roman";
font-size: 11pt;
color: #6699CC;
}
span.txt
{
font-family: "Times New Roman";
font-size: 12pt;
color: #6699CC;
}
.box
{
border: solid 1px #000000;
height: 300;
width: 400;
color: #FFFFCC;
}
-->
</style>
<script language="javascript" type="text/javascript">
/*****************************************************
THIS FUNCTION WILL GENERATE THE PREVIEW. IT TAKES 5
ARGUMENTS. THE FIRST ARGUMENT IS REQUIRED. OTHERS ARE
OPTIONAL.
******************************************************/
function showPreview(url, border, width, height, desc)
{
border = typeof(border) == "defined" ? 0 : border;
width = typeof(width) == "defined" ? 400 : width;
height = typeof(height) == "defined" ? 300 : height;
desc = typeof(desc) == "defined" ? "" : desc;
document.getElementById("sp").innerHTML = '<url + '" border="' + border + '" width="' + width + '" height="' + height '">' + desc;
}
/***************************************************
THIS FUNCTION WILL CLEAR THE GENERATED PREVIEW. IT
DOES NOT TAKE ANY ARGUMENTS.
****************************************************/
function clearPreview()
{
document.getElementById("sp").innerHTML = "Move you mouse over a link to generate a preview.";
}
//-->
</script>
This Script is in the Body:
<!-- CALLING THE imgPreview() FUNCTION WITH ALL PARAMETERS -->
<center>
<p><span id="sp" class="txt"><font size="4">Move you mouse over a link to generate a preview.</font></span></p>
<p>
<a href="http://home.amm.org/ecard/default.asp" onMouseOver='showPreview("Choose from several designs, including a card to send to someone in the military, each with a spiritual greeting, and space to add your own message.", 0, 400, 300, "Choose from several designs, including a card to send to someone in the military, each with a spiritual greeting, and space to add your own message.");' onMouseOut="clearPreview();" class="ln" title="Choose from several designs, including a card to send to someone in the military, each with a spiritual greeting, and space to add your own message.">Send an e-card to brighten up someone's day</a>
<a href="http://home.amm.org/submissions/tribute" onMouseOver='showPreview("Honor or commemorate that special person in your life with a Tribute Gift to our Lady’s Association. You and your loved one will share in the prayers of the Vincentian community.", 0, 400, 300, "Honor or commemorate that special person in your life with a Tribute Gift to our Lady’s Association. You and your loved one will share in the prayers of the Vincentian community.");' onMouseOut="clearPreview();" class="ln" title="Honor or commemorate that special person in your life with a Tribute Gift to our Lady’s Association. You and your loved one will share in the prayers of the Vincentian community."><br>
Remember Someone with a Tribute Gift</a>