forums
You are not logged in.
Hi guys, first post here.
I am really keen to use this menu system in a few pages that I will eventually make.
I have used the samples inside the zipped download, in particular the one I am interested in is the non-permanent one. When I use the sample of this one it all works fine. However when I try to merge this into my own page it just plain doesnt work.
What I have tried:-
Copy and pasted working sample html code into a file called menutest.php
changed the paths to point to the *.js files
here is the code i am using
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>SmartMenus example</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="./javascripts/images/examples.css" />
<script type="text/javascript" language="JavaScript">
<!--
function s_show(){
return false
}
function s_hide(){
return false
}
if(window.event+''=='undefined')
event=0
//-->
</script>
</head>
<body>
<script type="text/javascript" language="JavaScript1.2" src="s_loader.js"></script>
<!-- Sample Horizontal Toolbar -->
<table id="toolbarHolder" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td id="helpCell"><a href="blah.html" onmouseover="s_show('profile',event)" onmouseout="s_hide()">
<img src="Javascripts/images/help.gif"</a></td>
</tr>
</table>
<!-- Sample Horizontal Toolbar -->
<p style="margin-top:140px;"><img src="./javascripts/images/big_logo.gif" alt="SmartMenus logo" /><br />version: 5.5.2</p>
<div class="dText"><p>This example uses an image on your page (which may be located anywhere) to position the menus relatively to its position. A sample function in s_arrays.js (the same like the one in the Permanent menus example) is used to get the X and Y position of the image, which is named "getStart" (the "search" image above). The result is right aligned menus, which will always appear at the proper position even if the window is resized. The left position of the last menu is set to 'mouseX+10'- this way it will always be displayed at the right most edge (you can do this by using another method- setting large enough number for left position, for example 3000...). As you can see, the JavaScript expression handling for positioning the menus may be very powerful in certain cases. Use your imagination.</p></div>
<p id="homeLink"><a href="http://www.smartmenus.org/" target="_blank">The most advanced DHTML menu and JavaScript menu.</a></p>
</body>
</html>
//this is code from the s_arrays.js
// === 4 === MENU DEFINITIONS
s_add(
{
N:'Profile', // NAME
LV:1, // LEVEL (look at IMPORTANT NOTES 1 in the Manual)
MinW:130, // MINIMAL WIDTH
T:'s_getStart("y")+15', // TOP (look at IMPORTANT HOWTOS 6 in the Manual)
L:'s_getStart("x")', // LEFT (look at IMPORTANT HOWTOS 6 in the Manual)
P:false, // menu is PERMANENT (you can only set true if this is LEVEL 1 menu)
S:s_CSSTop // STYLE Array to use for this menu
},
[ // define items {U:'url',T:'text' ...} look at the Manual for details
{U:'http://www.google.com/',T:'Google'},
{U:'http://www.altavista.com/',T:'Altavista'},
{U:'http://www.search.com/',T:'CNET Search.com'},
{U:'http://www.lycos.com/',T:'Lycos'},
{U:'http://www.hotbot.com/',T:'Hotbot'}
]
);
In firefox 1.5 the javascript error is " s_[n] has no properties
I apologise if I haven't read the instructions properly I tyhoguht I could fiddle the sample code to work and then modify it to suit my needs.
thanks for any help given!
[/i]
Offline
Hi,
Well, I found something wrong which is most probably causing the issue. In the HTML code you have the following:
<a href="blah.html" onmouseover="s_show('profile',event)"...
and in the configuration file (s_arrays.js) the following:
s_add(
{
N:'Profile', // NAME
Please note that the names of the menus are case-sensitive. Which means that you have either use "Profile" at both places or "profile".
Please fix this and check whether it will work. If it still doesn't work, it would be much easier (for me and hopefully for you) if you could send me a small ZIP-ed example which I could configure pretty easily.
And please don't hesitate to post any questions whenever you have problems with the script.
Offline