views:

122

answers:

1

i need to disable the arrow keys in a flowplayer.org scrollable i have a text input that i cant move between the letters due to the scroller moving when arrow keys pressed, i dont care to disable the scroller keys permanently.

thanks

link to scrollable

link to forum to disable keys

+1  A: 

You need to assign your scrollable instance to a variable:

var yourScrollable = $(".yourScrollableClass").eq(1).data("scrollable");

And then disable the keyboard navigation (in your case, on focus on a text input):

$('.inputClass').focus(function() { yourScrollable.getConf().keyboard=false; });

Then you can set this back to true on blur of your text input.

$('.inputClass').blur(function() { yourScrollable.getConf().keyboard=true; });
mVChr
this is my actual code where do i place your code?$(document).ready(function() {$("#mySelect").change(function(){ $("#myDiv").load( $(this).val(), function(){ $(this).find("div.scrollable").scrollable();} );});});thanks!
loo
Just before the last }); should work. Replace ".yourScrollableClass" with ".scrollable" and '.inputClass' with whatever the class of the input in question is, or 'input' for all inputs (or 'textarea' if that). Good luck!
mVChr
thanks for getting back!im getting this error yourScrollable is undefined$('input').focus(function() { yourScrollable.getConf().keyboard=false; }); this is my code$(document).ready(function() {$("#mySelect").change(function(){ $("#myDiv").load( $(this).val(), function(){ $(this).find("div.scrollable").scrollable();} );});var yourScrollable = $(".scrollable").eq(1).data("scrollable");$('input').focus(function() { yourScrollable.getConf().keyboard=false; });$('input').blur(function() { yourScrollable.getConf().keyboard=true; });});
loo
You might need to add a test for when pages don't contain a scrollable element. To test if yourScrollable exists, you can change the interior of the focus and blur functions to: if (yourScrollable.length) { yourScrollable.getConf().keyboard=false; }Good luck again!
mVChr

related questions