View Full Version : Why use stopObserving and how to in this example?

09-10-2011, 02:31 AM
Hey all,

I have a quick question. Because I need to make my site compatible with screenreaders, there is one section in which they tab thru a carousel type thing. I have it all working fine, but once they exit it - should I stop "observing" on keydown? Or does it not affect much.

I have this (part of the code):

$$("#caro-list li a")[pos].observe("keydown", function(e){
$$("#listing li")[pos ].select('a').last().observe("keydown", function(e){

And I was thinking that after that func call "tiein" I could then stopObserving that element. So two questions.
1. Is this necessary? (they will not be going over the elements again, so should I stop observing).
2. How?

In reference to #2 I tried:
e.stopObserving etc.. didnt' work
e.currentTarget.stopObserving etc.. didn't work

I didn't try using the who same path as I am looking for some sleak and streamlined...
$$("#caro-list li a")[pos].stopObserving("keydown")

Any ideas?