By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,771 Members | 1,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,771 IT Pros & Developers. It's quick & easy.

Explanation wanted of how script is called

P: n/a
http://www.htmldog.com/articles/suck...le/bones2.html

#nav li:hover ul ul, #nav li.sfhover ul ul {
left: -999em;
}

I am assuming that the class is created by the scripting?
What if the visitor has JS turned off?
What happens when this created class is not found?

What I don't understand is, even with JS turned off, the menu works just
fine, so why have the script?

Tested in both IE and FF.

Jul 23 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Richard wrote:
http://www.htmldog.com/articles/suck...le/bones2.html

#nav li:hover ul ul, #nav li.sfhover ul ul {
left: -999em;
}

I am assuming that the class is created by the scripting?
What if the visitor has JS turned off?
What happens when this created class is not found?

What I don't understand is, even with JS turned off, the menu works just
fine, so why have the script?

Tested in both IE and FF.


Because its a CSS menu, not a Javascript menu.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #2

P: n/a
On Sat, 05 Mar 2005 12:13:04 -0500 Randy Webb wrote:
Richard wrote:
http://www.htmldog.com/articles/suck...le/bones2.html

#nav li:hover ul ul, #nav li.sfhover ul ul {
left: -999em;
}

I am assuming that the class is created by the scripting?
What if the visitor has JS turned off?
What happens when this created class is not found?

What I don't understand is, even with JS turned off, the menu works just
fine, so why have the script?

Tested in both IE and FF.


Because its a CSS menu, not a Javascript menu.


Duhhh nah really?
All I want to know is what's the purpose of the script to begin with?
As far as I can tell, it's not even being called to do work.
Jul 23 '05 #3

P: n/a
Richard wrote:
On Sat, 05 Mar 2005 12:13:04 -0500 Randy Webb wrote:

Richard wrote:

http://www.htmldog.com/articles/suck...le/bones2.html

#nav li:hover ul ul, #nav li.sfhover ul ul {
left: -999em;
}

I am assuming that the class is created by the scripting?
What if the visitor has JS turned off?
What happens when this created class is not found?

What I don't understand is, even with JS turned off, the menu works just
fine, so why have the script?

Tested in both IE and FF.
Because its a CSS menu, not a Javascript menu.

Duhhh nah really?
All I want to know is what's the purpose of the script to begin with?


If you can't read the page and understand it, then you sure won't
understand it if I can explain it.
As far as I can tell, it's not even being called to do work.


And that is why you are the one thats asking about it and not me. RTFM.
Because in certain scenarios, it *does* get called to do work. But if
you understood enough about scripting to know what
if(window.attachEvent) meant, you would understand when, and why, it is
called.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #4

P: n/a
Richard wrote:
On Sat, 05 Mar 2005 12:13:04 -0500 Randy Webb wrote:
Richard wrote:
http://www.htmldog.com/articles/suck...le/bones2.html
#nav li:hover ul ul, #nav li.sfhover ul ul {
left: -999em;
}
I am assuming that the class is created by the scripting?
What if the visitor has JS turned off?
What happens when this created class is not found?
What I don't understand is, even with JS turned off, the menu works just
fine, so why have the script?
Tested in both IE and FF.

Because its a CSS menu, not a Javascript menu.

Duhhh nah really?
All I want to know is what's the purpose of the script to begin with?
As far as I can tell, it's not even being called to do work.


5 minutes with google will show you a lot:

http://msdn.microsoft.com/workshop/a...ttachevent.asp
attachEvent Method
Binds the specified function to an event, so that the function
gets called whenever the event fires on the object.
http://www.quirksmode.org/js/events_advanced.html
http://www.quirksmode.org/js/this.html
http://www.quirksmode.org/
Javascript > Events > Introduction to Events
http://www.htmldog.com/articles/suckerfish/dropdowns/
...And that will sort out everything for those browsers that fully
support the :hover pseudo class, but for Internet Explorer we
need to set the Suckerfish JavaScript loose:
sfHover = function() {...
http://www.htmldog.com/articles/suckerfish/
The Suckerfish...
Right. So, basically, in browsers such as Mozilla, Opera and Safari
you can use :hover, :active and :focus to achieve the effects that
the CSS standards intend. The trouble is that when it comes to
anything other than links, Internet Explorer ignores these
pseudo-classes (and it doesn't like :focus at all). To get around
this we can use JavaScript similar to the following:
sfHover = function() {...

Mike
Jul 23 '05 #5

P: n/a
On Sat, 05 Mar 2005 13:19:57 -0800 mscir wrote:
Richard wrote:
On Sat, 05 Mar 2005 12:13:04 -0500 Randy Webb wrote:
Richard wrote:
http://www.htmldog.com/articles/suck...le/bones2.html
#nav li:hover ul ul, #nav li.sfhover ul ul {
left: -999em;
}
I am assuming that the class is created by the scripting?
What if the visitor has JS turned off?
What happens when this created class is not found?
What I don't understand is, even with JS turned off, the menu works just
fine, so why have the script?
Tested in both IE and FF.
Because its a CSS menu, not a Javascript menu. Duhhh nah really?
All I want to know is what's the purpose of the script to begin with?
As far as I can tell, it's not even being called to do work.


5 minutes with google will show you a lot:

http://msdn.microsoft.com/workshop/a...thods/attachev
ent.asp
attachEvent Method
Binds the specified function to an event, so that the function
gets called whenever the event fires on the object.
http://www.quirksmode.org/js/events_advanced.html
http://www.quirksmode.org/js/this.html
http://www.quirksmode.org/

Javascript >> Events > Introduction to Events http://www.htmldog.com/articles/suckerfish/dropdowns/
...And that will sort out everything for those browsers that fully
support the :hover pseudo class, but for Internet Explorer we
need to set the Suckerfish JavaScript loose:
sfHover = function() {...
http://www.htmldog.com/articles/suckerfish/
The Suckerfish...
Right. So, basically, in browsers such as Mozilla, Opera and Safari
you can use :hover, :active and :focus to achieve the effects that
the CSS standards intend. The trouble is that when it comes to
anything other than links, Internet Explorer ignores these
pseudo-classes (and it doesn't like :focus at all). To get around
this we can use JavaScript similar to the following:
sfHover = function() {...

Mike

Thank you. That's what I wanted to know.
I wasn't sure what was triggering the script.
Jul 23 '05 #6

P: n/a
On Sat, 05 Mar 2005 15:32:21 -0500 Randy Webb wrote:
Richard wrote:
On Sat, 05 Mar 2005 12:13:04 -0500 Randy Webb wrote:

Richard wrote:
http://www.htmldog.com/articles/suck...le/bones2.html

#nav li:hover ul ul, #nav li.sfhover ul ul {
left: -999em;
}

I am assuming that the class is created by the scripting?
What if the visitor has JS turned off?
What happens when this created class is not found?

What I don't understand is, even with JS turned off, the menu works just
fine, so why have the script?

Tested in both IE and FF.

Because its a CSS menu, not a Javascript menu.

Duhhh nah really?
All I want to know is what's the purpose of the script to begin with?


If you can't read the page and understand it, then you sure won't
understand it if I can explain it.
As far as I can tell, it's not even being called to do work.


And that is why you are the one thats asking about it and not me. RTFM.
Because in certain scenarios, it *does* get called to do work. But if
you understood enough about scripting to know what
if(window.attachEvent) meant, you would understand when, and why, it is
called.
--


You just have to be a smart ass don't you?
You could just say, "The function is triggered by the movement of the mouse
over the specified area.".
Jul 23 '05 #7

P: n/a
Richard wrote:
On Sat, 05 Mar 2005 15:32:21 -0500 Randy Webb wrote:

Richard wrote:
On Sat, 05 Mar 2005 12:13:04 -0500 Randy Webb wrote:

Richard wrote:

>http://www.htmldog.com/articles/suck...le/bones2.html
>
>#nav li:hover ul ul, #nav li.sfhover ul ul {
>left: -999em;
>}
>
>I am assuming that the class is created by the scripting?
>What if the visitor has JS turned off?
>What happens when this created class is not found?
>
>What I don't understand is, even with JS turned off, the menu works just
>fine, so why have the script?
>
>Tested in both IE and FF.

Because its a CSS menu, not a Javascript menu.

Duhhh nah really?
All I want to know is what's the purpose of the script to begin with?
If you can't read the page and understand it, then you sure won't
understand it if I can explain it.

As far as I can tell, it's not even being called to do work.


And that is why you are the one thats asking about it and not me. RTFM.
Because in certain scenarios, it *does* get called to do work. But if
you understood enough about scripting to know what
if(window.attachEvent) meant, you would understand when, and why, it is
called.
--

You just have to be a smart ass don't you?


Only to dumbasses who repeatedly ask questions without doing a little
research first.
You could just say, "The function is triggered by the movement of the mouse
over the specified area.".


And give incorrect/incomplete answers like you do? No thanks.

That is not the only part of that script, and hence my reply. The
function is triggered if, and only if, three things happen:

1) The UA supports window.attachEvent
2) The UA successfully attaches an even to the window
3) The movement of the mouse over the window.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.