Is there a workaround for IE 6/7 “Unspecified Error” bug when accessing offsetParent

前端 未结 6 1912
一个人的身影
一个人的身影 2020-12-29 15:45

I\'m using jQuery UI\'s draggable and droppable libraries in a simple ASP.NET proof of concept application. This page uses the ASP.NET AJAX UpdatePanel to do partial page up

6条回答
  •  失恋的感觉
    2020-12-29 16:31

    If you would like to fix the minified/compressed .js file for jQuery version 1.4.2, replace:

    var d=b.getBoundingClientRect(),
    

    with

    var d = null; 
    try { d = b.getBoundingClientRect(); }
    catch(e) { d = { top : b.offsetTop, left : b.offsetLeft } ; }
    

    (note that there is no comma after the closing brace now)

提交回复
热议问题