Google DART: How to get clientWidth property with dart:dom

Google DART: How to get clientWidth property with dart:dom

#import('dart:dom');

class DOMclientWidth {

}

void main() {

/* This code works with dart:dom */

HTMLElement myDiv = window.document.createElement('div');
myDiv.id = 'TEST';
myDiv.innerHTML = 'Test div for testing dart:dom:clientWidth';
myDiv.style.setProperty('background', '#ff0000');

window.document.body.appendChild(myDiv);

myDiv.innerHTML += '
clientWidth :: ' + myDiv.clientWidth;
}

by Moisés Belchín

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s