Search code examples
javascriptjqueryair

Adobe Air Client and Javascript, option list is not scrolling


I'm using Air Client with HTML, CSS and Javascript. Trying to scroll the option list using up and down arrow keys. But it seems scrollbar is not scrolling to the top or bottom of the list using up or down key events.I tried following javascript from an Old Post

var SubTypeOptionCount = $("select[name='sub_type']").find("option").length -1;                 

$("select[name='type']")
    .scrollTop($("select[name='type']"\).find("option[value=68]").offset().top);

$("select[name='sub_type']")
    .scrollTop($("select[name='sub_type']").find("option[value=" + SubTypeOptionCount + "]").offset().top);

While testing with chrome or FF. I got an error offset is undefined function.

Please find image attached for details

Screen Grab

Let me know, what I am missing.

EDIT: Added JsFiddle on request.(http://jsfiddle.net/3av7T/2/)


Solution

  • Air Client would be having some issues with offset. I had same issue with AIR. Just try out:

    $('select').scrollTop(30);
    

    Ignore size of the select from a post :