473,721 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Follow-up: "Mouse-Over" Drop-Down Menus

I have them working now, courtesy of the link given in the prior thread--the
HVMenu over at Dynamic Drive myself.

http://www.dynamicdrive.com

I have them working as side-bar menus, not horizontal ones on TOP of the
page.

I figured it out and have it working fine, except for one thing--apparently
I need to insert the code for the menu for every last HTML file I have
practically.

This is not a big deal except that some of them are in different folders,
and thus many of the links don't work in the other locations because they're
"relative" links as opposed to "absolute" links. I figured that was the
better way--after all--with (as an example) img src tags in HTML, you also
just say "images/pic.jpg" rather than
http://www.mywebsite.com/sports/images/pic.jpg.; as long as the "relative"
location is right, it works. Plus, if you have a "contact us" page named
"contact_us.htm l" you also just say <a href="contact_u s.html">Contact Us</a>
as opposed to <a
href="http://www.mywebsite.c om/main/tutorials/contact_us.html ">Contact
Us</a>.

Problem is, with the existence of the other folders the relative links don't
work in those locations.

It looks as though the thing to do is (a) make them absolute links--which
will then suck if I ever move the webpages to another domain etc or (b)
maintain different JS files for each folder--this would result in extra work
anytime I add new links (I'd have to add them to all the extra
exmplmenu_var.j s files) or (c) create this with frames.

That is, with (c), have the menus in a left-hand side page with everything
opening on the right-hand side in a "frames" page. The problem with this,
though, is that when you go 2-3 levels deep you run out of space in the left
frame, and it gets ugly. Also, the special instructions given for if you
want to design them in a frameset--frankly, I'm not getting them.

Tips?

LRH
Jul 23 '05 #1
4 2339
On Thu, 19 Aug 2004 02:08:15 -0700, Larry R Harrison Jr <no***@noone.co m>
wrote:

[snip]
It looks as though the thing to do is (a) make them absolute
links--which will then suck if I ever move the webpages to another
domain etc or (b) maintain different JS files for each folder--
this would result in extra work anytime I add new links (I'd have to add
them to all the extra exmplmenu_var.j s files) or (c) create this with
frames.

That is, with (c), have the menus in a left-hand side page with
everything opening on the right-hand side in a "frames" page. The
problem with this, though, is that when you go 2-3 levels deep you run
out of space in the left frame, and it gets ugly. Also, the special
instructions given for if you want to design them in a
frameset--frankly, I'm not getting them.

Tips?


You could try absolute URIs without the domain. If a URI starts with a
slash, it is interpreted relative to the current domain. This would allow
you place all of your site-wide scripts in a certain directory and the
path would be the same for all pages. For example,

http://www.site.org/js/script.js

can be referred to throughout using

/js/script.js

Even if you don't actually have a domain (you're hosted in a
subdirectory), this can still work. If you had to move hosts, all it would
take is a global search-and-replace of the front portion of the path
(unless you can use the same subdirectory). Not ideal, but not that hard,
either.

Finally, whatever you do, don't use frames. :D

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #2
In article <16_Uc.10110$yh .8485@fed1read0 5>, no***@noone.com enlightened us
with...

I figured it out and have it working fine, except for one thing--apparently
I need to insert the code for the menu for every last HTML file I have
practically.

This is why using templates for your pages is a good idea. You change the
template and all pages that use it are updated automagically. I like
Dreamweaver. You can get DWMX off Ebay for like $100. IMO, it's well worth
the money. I can redesign my template and update my whole site (hundreds of
pages) in minutes.
DWMX also takes care of the link issue - it makes the links for you. Change
the location of a file and it updates all the links appropriately. It also
has a function called "change links sitewide" (or something similarly
phrased) that lets you change all links from one spot to another.
I never want to develop and maintain a large site without DW.

That is, with (c), have the menus in a left-hand side page with everything
opening on the right-hand side in a "frames" page. The problem with this,
though, is that when you go 2-3 levels deep you run out of space in the left
frame, and it gets ugly. Also, the special instructions given for if you
want to design them in a frameset--frankly, I'm not getting them.


IMO, frames suck major ass for internet sites, but my intranet app uses them
and it uses HVMenu. What don't you get? I have a top frame, a left frame
where the menu is, and a main frame. The menu pops into the main frame. The
frames are invisible to my users.
The appropriate lines from my files:
=============== =============== =============== =============== ============
exmplmenu_var.j s:
var FirstLineFrame= 'leftFrame'; // Frame where first
level appears
var SecLineFrame='m ainFrame'; // Frame where sub
levels appear
var DocTargetFrame= 'mainFrame'; // Frame where target
documents appear
var TargetLoc='myMe nu'; // span id for relative
positioning

=============== =============== =============== =============== ============
frameset:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Order Processing System</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<%
// get the value of the session var that tells us the name of the frame to
load. If none, loads home.jsp
Object pageToLoad = session.getAttr ibute("page");
if (pageToLoad == null)
{
pageToLoad = "home.jsp";
}
%>
<frameset rows="51,*" cols="*" frameborder="no " border="0" framespacing="0 "
class="f">
<frame src="top.jsp" name="topFrame" scrolling="no" noresize >
<frameset cols="83,*" frameborder="no " border="0" framespacing="0 "
class="f">
<frame src="left.jsp" name="leftFrame " scrolling="no" noresize>
<frame src="<%= pageToLoad %>" name="mainFrame ">
</frameset>
</frameset>
<noframes><body >

</body></noframes>
</html>
=============== =============== =============== =============== ============
left.jsp (left frame):
<base target="mainFra me">
<script language="javas cript">
function go(){return}
</script>
<script language="javas cript" src="exmplmenu_ var.js"></script>
<script language="javas cript" src="menu_com.j s"></script>
<div name="myMenu" id="myMenu" style='position :absolute; top:-1; left:0;
width:83px; height:18px;'>< img src='spacer.gif ' width='82' height='18'></div>
<p>&nbsp;</p>
=============== =============== =============== =============== ============
In every page that loads in main frame:
<script language="javas cript" type="text/javascript">
function doLoad()
{
// check that this is in the frameset properly
if (typeof parent.frames['topFrame'] != "object")
{
// reload
top.location.hr ef="index.jsp" ;
}
else
{
parent.frames['topFrame'].document.locat ion.reload();
if(parent.frame s[0]&&parent.fra mes['leftFrame'].Go)
{
parent.frames['leftFrame'].Go();
}
}
}

</script>
....

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0 "
bgcolor="#fffff f" onload="doLoad( )" onunload="if (parent.frames['leftFrame'])
parent.frames['leftFrame'].UnLoaded()">
=============== =============== =============== =============== ============

Hope this helps.

--
--
~kaeli~
The secret of the universe is @*&^^^ NO CARRIER
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #3
Another option that you have, if you have some control over
you web server, is to "rewrite" a file('s name). In particular,
if you give your javascript file some unique name (that you
won't accidentally duplicate in the future), then you can get
your web (http) server to use a specific file whenever you get
any request for that specific file name. In this case, you would
not prefix that javascript file name with any slashes or directory
names (which is what your question was about).

If you are using Apache, you could check out a module called
mod_rewrite. Note that I am not actually recommending it for
your particular situation, but I do mention it as a viable option.
It's a useful technique in general, and it works well. However,
you will have a steep learning curve in front of you if you go down
this path. Consider yourself warned.

As another poster implied, whatever you do, you write yourself
into one solution which could present complications if you port your
files. In this case, the risk would be that you moved to another
server where you couldn't duplicate the rewriting section you'd be
creating.

In a working example, which is beyond the scope of what you
are doing, I need to generate a custom .js file for each request,
so the .js file is actually a .php file (a custom program running on
the web server) which does what it needs to do and then returns a
javascript file:

httpd.conf contains:
<Directory C:/WebDirectory/Viewer>
RewriteEngine on
RewriteRule ^(tab|col)List. js$ $1List.php [NC,L]
</Directory>

In your case, you would not be restricting this type of rewriting
to a particular directory. The important line, by the way, is
the RewriteRule, which takes a request for tabList.js or colList.js
and transforms it to tabList.php or colList.php, respectively
and then executes that file.

Good luck,
Csaba Gabor from Budapest

"Larry R Harrison Jr" <no***@noone.co m> wrote in message
news:16_Uc.1011 0$yh.8485@fed1r ead05...
I have them working now, courtesy of the link given in the prior thread--the HVMenu over at Dynamic Drive myself.

http://www.dynamicdrive.com

I have them working as side-bar menus, not horizontal ones on TOP of the
page.

I figured it out and have it working fine, except for one thing--apparently I need to insert the code for the menu for every last HTML file I have
practically.

This is not a big deal except that some of them are in different folders,
and thus many of the links don't work in the other locations because they're "relative" links as opposed to "absolute" links. I figured that was the
better way--after all--with (as an example) img src tags in HTML, you also
just say "images/pic.jpg" rather than
http://www.mywebsite.com/sports/images/pic.jpg.; as long as the "relative"
location is right, it works. Plus, if you have a "contact us" page named
"contact_us.htm l" you also just say <a href="contact_u s.html">Contact Us</a> as opposed to <a
href="http://www.mywebsite.c om/main/tutorials/contact_us.html ">Contact
Us</a>.

Problem is, with the existence of the other folders the relative links don't work in those locations.

It looks as though the thing to do is (a) make them absolute links--which
will then suck if I ever move the webpages to another domain etc or (b)
maintain different JS files for each folder--this would result in extra work anytime I add new links (I'd have to add them to all the extra
exmplmenu_var.j s files) or (c) create this with frames.

That is, with (c), have the menus in a left-hand side page with everything
opening on the right-hand side in a "frames" page. The problem with this,
though, is that when you go 2-3 levels deep you run out of space in the left frame, and it gets ugly. Also, the special instructions given for if you
want to design them in a frameset--frankly, I'm not getting them.

Tips?

LRH

Jul 23 '05 #4
>
This is not a big deal except that some of them are in different folders,
and thus many of the links don't work in the other locations because they're
"relative" links as opposed to "absolute" links.


../javascript/script.js
Also, you can go up a level with the .. and then come down with the /
Robert
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1896
by: yuval | last post by:
Hi DragDrop event is fired by the control accepting the drop If the drop is performed outside the controls I'm watching with events (like on another control/panel/window or outside my app) is there a way for me to know about it? (In MFC, for example, mouse movements are captured) Or do I just have to follow DragEnter/DragLeave and deduce from that?
1
1073
by: Frank | last post by:
Hello, drag and drop works fine, but it differs from VB6. In VB6 when I drag a control the control follows the mouse. Am I correct in the assumption that in VB.NET I myself have to change the controls top/left attributes (in the mousemove event) to let it follow the mouse? Thanks Frank
2
1647
by: Charlie Brown | last post by:
Good day, I have been tasked with a new application that needs to show a graphical representation of boxes on a shelf. It needs to have the ability to rearrange the boxes of different sizes by dragging and dropping them into place. Basically an updateable diagram of many racks which contain mutiple shelfs. Each shelf has X amount of space and you need to be able to drag and drop "boxes" onto the shelf. To the question: I am looking...
6
1256
by: Joel Hedlund | last post by:
Hi! I've been thinking about writing a good multiple sequence alignment (MSA) viewer in python. Sort of like ClustalX, only with better zoom and pan tools. I've been using python in my work for a couple of years, but this is my first shot at making a GUI so I'd very much appreciate some ideas from you people to get me going in the right direction. Despite my GUI n00b-ness I need to get it good and usable with an intuitive look and feel.
5
13793
by: Romulo NF | last post by:
Greetings, I´m back here to show the new version of the drag & drop table columns (original script ). I´ve found some issues with the old script, specially when trying to use 2 tables with drag&drop on the same page (which was not possible). Now i´ve a new concept of the script, more object oriented. I´ve also commented the whole code so you guys can easier understand it engine. What exactly we need when trying to make a column drag &...
0
8858
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9148
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8026
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5994
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4499
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4762
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3207
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2146
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.