drop down menu

R

rf

aa

rf said:
Please quote the bit where I said that javascript was not supported by
browsers.
You can't, because I did not. Once again you have misread a post.

I just cannot understand, my friend, what you are hoping for. That your
posts has been deleted?
Here you go - enjoy reading your own writing and please be advised that this
is the first and the last time I take trouble to dig through your
gobbledegegook to prove you what you are. Next time you will have just to
believe me:

OK, you have found the post where I talked about javascript. Now please
underline the bit where I said javascript was not supported by browsers.

Here, I'll even single out the relevant paragraph for you:

<quote>
There are no *valid* statistics but it is estimated that somewhere between 7
and 15 % of viewers do not/can not support javascript, the reason being
immaterial. For them the site becomes unusable.
</quote>

Now, to I say anywhere in there that javascript is not supported by a
particular browser, or any browser for that matter?

No, I did not. I said the a percentage of *VIEWERS* do not/can not support
javascript.

Hint: One possible reason is that their employer, who owns the computer they
are using, has disallowed javascript. This is something beyond the viewers
control. However it is *NOT* a browser issue and that is what you were
bleating about.

You are not just an idiot, you are a fucking idiot.

I, like brucie, do not use a killfile. It's sometimes entertaining watching
the fucking idiots bleating. However I too, like brucue, will never again be
replying to any of your posts, other than to point out the errors in them.

BTY note how your use of multipart/HTML has stuffed up my newsreader, so it
does not quote your post correctly. And don't bleat about me using the wrong
newsreader. Check my headers (if you can) and determine that at the moment I
am using exactly the newsreader you have recommended in another thread. When
in Rome don't piss on the floor, it annoys the locals.
 
W

WebcastMaker

I just cannot understand, my friend, what you are hoping for. That your posts has been deleted?
Here you go - enjoy reading your own writing and please be advised that this is the first and the last time I take trouble to dig through your gobbledegegook to prove you what you are. Next time you will have just to believe me:
Using javascript for something as mission critical as site navigation is an
extremely bad business decision.
There are no *valid* statistics but it is estimated that somewhere between 7
and 15 % of viewers do not/can not support javascript, the reason being
immaterial. For them the site becomes unusable.

rf was not referring to the "browser" but to the user. And indeed there
are some that "do not" and some that "can not" Norther trust Investment
funds was one such company that did not allow Javascript.

You know arguing for the sake of arguing make you appear to be a troll.
Are you?
 
A

aa

Tens, perhaps hundreds, of thousands of people commit suicide every year.
That doesn't mean you'll catch me doing it.

Thanks for good point that escaped me, thought this is exactly what I meant
in my previous message.

Of several billions hundreds, of thousands of people commit suicide
And we are not following them

Likewise of millions of professional websites perhaps hundreds do not use
Javascript for menu.
Yopu do not suggest following them, do you, Mikky?

Foolishness aside, you obviously don't understand what I wrote. I said
"not to rely on JavaScript". That doesn't mean never use it, it means
don't rely on it. A menu system can use Javascript to enhance it, but the
menu should be usable without any scripting.

A miserable attempt to play with words in order to get out of funny position
you got yourself into.
Foolishness aside, what exacly means "A menu use Javascript to enhance it,
but the menu should be usable without any scripting"?

Could you please refer me to a menu somewhere in the Internet, which "uses
Javascript to enhance it, but is usable without any scripting"? RF here
boasted he could write such a thing. Obviously this takes time as a week
passed and still no menu, though rf spends considerable time here. And most
probably he will come up with the same thing which the OP offered here.

How JS can enhance a menu without being a part of its functionality? Aha, I
see. You can use JS in menu to, say, change the item background color, and
if a browser does not support script (you mean a self-made browser?) the
color simply would not change - is that what you mean?
 
A

aa

My wife works for the uk government as
a civil servant and all their work computers have javascript turned off
by default and I should imagine that's a lot of computers.

This explains why Her Majesty Government ended up in a mess with the Iraq
War Intellegence.
In the Internet era most of intellegence is gathered by analysing info from
the Internet and with JavaScript disabled on your computer you might see a
complete mess on the screen, which with certain amount of imagination one
can take for a Weapons of Mass Distruction.

Yet they obviously made great breakthrough in another field - how do they
managed to turn off JavaScript on a network of computers? I understand they
might uninstall browsers, but how do they turn off JavaScript on computers?
 
A

aa

between 7
rf was not referring to the "browser" but to the user.

1. I see. So in rf's message above "viewers" mean "users" and the rf's message should read

" between 7 and 15 % of user do not/can not support javascript" - i.e. it's users who support or not support scripts. I hope rf will thank you for such a "help".

You know arguing for the sake of arguing make you appear to be a troll.

2. You have just proven that. See para 1 above.

But you right - the fun is over and talking to all these rfs bacomes boring. I'll deliver the Friday pizza to all who ordered and quit. Drinking beer is better
 
A

aa

OK, you have found the post where I talked about javascript. Now please
underline the bit where I said javascript was not supported by browsers.

Hi, my friend, how are you today?
As I've just said, I am not going to dig any more in your creative writing.
The only conclusion one can draw from your sagas is that you call upon your listeners not to use JS in menu because it is not supported by 100% of existing browsers. I appreciate your humour, but when the same joke is overused it stops being fun, so I am not arguing with you on that any more. Everybody who is interested to know the truth, does need to listen to you or to me. Just go onto the Web and see what menus are there.


You are not just an idiot, you are a fucking idiot It's sometimes entertaining watching the fucking idiots bleating.

Language usually reflects a person's intelligence. Congratulation! You scored high!

I, like brucie

I noticed, that you are like brucie - I even called you two twins.

, do not use a killfile.

It is good that I have no idea what killfile is though you use it excessively in every message. Perhaps something unpleasant, so better not to ask.

BTY note how your use of multipart/HTML has stuffed up my newsreader

O, I am so sorry, rf. Can I do anything to help you?

However I too, like brucue, will never again be replying to any of your posts,

It is news for me that brucue does not reply my posts. Are you sure? he has always been the most helpful. Together with you he never let any post of mine to go unattended.
BTW, I was skipping over "Brucie of Brucie's Buttons", for the title was very boring, but today accidentally I clicked on it and could not move in amazement. The list of postings took two screens to scroll, and the posters are mainly my best friends - rf, brusue, Toby etc.
I could not read past several first messages, but opened another one in the middle and another one at the end - the same verbal diarrhea. You are really succeeding in turning a professional forum into a sexually oriented chat.
And I feel shame. Yesterday I made a joke about brucie's sexual disorder - now I see how close my joke was to reality - he is a sick man and it is a sin to laugh at a sick person. The rest of the team probably are not far from you two and I therefore better retire. Unlike yourself and your friends I cannot blah-blah-blah for more than a week.
I excuse everyone whom I hurtled inadvertently
Take care
 
R

Robert Frost-Bridges

aa said:
Yet they obviously made great breakthrough in another field - how do
they managed to turn off JavaScript on a network of computers? I
understand they might uninstall browsers, but how do they turn off
JavaScript on computers?

I don't know how they did it I've never done any sysadmin on a network
so I wouldn't know what can be done or can't. It was just something she
had mentioned.
 
R

RobM

You are not just an idiot, you are a fucking idiot It's sometimes
entertaining watching the fucking idiots bleating.
Language usually reflects a person's intelligence. Congratulation! You
scored high!

RF has high intelligence? Yes I thought so too after all the helpful advice.


Cheers
RobM
 
M

Michael Winter

[snip]
Likewise of millions of professional websites perhaps hundreds do not
use Javascript for menu.
Yopu do not suggest following them, do you,

If you read my last post properly, you'd know the answer to that question.
I have no problem with the use of Javascript menus, as long as the menu
does not depend upon Javascript.

The question mark there is quite appropriate. Where have you seen me
addressed as Mikky? My name is Michael.

[MW:]
A miserable attempt to play with words in order to get out of funny
position you got yourself into.

What position would that be? What "attempt to play with words" am I making?

My statements are quite clear. No word play. No attempts to make excuses.
Foolishness aside, what exacly means "A menu use Javascript to enhance
it, but the menu should be usable without any scripting"?

A menu can use Javascript to tweak positioning and make it look
attractive, for example. It should not rely on it to actually provide
navigation. If I have scripting disabled, I will want to navigate a site
just like every other visitor, so the menu must degrade gracefully and
allow that.
Could you please refer me to a menu somewhere in the Internet, which
"uses Javascript to enhance it, but is usable without any scripting"?

Not really. The vast majority of Javascript menus are badly written. I've
only encountered two that, in my opinion, are remotely good. One is used
on the Netscape DevEdge website, and the other is linked from an article
on that site. However, I haven't been able to access DevEdge for over a
week.
RF here boasted he could write such a thing. Obviously this takes time
as a week passed and still no menu, though rf spends considerable time
here. And most probably he will come up with the same thing which the OP
offered here.

I began writing one some time ago, but I haven't touched it in over a
month. I haven't had the time and supporting code needs to be reworked as
it contains bugs. If I do ever finish it, I'll be posting it to
comp.lang.javascript for peer review.
How JS can enhance a menu without being a part of its functionality?
Aha, I see. You can use JS in menu to, say, change the item background
color, and if a browser does not support script (you mean a self-made
browser?) the color simply would not change - is that what you mean?

That is part of it. Basically, you start with properly marked-up HTML -
generally an unordered list. Once you've established using feature
detection that the browser supports the methods you'll need, you then
modify that mark-up using the DOM and create your desired menu. If the
features aren't available, you'll have a less-than-ideal result, but it
will still be accessible.

Another decision that I haven't quite worked out yet is the extent to
which you can style the menu with CSS. With decent browsers like Mozilla
and Opera, you can create a drop-down menu with CSS 2 and a unordered
list, and no scripting at all. Unfortunately, IE doesn't support this, so
you'd end up with most of the menu items hidden. Therefore, do you give
the menu some basic styling leaving all the items in view, or do you make
IE users suffer? The number of IE users out there would rule out the
latter, certainly.

It's not a simple thing to make a well-written menu, which is why they're
hard to find. One of the biggest problems I remember having is with early
Mozilla versions. They use the width of the top-level menu item to
determine what counts as "over" the sub menu and all its children, not the
sub menu items themselves. This wasn't fixed until v1.7 I think, and the
latest Mozilla version is 1.7.3.

Mike
 
R

RobM

Michael Winter said:
[snip]

A menu can use Javascript to tweak positioning and make it look
attractive, for example. It should not rely on it to actually provide
navigation. If I have scripting disabled, I will want to navigate a site
just like every other visitor, so the menu must degrade gracefully and
allow that.
How JS can enhance a menu without being a part of its functionality?

That is part of it. Basically, you start with properly marked-up HTML -
generally an unordered list. Once you've established using feature
detection that the browser supports the methods you'll need, you then
modify that mark-up using the DOM and create your desired menu. If the
features aren't available, you'll have a less-than-ideal result, but it
will still be accessible.


Mike

Hi Mike. Thanks for the post - an excellent reply. One example (on not
relying on the JavaScript) I've a web app that returns a list of items after
a search. There is a column 'view' that is a link. Hover over the view and a
js coloured area appears with a list of links of all the documents for that
item they can view. User can move to the coloured area (normally display
none div) and click on a link and view the document. If javascript
disabled/not available, then user can instead of hovering over the view link
just click on it (as normal) and new page appears showing list of document
links (same as what would have been in main page in the appearing js
coloured area). So if not js available, its just an extra page to go
through, if it is available, saves the extra page. But doesnt depend upon
js. (aa see the difference?). Hope that's an ok example (what I've
implemented) of what the groups means when not relying on js.

Cheers
RobM
Melbournce, nearly cup time
 
T

Toby Inkster

Michael said:
Not really. The vast majority of Javascript menus are badly written.
I've only encountered two that, in my opinion, are remotely good. One is
used on the Netscape DevEdge website, and the other is linked from an
article on that site.

The DevEdge one is indeed good, and it's what I normally point to when
this question comes up (as it tends to in this group about once per
fortnight!)

Here's an example of a (non-drop-down) menu that uses Javascript to
enhance the behaviour, but will work in a non-JS browser:

http://examples.tobyinkster.co.uk/menu/menu2

I can't remember in which browsers I've tested it, but ISTR that it works
in recent Trident-, Presto- and Gecko-based browsers.

There is an adaptation of it here:

http://www.nctpregnancyandbabycare.com/nct-online/baw/
 
A

aa

Michael Winter said:
I began writing one some time ago, but I haven't touched it in over a
month. I haven't had the time and supporting code needs to be reworked as
it contains bugs. If I do ever finish it, I'll be posting it to
comp.lang.javascript for peer review.

Seems to take considerable efforts even from two experts like yourself and
rf.
Look, HTML - how long it is around? 10 years? 20 years? Are you saying that
for that period of time millions HTML writers failed to do thet misterious
HTML menu of which you and rf keep dreaming, and you are now inventing a
weel for mankind?
Or perhaps these menus are there, you just are not aware?
Also rf was boasting about writing pure HTML menu (see the quoted above).
Why posting this menu comp.lang.javascript ?
Or you've just lost the thread of the discussion ?
 
M

Michael Winter

[snip]
Seems to take considerable efforts even from two experts like yourself
and rf.

Indeed it does take considerable effort. If it didn't, plenty of good
examples would already exist and I wouldn't have even contemplated rolling
my own (except for the heck of it, perhaps).
Look, HTML - how long it is around? 10 years? 20 years?

The first version of HTML was documented in 1992.
Are you saying that for that period of time millions HTML writers failed
to do thet misterious HTML menu of which you and rf keep dreaming, and
you are now inventing a weel for mankind?

As DOM 2 Style (a prerequisite for a complete implementation) wasn't a
Recommendation until 2000 (even then, browser support would not be
instantaneous), that whole period is irrelevant.
Or perhaps these menus are there, you just are not aware?

It certainly is a possibility. As I said, there are some that come close,
but they still contain practices that should be avoided when producing
robust scripts.
Also rf was boasting about writing pure HTML menu (see the quoted above).

You said he boasted it, but I haven't read such a statement from Richard
in this thread. If it was in another thread, you'll have to point out the
post (by message id) as I'm not going to search for it.
Why posting this menu comp.lang.javascript ?

Are you asking why I said I'd post my menu to c.l.js once (if) I finish
it, or something else?
Or you've just lost the thread of the discussion ?

The *current* discussion regards the reliable implementation of a scripted
drop-down navigation menu. That wasn't the original problem posed by the
OP, but threads often diverge.

Mike
 
R

rf

Michael said:
above).

You said he boasted it, but I haven't read such a statement from Richard
in this thread. If it was in another thread, you'll have to point out the
post (by message id) as I'm not going to search for it.

This aa person has a continuing habbit of totally misreading the content of
others posts and then spectacularly misquoting them.

Here is the relevant portion of my post earlier in this thread (which aa has
misquoted), and where aa obtains this delusion that I am boasting about
something:

aa said:
You cannot make a decent menu with just classic HTML.

rf said:
Oh yes I can. And what is "classic" HTML? As opposed to [some other sort of]
HTML?

I leave you to draw your own conclusions about my "boasting" :)
 
N

Neal

[deleted] said:
You cannot make a decent menu with just classic HTML.

rf said:
Oh yes I can. And what is "classic" HTML? As opposed to [some other sort
of]
HTML?

Don't they have classic HTML shows where you can check out the old
webpages, look under the hood, talk to the hairy old men who are
maintaining them? And they roast a pig too.

Kidding aside, I'm unsure how "decent" is defined for this statement, as
well as "classic". Hell, "menu" as well. This sentence could be true or
false for anyone depending on those details. But I will leave it...
 
M

Michael Winter

On Sat, 16 Oct 2004 13:01:12 +0100, Toby Inkster

[snip]
The DevEdge [menu] is indeed good, and it's what I normally point to
when this question comes up (as it tends to in this group about once per
fortnight!)

Here's an example of a (non-drop-down) menu that uses Javascript to
enhance the behaviour, but will work in a non-JS browser:

http://examples.tobyinkster.co.uk/menu/menu2

You could "improve" (purely from a technical standpoint) the code there.

var menu = (function() {
var active = null,
images = document.images;

function isF(o) {return 'function' == typeof o;}
function isO(o) {return (o && 'object' == typeof o) || isF(o);}
function isS(o) {return 'string' == typeof o;}

function display(i, d) {
var o = null;
/* If the first argument was a string, treat it as an id and
* try to obtain a reference to the respective element.
*/
if(isS(i) && document.getElementById) {
o = document.getElementById(i);
}
/* If the first argument was an object, copy the reference and
* get the id of the respective element.
*/
else if(isO(i)) {
o = i;
i = o.id;
}
if(o) {
/* Change the CSS display property. Use the style object, if
* it's available, but if not, create a property on the
* element itself.
*/
(o.style || o).display = d ? '' : 'none';
/* Change the source for the menu item's expand/contract
* image. The name or id of the image should be the id of the
* menu item prefixed with a lowercase P.
*/
images['p' + i].src = (d ? 'minus' : 'plus') + '.png';
}
}

return {
init : function() {
/* Hide all of the menu sections initially. */
display('m1', false);
display('m2', false);
display('m3', false);
},
expand : function(i) {
/* No matter which item is activated, the currently
* active item will always need to be hidden.
*/
display(active, false);
/* If the user wasn't trying to hide the active item,
* show the one that was just selected.
*/
if(i != active) {display(i, true);}
}
};
});

This would then change the relevant HTML to:

<body onload="menu.init();">

and:

<a ... onclick="menu.expand(this); return false;">

The code itself (without the comments) is quite compact. More adjustments
could be made to make a more flexible system, but the code size would
obviously grow rapidly.

[snip]

Mike
 
M

Michael Winter

Michael Winter wrote:




<snip> ^^ ?

Did you omit the inline call to the outer function expression,

Yes, I did.
or am I missing something?

I certainly was: I didn't actually do anything with the active variable.
Here's a new version:

var menu = (function() {
var active = null,
images = document.images;

function isF(o) {return 'function' == typeof o;}
function isO(o) {return (o && 'object' == typeof o) || isF(o);}
function isS(o) {return 'string' == typeof o;}

var display = document.getElementById ?
function(i, d) {
var o = null;
/* If the first argument was a string, treat it as an id and
* try to obtain a reference to the respective element.
*/
if(isS(i)) {o = document.getElementById(i);}
/* If the first argument was an object, copy the reference and
* get the id of the respective element.
*/
else if(isO(i)) {o = i; i = o.id;}
if(o) {
/* Change the CSS display property. Use the style object, if
* it's available, but if not, create a property on the
* element itself.
*/
(o.style || o).display = d ? '' : 'none';
/* Change the source for the menu item's expand/contract
* image. The name or id of the image should be the id of
* the menu item prefixed with a lowercase P.
*/
images['p' + i].src = (d ? 'minus' : 'plus') + '.png';
}
return o;
}
: function() {};

return {
init : function() {
/* Hide all of the menu sections initially. */
display('m1', false);
display('m2', false);
display('m3', false);
},
expand : function(i) {
/* No matter which item is activated, the currently
* active item will always need to be hidden.
*/
if(active) {display(active, false);}
/* If the user wasn't trying to hide the active item,
* show the one that was just selected.
*/
if(!active || (i != active.id)) {active = display(i, true);}
else {active = null;}
}
};
})();

Also, the links should stay as they originally were. That is, they should
pass the id of the menu. You can pass a reference, but that should be:

<a ... onclick="menu.expand(this.nextSibling); return false;">

The final change was that I decided to make the getElementById feature
test a one-time affair. I was going to do that initially, but didn't for
some reason.

Sorry for the ****-up,
Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top