This is a migrated thread and some comments may be shown as answers.

Found a bug about the embedded JQuery

3 Answers 62 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Big Q
Top achievements
Rank 1
Big Q asked on 16 Feb 2011, 08:50 AM
hello telerik,
When I used the embedded JQuery to get the height or width of a element , it always less than the actual value 6px;

for example ,there is a control :  <input id='a' style='height:30px' value='test'>
when I use the method $("#a").css("height") , it returns a incorrect value: 24px ;  But when I use the earlier version of jquery.js , it would give me a correct value 30px;

3 Answers, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 16 Feb 2011, 10:47 AM
Hi Big Q,

The jQuery that comes with RadControls for ASP.NET AJAX Q3 2010 SP2 (the one you have indicated to be using) is 1.4.4. Using that, I am getting a correct value for the height of the input element you have. Only in IE6 and in Quirks Mode in other IE versions I am getting 24px, but this is due to the broken box model in these browser modes. In the same scenario, the input DOM element's clientHeight is returnings 24.

Veli
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Big Q
Top achievements
Rank 1
answered on 17 Feb 2011, 02:29 AM
Hi,
My borswer is IE8 and the version of radcontrol is 2010.3.1317.40.  In addition, maybe I didn't express clearly, that phenomenon I described yesterday was a control within RadEditor. Below is the screenshot and code.

function bbb() {
            var editor = $telerik.findEditor("<%=RadEditor1.ClientID%>");
            var elem = $(editor.getSelectedElement());            
            alert(elem.css("height"));
        }
0
Veli
Telerik team
answered on 17 Feb 2011, 01:40 PM
What is the clientHeight of the same DOM element? If it is equal to the value reported by jQuery, the behavior is correct and the DOM box model is the problem.

Veli
the Telerik team
Tags
General Discussions
Asked by
Big Q
Top achievements
Rank 1
Answers by
Veli
Telerik team
Big Q
Top achievements
Rank 1
Share this question
or