jQuery ui datepicker positioning problem when scrolling down webpage

前端 未结 10 1167
野的像风
野的像风 2021-01-02 11:30

I have a webpage that uses multiple instances of the jQuery ui datepicker. My webpage will display ~80 records which extends beyond a single screenshot.

<         


        
10条回答
  •  醉梦人生
    2021-01-02 12:04

    I encountered this same problem with jQuery UI version 1.9.2 and IE9.

    There appears to be a function in jQuery UI entitled _checkOffset that is meant to take care of this problem. It doesn't work.

    It attempts to use $(document).scrollTop(), which always seems to return 0 in IE9. I had to alter the contents of the function to use document.body.scrollTop instead when the jQuery function returns zero. Thus replace

    $(document).scrollTop()
    

    with

    ($(document).scrollTop()||document.body.scrollTop)
    

    everywhere in _checkOffset in order to 'fix' jQuery UI and make it work properly.

提交回复
热议问题