I'm trying to use the bind to the windows.onscroll event with
Event.observe, but it doesn't work. No error is reported.

Here is a small bit of JavaScript I am using:

function initPage()
{
  Event.observe("window", "scroll", function() { alert("Hello
World"); });
}

document.observe('dom:loaded', initPage);

But I don't get anything. Am I doing something wrong?

It does work If I do:

function initPage()
{
  window.onscroll = function() { alert("Hello World"); }
}

document.observe('dom:loaded', initPage);




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to