Alex Rivera | Logout

What is the equivalent of getBoundingClientRect on iPhone Mobile Safari 3?

Asked 2010-05-07T23:04:54.303
12

iPhone Mobile Safari seems to be missing element.getBoundingClientRect. What is the equivalent method on iPhone Mobile Safari? This method exists on the iPad.

Edit
Report

1 Answer

2

For anyone looking for the ele.getBoundingClientRect().width method on iOS 3, you can use ele.offsetWidth

 if("getBoundingClientRect" in this.container) {
    this.width = this.container.getBoundingClientRect().width ;    
}else {
    this.width = this.container.offsetWidth;    //http://help.dottoro.com/ljvmcrrn.php
}
answered 2012-07-23T10:01:07.147

Your Answer