jlizarraga
03-13-2009, 06:38 AM
Hi all,
Is there a way to test if the client supports the resize property?
EDIT: Figured it out, thanks to Filament Group (http://www.filamentgroup.com/lab/delivering_the_right_experience_to_the_right_device/) and MDC (https://developer.mozilla.org/en/DOM/window.getComputedStyle).
try{ // CSS3 Resize Test
document.styleSheets[0].insertRule("#css3-resize-test { display: none; resize: both; }", document.styleSheets[0].cssRules.length);
var oResizeTest = document.createElement("textarea");
oResizeTest.id = "css3-resize-test";
document.body.appendChild(oResizeTest);
if(window.getComputedStyle(oResizeTest, null).getPropertyValue("resize") == "both"){
// Your code here.
}
}
catch(pError){}
Is there a way to test if the client supports the resize property?
EDIT: Figured it out, thanks to Filament Group (http://www.filamentgroup.com/lab/delivering_the_right_experience_to_the_right_device/) and MDC (https://developer.mozilla.org/en/DOM/window.getComputedStyle).
try{ // CSS3 Resize Test
document.styleSheets[0].insertRule("#css3-resize-test { display: none; resize: both; }", document.styleSheets[0].cssRules.length);
var oResizeTest = document.createElement("textarea");
oResizeTest.id = "css3-resize-test";
document.body.appendChild(oResizeTest);
if(window.getComputedStyle(oResizeTest, null).getPropertyValue("resize") == "both"){
// Your code here.
}
}
catch(pError){}