Hi All,
I am stuck. I am not actually writing any code but I am
inserting Javascript into my web page from resources on the net. I have a Dynamic Drive fold out Menu & a javascript pop up message on my page. Both scripts work fine individually but they will not work together. I get error’s on page warnings and the menu does not appear.
<HEAD>
<script type=”text/javascript”>
<!–
/*
This code is from Dynamic Web Coding
at [url]http://www.dyn-web.com/
Copyright 2001-2 by Sharon Paine
See Terms of Use at [url]http://www.dyn-web.com/bus/terms.html
Permission granted to use this code
as long as this entire notice is included.
// dw_tooltip.js contains onresize and onload handlers
// Put tooltip div and script tags for external js files at end of document
// avoid error of passing event object from link in older browsers
if (!document.getElementById && !document.all && !document.layers)
event = “”;
function hideTip() {} // avoid errors until loaded
var tooltip;
function doTooltip(evt,txt) {
if (!tooltip) return;
var cntnt = wrapTip(txt);
goTooltip(evt,cntnt);
}
// wrap tip content for formatting
function wrapTip(txt) {
var cntnt = “”;
if (document.layers) {
cntnt = ‘<table bgcolor=”‘ + tipBorderColor + ‘” width=”‘ + tipWidth + ‘” cellspacing=”0″ cellpadding=”‘ + tipBorderWidth + ‘” border=”0″><tr><td><table bgcolor=”‘ + tipBgColor + ‘” width=”100%” cellspacing=”0″ cellpadding=”‘ + tipPadding + ‘” border=”0″><tr><td><div style=”font-family:’ + tipFontFamily + ‘; font-size:’ + tipFontSize + ‘; color:’ + tipFontColor + ‘;”>’ + txt + ‘</div></td></tr></table></td></tr></table>’;
} else cntnt = txt;
return cntnt;
}
/////////////////////// CUSTOMIZE TOOLTIP HERE ///////////////////////
// settings for tooltip (don’t remove any of these variables!)
// Do you want tooltip to move when mouse moves over link?
var tipFollowMouse = true;
// be sure to set tooltip width wide enough for widest image!
// take into account border and padding
var tipWidth = 240; // width of tooltip in pixels
// how far from mouse to show tooltip
var tipOffX = 8; // horizontal offset
var tipOffY = 12; // vertical offset
var tipFontFamily = “Verdana, arial, helvetica, sans-serif”;
var tipFontSize = “11px”; // string with pixels or points (px or pt)
// tooltip content line-height
var tipLineHeight = 1.2; // number (recommend 1 to 1.3)
var tipFontColor = “#000000”;
var tipBgColor = “#d6e4fc”; // tooltip background color
// background image for tooltip (leave empty string if no bg image)
var tipBgImg = “”;
// “breathing room” around tooltip content
var tipPadding = 4; // integer (pixel value)
// leave a color in here even if you don’t want a border
var tipBorderColor = “#000080”;
// if you don’t want a border, set tipBorderWidth to 0
var tipBorderWidth = 1; // integer (pixel value)
// if you don’t want a border, set tipBorderStyle to “none”
// options for border style: “none”, “solid”, “ridge”, “outset”,
// “inset”, “groove”, “double”, “dashed”
// (they won’t look the same in all browsers though!)
var tipBorderStyle = “groove”;
// NOTES:
// Adding a large amount of padding and thick borders will
// result in a noticeable difference in the tooltip width
// between browsers that are standards-compliant and those
// that are not. For best results, keep these values small.
// Background image, line-height and border style settings
// for the tooltip are not supported for ns4.
// preload images to be placed in tooltip
// place your images in this array
var imgAr = new Array(
“images/sm-duck.gif”
);
if (document.images) {
var imgs = new Array();
for (var i=0; i<imgAr.length; i++) {
imgs[i] = new Image();
imgs[i].src = imgAr[i];
}
}
// variables for tooltip content
// name them whatever you want, add as many as you need
var tip1 = “An example link for the tooltip using plain text.”;
var tip2 = ‘<img src=”images/sm-duck.gif” width=”90″ height=”44″ alt=”” border=”0″><div class=”tp1″>Images and text can go together in a tooltip.</div>’;
var tip3 = ‘A link to Dynamic Web Coding would be appreciated!’;
//–>
</script>
</HEAD>
<BODY>
<td class=”tiny”><a href=”your.html” onmouseover=”doTooltip(event,tip1)” onmouseout=”hideTip()”>link</a></td>
<div id=”tipDiv” style=”position:absolute; visibility:hidden; left:0; top:0; z-index:1000″></div>
<script src=”dw_core.js” type=”text/javascript”></script>
<script src=”dw_util.js” type=”text/javascript”></script>
<script src=”dw_tooltip.js” type=”text/javascript”></script>
<div id=”pLayer” style=”position:absolute; width:200; visibility:hidden; z-index:200″>
</div>
The Menu code is;
<BODY>
<script type=’text/javascript’>
//HV Menu v5.411- by Ger Versluis ([url]http://www.burmees.nl/
//Submitted to Dynamic Drive ([url]http://www.dynamicdrive.com
//Visit [url]http://www.dynamicdrive.com
function Go(){return}
</script>
<script type=’text/javascript’ src=’exmplmenu_var.js’></script>
<script type=’text/javascript’ src=’menu_com.js’></script>
<noscript>Your browser does not support script</noscript>
If it is more help the URL is;
[url]http://www.artdiscount.com/acatalog/temp_page2.htm
The pop up message is working but the menu isn’t.
Many thanks in advance.
Regards
Stevie.