you dont pass any parameters to fireEvent, hence no event is passed to the function and e is undefined. That results in an error aborting the further execution. You could replace the e.stop() either with a return false; at the end of the function or:
if (e){
        e.stop();
        // any stuff you want to do with the event
}

On Dec 8, 2008, at 7:32, eduacostam wrote:


I have this code:

$$('#menu>li>a').each(function(el){
        el.addEvent('click', function(e) {
                e.stop();

                // More code
        });
});

if (window.location.hash) {
        $(window.location.hash.substr(1)).fireEvent('click');
}


before that code runs I've allready set the click event for the
possible id's of window.location.hash.
does anyone knows why this don't work?

thanks

--
Jan - MooTools comitter
twitter/blog: http://kassens.net

Reply via email to