Sat, Dec 17 2005 1:03 AM
Erwyn van der Meer
Since a couple of weeks I am very busy working on a new project. We are building a hosted HTML application for Windows Media Center Edition 2005.
MCFocusable attribute on HTML elements as an indication that the element can receive the focus. They also use
.htc files. A much cleaner approach is to use CSS classes on elements to indicate behavior and to attach appropriate events like
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
This puts IE 6.0 in (Almost) Standards Mode. We are still working on resolving some of these issues.
One issue we solved is the scaling behavior of the site when the site is not running full screen in Windows Media Center. The application can be running in a window that can be scaled by the user. You author a page as if the resolution is always 1024*768 pixels or 1366*768 pixels. In Quirks Mode the scaling is a simple as using
Filed under: .NET, Work
document.body.style.zoom = nScale;. This scales all HTML elements on the page. But in Standards Mode absolutely positioned elements do not scale. We added code to the
onScaleEvent function to walk the DOM tree and scale each absolutely positioned element individually. It was a bit tricky because these elements have to be repositioned as well, i.e., the
top CSS properties have to be scaled. This involved storing the original positions using a expando
initialPosition property on the HTML elements and using these for the scaling calculation.