majorpay
4 Oct 2007, 12:36 PM
I attached this to the body:
function setupKeyNav(){
var keynav = new Ext.KeyNav('docs', {
"up" : function(e){
ImageClass.prevImage();
},
"down" : function(e){
ImageClass.nextImage();
},
"left" : function(e){
ImageClass.prevPage();
},
"right" : function(e){
ImageClass.nextPage();
},
scope : this
});
}
where 'docs' is the body id - It works beautifully in IE 7, but doesn't work at all in Firefox. Any thoughts? I have also tried creating a body-wide div and using that - that doesn't work in FF either.
edit: in Firefox, there is only one place you can click on to get it to work (which opens a new page), but even after that, the keynav only works 1 time, then you have to click on the link again and go back to get it to work again.
function setupKeyNav(){
var keynav = new Ext.KeyNav('docs', {
"up" : function(e){
ImageClass.prevImage();
},
"down" : function(e){
ImageClass.nextImage();
},
"left" : function(e){
ImageClass.prevPage();
},
"right" : function(e){
ImageClass.nextPage();
},
scope : this
});
}
where 'docs' is the body id - It works beautifully in IE 7, but doesn't work at all in Firefox. Any thoughts? I have also tried creating a body-wide div and using that - that doesn't work in FF either.
edit: in Firefox, there is only one place you can click on to get it to work (which opens a new page), but even after that, the keynav only works 1 time, then you have to click on the link again and go back to get it to work again.